Overview • Algorithms • Features • Security • Installation • Quick Start • Research • Contributing
QuantumCrypt-AI is a production-grade post-quantum cryptography framework implementing NIST-standardized algorithms to protect communications and data against the emerging threat of quantum computing attacks. As quantum computers scale, current RSA and ECC cryptography will become vulnerable — QuantumCrypt-AI provides drop-in replacements for key encapsulation, digital signatures, and encryption that are secure against both classical and quantum adversaries.
This library implements the NIST Post-Quantum Cryptography Standardization finalists: ML-KEM (FIPS 203, formerly CRYSTALS-Kyber) for key encapsulation, ML-DSA (FIPS 204, formerly CRYSTALS-Dilithium) for digital signatures, and SLH-DSA (FIPS 205, formerly SPHINCS+) for stateless hash-based signatures. Additional modules include multi-party computation (MPC), format-preserving encryption, and side-channel resistant operations.
Disclaimer: This is a research and development project. While it implements NIST-standardized algorithms, production use in high-security environments should undergo independent security auditing and formal verification. See Security Considerations.
| Standard | Algorithm | Type | Key Size | Security Level |
|---|---|---|---|---|
| FIPS 203 | ML-KEM-512 (Kyber-512) | Key Encapsulation | 800/1632/768 | NIST Level 1 (AES-128) |
| FIPS 203 | ML-KEM-768 (Kyber-768) | Key Encapsulation | 1184/2400/1088 | NIST Level 3 (AES-192) |
| FIPS 203 | ML-KEM-1024 (Kyber-1024) | Key Encapsulation | 1568/3168/1568 | NIST Level 5 (AES-256) |
| FIPS 204 | ML-DSA-44 (Dilithium-2) | Digital Signature | 1312/2420 | NIST Level 2 |
| FIPS 204 | ML-DSA-65 (Dilithium-3) | Digital Signature | 1952/3293 | NIST Level 3 |
| FIPS 204 | ML-DSA-87 (Dilithium-5) | Digital Signature | 2592/4595 | NIST Level 5 |
| FIPS 205 | SLH-DSA-SHA2-128f (SPHINCS+) | Hash-Based Signature | 32/17088 | NIST Level 1 |
| FIPS 205 | SLH-DSA-SHA2-256s (SPHINCS+) | Hash-Based Signature | 64/29792 | NIST Level 5 |
- NIST FIPS 203 (ML-KEM) - Module-Lattice-Based Key Encapsulation Mechanism for quantum-secure key exchange
- NIST FIPS 204 (ML-DSA) - Module-Lattice-Based Digital Signature Algorithm for quantum-resistant authentication
- NIST FIPS 205 (SLH-DSA) - Stateless Hash-Based Digital Signatures for conservative long-term security
- Multi-Party Computation (MPC) - Threshold cryptography protocols for distributed key generation and signing
- Format-Preserving Encryption (FPE) - Encrypt data while preserving its format (e.g., credit card numbers, SSNs)
- Side-Channel Resistance - Constant-time operations and masking techniques to mitigate timing and power analysis
- Hybrid Cryptography - Combine post-quantum algorithms with classical (RSA/ECC) for transitional security
- Key Derivation - HKDF, PBKDF2, and Argon2id for secure key derivation
- Comprehensive Test Suite - Extensive unit tests and NIST test vector validation
- Pure Python Implementation - No C dependencies required; portable across platforms
Post-quantum cryptography is a rapidly evolving field. Please consider the following:
- Audit Status: This implementation is in beta. It has NOT yet undergone a third-party security audit. Do not use in production systems without additional review.
- Side-Channel Attacks: While constant-time operations are implemented where possible, pure Python implementations may still be vulnerable to timing attacks in certain environments. For high-security deployments, consider using compiled/optimized libraries (e.g., liboqs, OpenSSL 3.2+).
- Hybrid Mode: We strongly recommend using hybrid mode (PQC + classical) during the transition period. This provides defense in depth against both quantum and classical attacks.
- Key Management: Post-quantum keys are larger than classical keys. Ensure your infrastructure (certificates, protocols, HSMs) can accommodate the increased key sizes.
- Algorithm Agility: Design your systems to support algorithm migration. NIST may standardize additional algorithms or revise existing ones.
- Random Number Generation: All cryptographic operations require a cryptographically secure random number generator (CSPRNG). This library uses Python's
secretsmodule. - Backwards Compatibility: FIPS 203/204/205 are not backwards compatible with existing PKI. Migration requires protocol updates.
# Clone the repository
git clone https://github.com/yethikrishna/QuantumCrypt-AI.git
cd QuantumCrypt-AI
# Install dependencies
pip install -r requirements.txt
# Run tests to verify installation
python -m pytest tests/ -vfrom quantumcrypt.kem import MLKEM768
# Initialize KEM
kem = MLKEM768()
# Bob generates a key pair
public_key, secret_key = kem.keygen()
# Alice encapsulates a shared secret using Bob's public key
ciphertext, shared_secret_alice = kem.encapsulate(public_key)
# Bob decapsulates to get the same shared secret
shared_secret_bob = kem.decapsulate(ciphertext, secret_key)
# Both parties now have the same shared secret
assert shared_secret_alice == shared_secret_bobfrom quantumcrypt.dsa import MLDSA65
# Initialize signature scheme
dsa = MLDSA65()
# Generate key pair
public_key, secret_key = dsa.keygen()
# Sign a message
message = b"Hello, post-quantum world!"
signature = dsa.sign(secret_key, message)
# Verify the signature
is_valid = dsa.verify(public_key, message, signature)
assert is_validfrom quantumcrypt.slh_dsa import SLHDSASHA2256s
# Stateless hash-based signatures (conservative, no lattice assumptions)
slh = SLHDSASHA2256s()
pk, sk = slh.keygen()
sig = slh.sign(sk, b"Message to sign")
assert slh.verify(pk, b"Message to sign", sig)from quantumcrypt.hybrid import HybridEncryptor
# Combines ML-KEM-768 with X25519 for transition security
hybrid = HybridEncryptor()
pk, sk = hybrid.keygen()
ct, ss = hybrid.encapsulate(pk)
ss2 = hybrid.decapsulate(ct, sk)
assert ss == ss2QuantumCrypt-AI was developed as part of research into practical post-quantum cryptography migration. The repository includes extensive development and security hardening reports documenting the implementation process:
- NIST FIPS 203/204/205 implementation verification
- Side-channel analysis and constant-time validation
- Performance benchmarking across security levels
- Interoperability testing with reference implementations
- Cryptographic agility framework design
For a detailed security analysis, see CRYPTO_SECURITY_HARDENING_REPORT_v26_JUNE_2026.md.
QuantumCrypt-AI/
├── quantumcrypt/
│ ├── __init__.py
│ ├── kem/ # ML-KEM (FIPS 203) implementation
│ │ ├── ml_kem_512.py
│ │ ├── ml_kem_768.py
│ │ └── ml_kem_1024.py
│ ├── dsa/ # ML-DSA (FIPS 204) implementation
│ │ ├── ml_dsa_44.py
│ │ ├── ml_dsa_65.py
│ │ └── ml_dsa_87.py
│ ├── slh_dsa/ # SLH-DSA (FIPS 205) implementation
│ ├── mpc/ # Multi-party computation protocols
│ ├── fpe/ # Format-preserving encryption
│ ├── hybrid/ # Hybrid (PQC + classical) constructions
│ └── utils/ # Constant-time ops, RNG, hashing
├── tests/ # Comprehensive test suite
├── test_*.py # Module-level tests
├── CRYPTO_SECURITY_HARDENING_REPORT_v26_JUNE_2026.md
├── HONEST_DEVELOPMENT_REPORT*.md
├── requirements.txt
└── README.md
| Algorithm | Keygen (ms) | Encaps/Sign (ms) | Decaps/Verify (ms) | Public Key (B) | Secret Key (B) | Ciphertext/Sig (B) |
|---|---|---|---|---|---|---|
| ML-KEM-512 | ~0.05 | ~0.07 | ~0.08 | 800 | 1632 | 768 |
| ML-KEM-768 | ~0.08 | ~0.10 | ~0.12 | 1184 | 2400 | 1088 |
| ML-KEM-1024 | ~0.12 | ~0.14 | ~0.17 | 1568 | 3168 | 1568 |
| ML-DSA-44 | ~0.10 | ~0.20 | ~0.08 | 1312 | 2560 | 2420 |
| ML-DSA-65 | ~0.15 | ~0.30 | ~0.12 | 1952 | 4032 | 3293 |
| ML-DSA-87 | ~0.20 | ~0.40 | ~0.16 | 2592 | 4896 | 4595 |
Benchmarks on Python 3.12, x86-64, 3.4GHz CPU. Native (C/Rust) implementations will be significantly faster.
Contributions are welcome, especially in:
- Security audits and vulnerability reports
- Performance optimizations
- Additional algorithm implementations
- Interoperability testing
- Documentation improvements
Please see HONEST_DEVELOPMENT_REPORT_2026_JUNE_22.md for development practices and coding standards.
This project is released under an open-source license. See LICENSE for details.
- NIST FIPS 203 - ML-KEM
- NIST FIPS 204 - ML-DSA
- NIST FIPS 205 - SLH-DSA
- NIST Post-Quantum Cryptography Standardization
Securing the future against quantum threats. Today.