File encryption from the terminal. RSA-2048 for key exchange, AES-256-GCM for the data same idea as TLS.
pip install cryptographygenerate a keypair
python run.py genkeys --name alice --passphrase hunter2encrypt a file
python run.py encrypt --to alice --file secret.txt
# outputs secret.txt.encdecrypt a file
python run.py decrypt --key alice --passphrase hunter2 --file secret.txt.enc
# outputs secret.txt- random 32-byte AES session key is generated
- file is encrypted with AES-256-GCM (random 16-byte nonce)
- session key is wrapped with recipient's RSA public key (OAEP + SHA-256)
- output is packed as
[4B key length][encrypted key][nonce][ciphertext]
private keys are stored encrypted — passphrase is stretched with PBKDF2 (100k iterations, SHA-256) before being used to AES-GCM wrap the key material.
keys.py — keypair generation, keystore (pbkdf2 + aes-gcm)
box.py — encrypt/decrypt logic
run.py — CLI
keys/ — generated keys land here