cryptography

Cryptographic recipes and primitives for Python applications

brewmacoslinux
Try with needOr install directly
Source

About

Cryptographic recipes and primitives for Python

Commands

cryptography

Examples

Generate a private key for RSA encryption$ python3 -c "from cryptography.hazmat.primitives.asymmetric import rsa; key = rsa.generate_private_key(public_exponent=65537, key_size=2048); print('Key generated')"
Encrypt data using Fernet symmetric encryption$ python3 -c "from cryptography.fernet import Fernet; key = Fernet.generate_key(); f = Fernet(key); encrypted = f.encrypt(b'secret data'); print(encrypted)"
Hash a password using bcrypt$ python3 -c "from cryptography.hazmat.primitives import hashes; from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2; print('Password hashing available')"