Classical public-key cryptography (RSA, ECDH, ECDSA) relies on the hardness of integer factorisation and discrete logarithm. Shor's algorithm solves both in polynomial time on a quantum computer. A sufficiently powerful quantum computer breaks all classical asymmetric cryptography.
The threat timeline: NIST estimates cryptographically relevant quantum computers are 10-15 years away. But the threat is present-tense because of Harvest Now Decrypt Later — an adversary can record encrypted traffic today and decrypt it when quantum computers are available. For data with a 20-year secrecy requirement (government, aerospace, medical), the transition window is now.
NIST PQC standards (finalised August 2024):
ML-KEM(CRYSTALS-Kyber): Key Encapsulation MechanismML-DSA(CRYSTALS-Dilithium): Digital Signature AlgorithmSLH-DSA(SPHINCS+): Hash-based signature, conservative choice
ML-KEM (implemented in Q-Safe): Based on Module Learning With Errors (MLWE) hardness. Key sizes are larger than ECDH (800-1568 bytes depending on security level vs X25519's 32 bytes) but operations are fast — faster than RSA at equivalent security levels.
Hybrid approach (what Q-Safe uses): Run both X25519 and ML-KEM in parallel, combine the shared secrets with a KDF. Security holds if either algorithm is unbroken. This is the IETF-recommended migration path and is now in TLS 1.3 drafts.
// Conceptual hybrid key exchange
let classical_secret = x25519_ecdh(&our_private, &their_public);
let (kem_ciphertext, pq_secret) = ml_kem_encapsulate(&their_kem_public);
let combined = hkdf_extract(&classical_secret, &pq_secret);
// combined is the session key — secure if either X25519 or ML-KEM holds