{"id":24648,"library":"sslcrypto","title":"sslcrypto","description":"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.","status":"active","version":"5.3","language":"python","source_language":"en","source_url":"https://github.com/imachug/sslcrypto","tags":["encryption","elliptic-curve","aes","rsa","ecies","crypto","openssl"],"install":[{"cmd":"pip install sslcrypto","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install sslcrypto[all]","lang":"bash","label":"Install with all backend dependencies"}],"dependencies":[{"reason":"Optional backend for faster operations","package":"cryptography","optional":true}],"imports":[{"note":"Module is lowercase 'aes' in version 5.x","wrong":"from sslcrypto import AES","symbol":"aes","correct":"from sslcrypto import aes"},{"note":"Module is 'ecc' and does not export 'ECC' class","wrong":"from sslcrypto.ecc import ECC","symbol":"ecc","correct":"from sslcrypto import ecc"},{"note":"Module is 'rsa', not 'RSA'","wrong":"from sslcrypto.rsa import RSA","symbol":"rsa","correct":"from sslcrypto import rsa"}],"quickstart":{"code":"from sslcrypto import aes\n\nkey = aes.generate_key()\niv = aes.generate_iv()\n\ncipher = aes.new(key, aes.MODE_CBC, iv=iv)\nencrypted = cipher.encrypt(b'secret message')\n\ndecipher = aes.new(key, aes.MODE_CBC, iv=iv)\ndecrypted = decipher.decrypt(encrypted)\nprint(decrypted)","lang":"python","description":"Generate an AES key, IV, encrypt and decrypt a message using CBC mode."},"warnings":[{"fix":"Update to new pattern if you were passing curve as keyword to low-level functions; generally safe if using high-level wrappers.","message":"Version 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.","severity":"breaking","affected_versions":">=5.0"},{"fix":"Encode/decode to base64 manually if needed: base64.b64encode(encrypted)","message":"AES encryption in version 5 returns bytes object in Python 3, not base64 string as in older versions. Decryption expects raw bytes.","severity":"breaking","affected_versions":">=5.0"},{"fix":"Use cipher.encrypt(data) instead of cipher.ciphertext","message":"The `ciphertext` attribute of AES objects is deprecated; use `cipher.encrypt()` return value directly.","severity":"deprecated","affected_versions":">=4.0"},{"fix":"pip install sslcrypto[all]","message":"Default backend selection may fail on systems without OpenSSL. Install with `[all]` extra to ensure fallback works.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install sslcrypto`","cause":"sslcrypto is not installed.","error":"ModuleNotFoundError: No module named 'sslcrypto'"},{"fix":"Install sslcrypto with 'all' extra: `pip install sslcrypto[all]`","cause":"No OpenSSL, LibreSSL, or cryptography library found. Pure Python fallback not available because optional dependencies are missing.","error":"sslcrypto.lib.backend.UnavailableBackendError: Cannot find any suitable backend"},{"fix":"Ensure iv is bytes: `iv = b'some_16_byte_iv'` or `iv = os.urandom(16)`","cause":"Passed a non-bytes value (e.g., string) to AES initialization (iv argument).","error":"TypeError: initial_value must be bytes or None"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}