Registry / auth-security / sslcrypto

sslcrypto

JSON →
library5.3pypypi✓ verified 88d ago

sslcrypto is a Python library providing ECIES (Elliptic Curve Integrated Encryption Scheme), AES, and RSA encryption with OpenSSL-based implementation and a pure Python fallback. Current version 5.3 offers multiple backends (OpenSSL, LibreSSL, cryptography, pure Python) and supports a wide range of curves and RSA key sizes. Release cadence is irregular, with occasional major version bumps due to API changes.

pip install sslcrypto
INSTALL
IMPORT
SIG · SSLCRYPTO
S
sslcrypto
auth-securitypythonv5.3
Install
2.6s avg
Import
65ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.060s · 19.7MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 2.6s · import 0.069s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

aes
✓ from sslcrypto import aes
✗ from sslcrypto import AES
Module is lowercase 'aes' in version 5.x
ecc
✓ from sslcrypto import ecc
✗ from sslcrypto.ecc import ECC
Module is 'ecc' and does not export 'ECC' class
rsa
✓ from sslcrypto import rsa
✗ from sslcrypto.rsa import RSA
Module is 'rsa', not 'RSA'

Generate an AES key, IV, encrypt and decrypt a message using CBC mode.

from sslcrypto import aes key = aes.generate_key() iv = aes.generate_iv() cipher = aes.new(key, aes.MODE_CBC, iv=iv) encrypted = cipher.encrypt(b'secret message') decipher = aes.new(key, aes.MODE_CBC, iv=iv) decrypted = decipher.decrypt(encrypted) print(decrypted)
Debug
Known issues
breakingVersion 4.x to 5.x broke named curve arguments: use curve name as string directly, not as key in a dict. Previous usage `curve='secp256k1'` still works, but internal API changed.
fix
Update to new pattern if you were passing curve as keyword to low-level functions; generally safe if using high-level wrappers.
affects: >=5.0
breakingAES encryption in version 5 returns bytes object in Python 3, not base64 string as in older versions. Decryption expects raw bytes.
fix
Encode/decode to base64 manually if needed: base64.b64encode(encrypted)
affects: >=5.0
deprecatedThe `ciphertext` attribute of AES objects is deprecated; use `cipher.encrypt()` return value directly.
fix
Use cipher.encrypt(data) instead of cipher.ciphertext
affects: >=4.0
gotchaDefault backend selection may fail on systems without OpenSSL. Install with `[all]` extra to ensure fallback works.
fix
pip install sslcrypto[all]
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sslcrypto'
sslcrypto is not installed.
fix
Run `pip install sslcrypto`
sslcrypto.lib.backend.UnavailableBackendError: Cannot find any suitable backend
No OpenSSL, LibreSSL, or cryptography library found. Pure Python fallback not available because optional dependencies are missing.
fix
Install sslcrypto with 'all' extra: `pip install sslcrypto[all]`
TypeError: initial_value must be bytes or None
Passed a non-bytes value (e.g., string) to AES initialization (iv argument).
fix
Ensure iv is bytes: `iv = b'some_16_byte_iv'` or `iv = os.urandom(16)`
Upgrade
Version history
5.3latest on PyPI · released Apr 8, 2020
Audit
Dependencies
cryptographyoptionalOptional backend for faster operations
Agent activity
40 hits · last 30 days
node
34
Anthropic
1
OpenAI (training)
1
Resources
sslcrypto — pip install sslcrypto · libregistry