NIST FIPS 203 · ML-KEM-768 · AES-256-GCM

pqguard
Post-Quantum Encryption

Encrypt files with NIST-standardized algorithms that resist both classical and quantum computer attacks. One command. Quantum-safe.

pqguard — post-quantum file encryption
$ pqguard keygen 🔐 Generating post-quantum keypair... Keypair generated: Public key: alice.pqg.pub Private key: alice.pqg.key $ pqguard encrypt secret.txt -r alice.pqg.pub 🔒 Encrypting 'secret.txt' with ML-KEM-768... Size: 1048576 bytes → 1048689 bytes (100.0%) KEM: ML-KEM-768 | Cipher: AES-256-GCM Encrypted → secret.pqg $ pqguard decrypt secret.pqg -k alice.pqg.key 🔓 Decrypting 'secret.pqg'... Decrypted: 1048576 bytes | Algorithm: ML-KEM-768 Decrypted → secret.txt

Why post-quantum?

Classical cryptography (RSA, ECDH) will be broken by quantum computers. "Harvest now, decrypt later" is happening today.

🔐

ML-KEM-768 (Kyber768)

NIST FIPS 203 — the post-quantum key encapsulation standard. 192-bit quantum security. Resists Shor's algorithm on quantum computers.

AES-256-GCM

Authenticated encryption with associated data. Industry-standard symmetric cipher. Quantum-resistant at 256-bit key size.

🔑

HKDF-SHA256

Hierarchical key derivation from shared secrets. Each encryption uses unique salt for complete key separation.

🛡️

Harvest Now, Decrypt Later

Adversaries store encrypted data today to decrypt with future quantum computers. pqguard makes this impossible.

Algorithm Stack

ComponentAlgorithmStandardSecurity
Key ExchangeML-KEM-768NIST FIPS 203192-bit quantum
Key DerivationHKDF-SHA256RFC 5869128-bit
Symmetric CipherAES-256-GCMNIST SP 800-38D256-bit
EncodingBase64RFC 4648

How encryption works

1

Generate random salt + nonce

32-byte salt for key derivation, 12-byte nonce for AES-GCM. Unique per encryption.

2

ML-KEM-768 encapsulate

Generate shared secret + ciphertext using recipient's public key. Only they can recover the secret.

3

Derive symmetric key

HKDF-SHA256(shared_secret, salt) → 256-bit AES key. Domain-separated per file.

4

AES-256-GCM encrypt

Authenticated encryption of file contents. Tamper-evident ciphertext with 128-bit auth tag.

5

Write PQGR envelope

Magic bytes + version + KEM ciphertext + nonce + salt + encrypted data. Self-contained file.

Get started in 30 seconds

One command. Quantum-safe encryption.

# Install $ cargo install pqguard # Generate keypair $ pqguard keygen 🔐 Generating post-quantum keypair... ✅ Keypair generated: Public key: default.pqg.pub Private key: default.pqg.key # Encrypt a file $ pqguard encrypt document.pdf -r default.pqg.pub 🔒 Encrypting 'document.pdf' with ML-KEM-768... ✅ Encrypted → document.pqg # Decrypt $ pqguard decrypt document.pqg -k default.pqg.key 🔓 Decrypting 'document.pqg'... ✅ Decrypted → document.pdf

Ready to go quantum-safe?

Install pqguard and encrypt your first file in 30 seconds.

View on GitHub crates.io →