PQC Algorithm Comparison
Compare NIST-standardized post-quantum cryptography algorithms. Performance benchmarks, security levels, and implementation guidance for ML-KEM, ML-DSA, and SLH-DSA.
| Variant | Algorithm | Security | Public Key | Private Key | Ciphertext | Key Gen | Encap/Decap |
|---|---|---|---|---|---|---|---|
| ML-KEM-512 | ML-KEM | Level 1 | 800 B | 1.6 KB | 768 B | 30 µs | 35 µs / 40 µs |
| ML-KEM-768 | ML-KEM | Level 3 | 1.2 KB | 2.3 KB | 1.1 KB | 50 µs | 55 µs / 65 µs |
| ML-KEM-1024 | ML-KEM | Level 5 | 1.5 KB | 3.1 KB | 1.5 KB | 75 µs | 85 µs / 95 µs |
| ML-DSA-44 | ML-DSA | Level 2 | 1.3 KB | 2.5 KB | 2.4 KB | 40 µs | 120 µs / 45 µs |
| ML-DSA-65 | ML-DSA | Level 3 | 1.9 KB | 3.9 KB | 3.2 KB | 65 µs | 200 µs / 70 µs |
| ML-DSA-87 | ML-DSA | Level 5 | 2.5 KB | 4.8 KB | 4.5 KB | 100 µs | 290 µs / 100 µs |
| SLH-DSA-SHA2-128f | SLH-DSA | Level 1 | 32 B | 64 B | 16.7 KB | 500 µs | 8.0 ms / 500 µs |
| SLH-DSA-SHA2-192f | SLH-DSA | Level 3 | 48 B | 96 B | 34.8 KB | 1.0 ms | 15.0 ms / 1.0 ms |
| SLH-DSA-SHA2-256f | SLH-DSA | Level 5 | 64 B | 128 B | 48.7 KB | 2.0 ms | 30.0 ms / 2.0 ms |
| SLH-DSA-SHA2-128s | SLH-DSA | Level 1 | 32 B | 64 B | 7.7 KB | 1.0 ms | 50.0 ms / 3.0 ms |
| SLH-DSA-SHA2-192s | SLH-DSA | Level 3 | 48 B | 96 B | 15.8 KB | 2.0 ms | 100.0 ms / 6.0 ms |
| SLH-DSA-SHA2-256s | SLH-DSA | Level 5 | 64 B | 128 B | 29.1 KB | 4.0 ms | 200.0 ms / 10.0 ms |
Implementation Examples
Educational code samples demonstrating PQC algorithm usage. These examples show conceptual patterns - always use audited cryptographic libraries in production.
ML-KEM (FIPS 203)
// ML-KEM Key Encapsulation (Conceptual Example)
// Use a NIST-validated library like liboqs, PQClean, or AWS-LC
import { ML_KEM_768 } from '@example/pqc-lib';
// 1. Key Generation (receiver generates keypair)
const { publicKey, secretKey } = ML_KEM_768.keygen();
// publicKey: 1184 bytes | secretKey: 2400 bytes
// 2. Encapsulation (sender creates shared secret)
const { ciphertext, sharedSecret } = ML_KEM_768.encaps(publicKey);
// ciphertext: 1088 bytes | sharedSecret: 32 bytes
// 3. Decapsulation (receiver recovers shared secret)
const recoveredSecret = ML_KEM_768.decaps(ciphertext, secretKey);
// recoveredSecret === sharedSecret (32 bytes)
// 4. Use sharedSecret for symmetric encryption (AES-256-GCM)
const encrypted = AES_GCM.encrypt(plaintext, sharedSecret, nonce);Security Note: ML-KEM-768 provides NIST Security Level 3 (equivalent to AES-192). For highest security, use ML-KEM-1024 (Level 5).
ML-DSA (FIPS 204)
// ML-DSA Digital Signatures (Conceptual Example)
// Use a NIST-validated library for production
import { ML_DSA_65 } from '@example/pqc-lib';
// 1. Key Generation (signer generates keypair)
const { publicKey, secretKey } = ML_DSA_65.keygen();
// publicKey: 1952 bytes | secretKey: 4032 bytes
// 2. Sign a message
const message = new TextEncoder().encode('Document to sign');
const signature = ML_DSA_65.sign(message, secretKey);
// signature: 3293 bytes
// 3. Verify signature (anyone with publicKey)
const isValid = ML_DSA_65.verify(message, signature, publicKey);
// isValid: true if signature is authentic
// Common use cases:
// - Code signing and software updates
// - Document authentication
// - Certificate authorities (X.509)
// - Blockchain and smart contractsPerformance Tip: ML-DSA-65 offers the best balance of security (Level 3) and performance. ML-DSA-87 provides Level 5 security with larger signatures.
X25519 + ML-KEM Hybrid
// Hybrid Key Exchange (Defense in Depth)
// Combines classical and post-quantum algorithms
import { X25519, ML_KEM_768, HKDF_SHA256 } from '@example/crypto-lib';
// Classical component (X25519 ECDH)
const classicalKeyPair = X25519.generateKeyPair();
const classicalShared = X25519.computeShared(
classicalKeyPair.secretKey,
peerClassicalPublic
);
// Post-quantum component (ML-KEM)
const { ciphertext, sharedSecret: pqShared } = ML_KEM_768.encaps(
peerPQPublic
);
// Combine both secrets using KDF
const hybridSecret = HKDF_SHA256.derive(
[...classicalShared, ...pqShared], // Combined input
salt,
'hybrid-tls-secret',
32 // Output length
);
// Hybrid provides security even if one algorithm is brokenRecommendation: Use hybrid mode during the transition period. This ensures protection even if vulnerabilities are found in either classical or PQC algorithms.
Production-Ready Libraries
C/C++
- • liboqs - Open Quantum Safe
- • AWS-LC - AWS Libcrypto
- • BoringSSL - Google fork w/ PQC
Other Languages
- • liboqs-python - Python bindings
- • liboqs-go - Go bindings
- • liboqs-rust - Rust bindings
Always verify library implementations against NIST CAVP (Cryptographic Algorithm Validation Program) before production use.
NIST Security Levels
Equivalent to AES-128 (128-bit security)
Between AES-128 and AES-192
Equivalent to AES-192 (192-bit security)
Between AES-192 and AES-256
Equivalent to AES-256 (256-bit security)
Need Help Selecting Algorithms?
Our team can help you evaluate your cryptographic requirements and select the optimal PQC algorithms for your specific use case.