A lightweight Rust library for post-quantum cryptography providing secure key management, encryption, and digital signatures using NIST-standardized algorithms.
Key Features:
- Intuitive API for building secure, quantum-resistant communication systems
- Unified Rust library and CLI tool in one package for file-based and programmatic operations
- Hybrid encryption (Kyber x AES-256-GCM) and signatures (Dilithium x SHA3-256)
- Provides NIST Level 3 192-bit security for encryption and signatures
- Compliant with NIST FIPS 203 (ML-KEM-768) and FIPS 204 (ML-DSA-65)
Install as a dependency:
cargo add pqc_bridgeInstall as a CLI tool:
cargo install pqc_bridgeuse pqc_bridge::{KeyPair, encrypt, decrypt, sign, verify};
let message = "Secret message";
let keypair = KeyPair::generate();
// Encryption
let encrypted = encrypt(message, &keypair.to_public_key());
let decrypted = decrypt(encrypted, &keypair);
assert_eq!(message, decrypted);
// Signing
let signature = sign(message, &keypair);
let is_signature_valid = verify(message, &signature, &keypair.to_public_key());
assert!(is_signature_valid);# Generate keypair
pqc keygen -o alice # Creates alice.sec and alice.pub
# Encrypt message
pqc encrypt -m "Hello!" -k alice.pub -o encrypted.pqc
# Encrypt file
pqc encrypt -m @message.txt -k alice.pub -o encrypted.pqc
# Decrypt message
pqc decrypt -i encrypted.pqc -k alice.secHybrid Encryption:
- Kyber encapsulates a random AES-256 key using recipient's public key
- AES-256-GCM encrypts the message with the encapsulated key (fast + quantum-resistant)
Digital Signatures:
- SHA3-256 hashes the message, Dilithium signs the hash
- Verification checks signature against message hash with sender's public key
Security Features:
- Automatic zeroization of secret keys in memory
- JSON serialization with Base64 encoding
- File-based operations via CLI
- NIST Post-Quantum Cryptography Standardization
- NIST FIPS 203 - ML-KEM
- NIST FIPS 204 - ML-DSA
- CRYSTALS-Kyber
- CRYSTALS-Dilithium
MIT License - See LICENSE for details.
Note: Responsibility for secure implementation rests with the user. Consult cryptography experts for production use.