# 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
```sh
cargo install aes256
```
Or build from source:
```sh
cargo build --release
# binary: target/release/simpleaes256-rs
```
## Usage
```
simpleaes256-rs -e <file> encrypt a file
simpleaes256-rs -d <file> decrypt a file
```
**Encrypt**
```sh
simpleaes256-rs -e secret.txt
# prompts for password (twice)
# writes secret.txt.enc
# deletes secret.txt
```
**Decrypt**
```sh
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
| Key derivation | Argon2id (default parameters) |
| Encryption | AES-256-GCM |
| Nonce/salt generation | OS CSPRNG (`OsRng`) |
## Dependencies
| [`aes-gcm`](https://crates.io/crates/aes-gcm) | AES-256-GCM encrypt / decrypt |
| [`argon2`](https://crates.io/crates/argon2) | Password-based key derivation |
| [`rand`](https://crates.io/crates/rand) | Cryptographically secure random bytes |
| [`rpassword`](https://crates.io/crates/rpassword) | Hidden password prompt |
## License
MIT