https://github.com/olekssy/pqc_bridge
Quantum-resistant secure communication using ML-KEM (Kyber) and ML-DSA (Dilithium) post-quantum cryptography
https://github.com/olekssy/pqc_bridge
dilithium encryption kyber post-quantum-cryptography quantum-resistant rust
Last synced: 6 months ago
JSON representation
Quantum-resistant secure communication using ML-KEM (Kyber) and ML-DSA (Dilithium) post-quantum cryptography
- Host: GitHub
- URL: https://github.com/olekssy/pqc_bridge
- Owner: olekssy
- License: mit
- Created: 2025-10-23T17:54:01.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-06T19:13:49.000Z (7 months ago)
- Last Synced: 2025-12-12T22:00:13.937Z (6 months ago)
- Topics: dilithium, encryption, kyber, post-quantum-cryptography, quantum-resistant, rust
- Language: Rust
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pqc_bridge
[](https://docs.rs/pqc_bridge/latest/pqc_bridge/)
[](https://crates.io/crates/pqc_bridge)



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)
## Quick Start
### Installation
Install as a dependency:
```bash
cargo add pqc_bridge
```
Install as a CLI tool:
```bash
cargo install pqc_bridge
```
### Library Usage
```rust
use 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);
```
### CLI Usage
```bash
# 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.sec
```
## How It Works
**Hybrid Encryption:**
1. Kyber encapsulates a random AES-256 key using recipient's public key
2. AES-256-GCM encrypts the message with the encapsulated key (fast + quantum-resistant)
**Digital Signatures:**
1. SHA3-256 hashes the message, Dilithium signs the hash
2. 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
## References
- [NIST Post-Quantum Cryptography Standardization](https://csrc.nist.gov/projects/post-quantum-cryptography)
- [NIST FIPS 203 - ML-KEM](https://csrc.nist.gov/publications/detail/fips/203/final)
- [NIST FIPS 204 - ML-DSA](https://csrc.nist.gov/publications/detail/fips/204/final)
- [CRYSTALS-Kyber](https://pq-crystals.org/kyber/)
- [CRYSTALS-Dilithium](https://pq-crystals.org/dilithium/)
## License
MIT License - See [LICENSE](LICENSE) for details.
---
**Note:** Responsibility for secure implementation rests with the user. Consult cryptography experts for production use.