ECIES, AES and RSA OpenSSL-based implementation with fallback
Likely abandoned. No release or commit for years (last release over 6 years ago).
pip install sslcryptoREADME as published on PyPI with version 5.3.
sslcrypto
sslcrypto is a fast and simple library for AES, ECIES and ECDSA for Python.
License: MIT + BSD-2 for ripemd implementation (see _ripemd.py).
Why?
sslcrypto can use OpenSSL in case it's available in your system for speedup, but pure-Python code is also available and is heavily optimized.
N.B. There are alternatives like coincurve which are faster in some cases (e.g. when using secp256k1). They don't include ECIES implementation and some useful ECDSA features and are specialized on a single curve. If that's enough for you and libsecp256k1 bindings are available for all OSes you need to support, use those libraries. Coincurve, in particular, ships pre-compiled packages for all major OSes and building from source does not require an existing libsecp256k1 installation.
N.B. While there are other mature cryptography libraries, they are too heavy for simple stuff and require OpenSSL that is not available by default on Windows (most likely many other OSes as well). That said, in case you're processing big data, not much data, the speed advantage you get from libraries is too small to use heavy alternatives.
Installation
pip install sslcrypto
Additionally, you can download this repository and run
python setup.py install.
Usage
AES
import sslcrypto
# Generate random key
key = sslcrypto.aes.new_key()
# Encrypt something
data = b"Hello, world!"
ciphertext, iv = sslcrypto.aes.encrypt(data, key)
# Decrypt
assert sslcrypto.aes.decrypt(ciphertext, iv, key) == data