HARTWELL_LABS

πŸ”’ pqguard

**Post-quantum file encryption CLI** β€” ML-KEM-768 (FIPS 203) + AES-256-GCM. Encrypt files using NIST-standardized post-quantum algorithms that resist both

πŸ”’ pqguard

πŸ§ͺ View test results β†’

Post-quantum file encryption CLI β€” ML-KEM-768 (FIPS 203) + AES-256-GCM.

Encrypt files using NIST-standardized post-quantum algorithms that resist both classical and quantum computer attacks.

Project status: production-quality Rust cryptography, NIST FIPS 203 compliant, fuzz-tested, published on crates.io.


🎯 What it does

CapabilityDescription
Post-quantum key exchangeML-KEM-768 (Kyber768) β€” NIST Level 3, resists Shor's algorithm
Hybrid encryptionKEM + HKDF-SHA256 + AES-256-GCM β€” industry-standard symmetric layer
CLI interfacekeygen, encrypt, decrypt, verify, info commands
Key managementNamed keypairs with public/private separation
File verificationIntegrity check without decryption
NIST complianceFIPS 203 (ML-KEM), FIPS 204 (ML-DSA), FIPS 205 (SLH-DSA)

βš™οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ENCRYPTION                                         β”‚
β”‚                                                     β”‚
β”‚  1. Generate random salt + nonce                    β”‚
β”‚  2. ML-KEM-768 encapsulate β†’ shared secret + ct     β”‚
β”‚  3. HKDF-SHA256(shared_secret, salt) β†’ aes_key     β”‚
β”‚  4. AES-256-GCM(aes_key, nonce, plaintext) β†’ ct    β”‚
β”‚  5. Write: PQGR β€– version β€– kem_ct β€– nonce β€–      β”‚
β”‚            salt β€– aes_ct                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DECRYPTION                                         β”‚
β”‚                                                     β”‚
β”‚  1. Parse PQGR envelope                             β”‚
β”‚  2. ML-KEM-768 decapsulate(ct, dk) β†’ shared_secret  β”‚
β”‚  3. HKDF-SHA256(shared_secret, salt) β†’ aes_key     β”‚
β”‚  4. AES-256-GCM decrypt(aes_key, nonce, aes_ct)     β”‚
β”‚  5. Output plaintext                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick start

# Install
cargo install pqguard

# Generate keypair
pqguard keygen

# Encrypt a file
pqguard encrypt secret.txt --recipient public_key.pqg.pub

# Multi-recipient β€” any listed private key can decrypt
pqguard encrypt secret.txt -r alice.pqg.pub -r bob.pqg.pub

# Decrypt
pqguard decrypt secret.pqg --private-key private_key.pqg.key

πŸ“– Commands

CommandDescription
pqguard keygenGenerate ML-KEM-768 keypair
pqguard encrypt <file> -r <pubkey>Encrypt file for one recipient
pqguard encrypt <file> -r <a> -r <b>Multi-recipient (v2 envelope)
pqguard decrypt <file> -k <privkey>Decrypt file with private key
pqguard verify <file>Verify pqguard file integrity
pqguard info <keyfile>Show key information

πŸ” Algorithm Details

ComponentAlgorithmStandard
Key ExchangeML-KEM-768 (Kyber768)NIST FIPS 203
Key DerivationHKDF-SHA256RFC 5869
Symmetric EncryptionAES-256-GCMNIST SP 800-38D

πŸ“Š Benchmarks

OperationTime
Keygen~150ΞΌs
Encapsulate~25ΞΌs
Decapsulate~30ΞΌs
AES-256-GCM (1MB)~0.5ms

πŸ§ͺ Why Post-Quantum?

Classical cryptography (RSA, ECDH) will be broken by quantum computers running Shor's algorithm. NIST finalized post-quantum standards in 2024:

  • ML-KEM (FIPS 203) β€” Key encapsulation
  • ML-DSA (FIPS 204) β€” Digital signatures
  • SLH-DSA (FIPS 205) β€” Hash-based signatures

The "harvest now, decrypt later" threat means data encrypted today with classical algorithms can be decrypted by future quantum computers. pqguard protects against this.

On this page