Skip to main content

openssl_enc_compat

Pure Python 2.7 and 3.x library that is compatible with OpenSSL 1.1.1+ encryption and decryption. https://github.com/clach04/openssl_enc_compat

This is intended to be used a library, rather than as a command line tool. Can encrypt/decrypt raw binary and base64 encoded content. Only supports aes-256-cbc with salt using pbkdf2. pbkdf2 iterations defaults to 10,000 to match OpenSSL default but can be specified.

Also checkout:

Sample

from openssl_enc_compat.cipher import OpenSslEncDecCompat

# echo hello| openssl enc -e aes-256-cbc -salt -pbkdf2 -iter 10000 -in - -base64 -out - -pass pass:password
openssl_crypted_base64_text = 'U2FsdGVkX18NXhFhTlAyvM2jXPu+hhsT344TvO0yLYk='  # base64
openssl_crypted_base64_text = b'Salted__\r^\x11aNP2\xbc\xcd\xa3\\\xfb\xbe\x86\x1b\x13\xdf\x8e\x13\xbc\xed2-\x89'  # raw binary
password = b'password'

print('openssl_crypted_base64_text: %r' % openssl_crypted_base64_text)
print('password: %r' % password)

cipher = OpenSslEncDecCompat(password)  # guess/default
plaintext = cipher.decrypt(openssl_crypted_base64_text)  # guesses if base64 encoded or note
print('plaintext: %r' % plaintext)

Quick demo:

python -m openssl_enc_compat.cipher

Run tests

python -m openssl_enc_compat.tests.testsuite -v

Metadata

Release files for openssl-enc-compat 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openssl-enc-compat 0.0.3
File Size Uploaded Provenance Actions
openssl_enc_compat-0.0.3.tar.gz 5.8 kB Without provenance Details for openssl_enc_compat-0.0.3.tar.gz

Release files / openssl_enc_compat-0.0.3.tar.gz

Download URL openssl_enc_compat-0.0.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
172001cf981fda217646f9bcca8968f8b906324cf15caf172ba791242a96b38c
BLAKE2b-256 checksum
How to use checksums
3773faebe6253f6bddb20aa78657587224c61cacbb8c7f3b6ed76346b3a6c682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for openssl-enc-compat 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page