simpleaes256cli 1.0.2

Minimal AES-256-GCM file encryption CLI — encrypt/decrypt files with a password
simpleaes256cli-1.0.2 is not a library.

aes256

Minimal AES-256-GCM file encryption CLI written in Rust.

Encrypts or decrypts a single file with a password. The original file is deleted after the operation succeeds.

Install

cargo install aes256

Or build from source:

cargo build --release
# binary: target/release/simpleaes256-rs

Usage

simpleaes256-rs -e <file>    encrypt a file
simpleaes256-rs -d <file>    decrypt a file

Encrypt

simpleaes256-rs -e secret.txt
# prompts for password (twice)
# writes  secret.txt.enc
# deletes secret.txt

Decrypt

simpleaes256-rs -d secret.txt.enc
# prompts for password
# writes  secret.txt   (strips .enc suffix)
# deletes secret.txt.enc

If the input file does not end in .enc, the output is written as <file>.dec.

File format

[0..4]   magic  "AE56"
[4..20]  salt   16 bytes  (Argon2id input)
[20..32] nonce  12 bytes  (AES-GCM nonce)
[32..]   ciphertext + 16-byte GCM authentication tag

Cryptography

Primitive Algorithm
Key derivation Argon2id (default parameters)
Encryption AES-256-GCM
Nonce/salt generation OS CSPRNG (OsRng)

Dependencies

Crate Role
aes-gcm AES-256-GCM encrypt / decrypt
argon2 Password-based key derivation
rand Cryptographically secure random bytes
rpassword Hidden password prompt

License

MIT