Cybersecurity

Post-Quantum Cryptography Explained

LLMs Encryption Cryptography Authentication Git AWS Cloud Credentials Hashing TLS HTTPS
797 words Includes Code
Key Takeaway: Quantum computers will break RSA, ECC, and Diffie-Hellman. NIST finalized three post-quantum cryptography standards in August 2024: ML-KEM (key exchange), ML-DSA (signatures), and SLH-DSA (conservative signatures). Start migration now -- "harvest now, decrypt later" means data encrypted today is already at risk.

Post-Quantum Cryptography Explained

Every secure website, encrypted message, and digital signature relies on public-key cryptography. But quantum computing will break these algorithms. This article explains why, what NIST has standardized as replacements, and what developers should do now.

Post-quantum cryptography showing classical algorithms vulnerable to quantum, NIST PQC standards, and harvest now decrypt later warning

Why Quantum Computing Breaks Current Crypto

Current public-key cryptography relies on mathematical problems that are computationally hard for classical computers. Shor's algorithm (1994) proved that quantum computers can solve these problems efficiently:

AlgorithmMath ProblemQuantum Threat
RSAInteger factoringShor's algorithm breaks it
ECCElliptic curve discrete logShor's algorithm breaks it
Diffie-HellmanDiscrete logarithmShor's algorithm breaks it
AES-256Block cipherGrover weakens (use 256-bit)
SHA-256Hash functionGrover weakens (still safe)
Critical distinction: Symmetric cryptography (AES, SHA) is quantum-safe if you use sufficient key sizes. Asymmetric cryptography (RSA, ECC, DH) is fundamentally broken by Shor's algorithm -- no key size fix exists.

The Harvest Now, Decrypt Later Threat

The most urgent reason to migrate is not that quantum computers exist today -- they do not. The threat is "harvest now, decrypt later":

  • Today: Adversaries collect encrypted traffic and store it
  • Future: When quantum computers arrive, they decrypt the stored data
  • Impact: Secrets, credentials, and sensitive data become exposed

Data that must remain secret for 10+ years (medical records, government secrets, financial data) is already at risk. The encryption protecting it today will be broken tomorrow.

NIST Post-Quantum Cryptography Standards

On August 13, 2024, NIST finalized three post-quantum cryptography standards:

StandardAlgorithmTypeMath Basis
FIPS 203ML-KEM (Kyber)Key EncapsulationModule LWE
FIPS 204ML-DSA (Dilithium)Digital SignaturesModule LWE + SIS
FIPS 205SLH-DSA (SPHINCS+)Digital SignaturesHash-based

Additional algorithms in development:

  • FN-DSA (Falcon): Compact signatures, expected standardization 2027
  • HQC: Code-based KEM, backup for ML-KEM

ML-KEM: Key Encapsulation (FIPS 203)

ML-KEM (Module Learning With Errors Key Encapsulation Mechanism) replaces RSA and ECDH for key exchange:

# ML-KEM-768 key encapsulation
import oqs

# Generate keypair
kem = oqs.KeyEncapsulation('ML-KEM-768')
pk = kem.generate_keypair()      # 1,184 bytes (public key)
sk = kem.export_secret_key()     # 2,400 bytes (secret key)

# Encapsulate (Bob)
ct, ss = kem.encap_secret(pk)    # ct = ciphertext, ss = shared secret

# Decapsulate (Alice)
ss2 = kem.decap_secret(ct, sk)   # ss2 == ss (same shared secret)

ML-DSA: Digital Signatures (FIPS 204)

ML-DSA (Module Digital Signature Algorithm) replaces RSA and ECDSA for signatures:

# ML-DSA-65 digital signatures
sig = oqs.Signature('ML-DSA-65')
pk = sig.generate_keypair()      # 1,952 bytes

message = b'Important document'
signature = sig.sign(message)    # ~3,293 bytes

# Verify
valid = sig.verify(message, signature, pk)  # True

Key Size Tradeoff

The main practical difference: PQC keys are significantly larger.

AlgorithmPublic KeyPrivate KeyCiphertext/Signature
RSA-2048256 bytes256 bytes256 bytes
ECC-25632 bytes32 bytes64 bytes
ML-KEM-7681,184 bytes2,400 bytes1,088 bytes
ML-DSA-651,952 bytes4,032 bytes3,293 bytes
SLH-DSA-256f32 bytes64 bytes17,088 bytes

ML-KEM public keys are ~5x larger than RSA. ML-DSA signatures are ~13x larger. This is acceptable for most applications but requires testing in bandwidth-constrained environments.

Migration Timeline

DateMilestone
August 2024NIST finalizes ML-KEM, ML-DSA, SLH-DSA
2025-2026Organizations begin migration planning
2030NIST plans to deprecate RSA and ECC
2035NIST plans to disallow RSA and ECC

What Developers Should Do Now

  1. Inventory cryptographic usage -- Find all RSA, ECC, and DH in your systems
  2. Classify data by sensitivity -- What must stay secret for 10+ years?
  3. Test PQC in non-production -- Use liboqs, AWS KMS, or Cloudflare PQC
  4. Start with new systems -- Use PQC-first for new deployments
  5. Plan migration timeline -- Prioritize long-lived secrets
  6. Monitor NIST updates -- FN-DSA and HQC may become additional standards

Try It Yourself

Related BestWordz Articles

Summary

Post-quantum cryptography is not theoretical -- the standards are finalized and ready for implementation:

  1. Shor's algorithm breaks RSA, ECC, and Diffie-Hellman
  2. ML-KEM (FIPS 203) replaces RSA/ECDH for key exchange
  3. ML-DSA (FIPS 204) replaces RSA/ECDSA for signatures
  4. SLH-DSA (FIPS 205) provides conservative hash-based signatures
  5. Symmetric crypto (AES, SHA) is quantum-safe with standard key sizes
  6. Start migration now -- harvest now, decrypt later attacks are real

Further Reading

NIST standards verified: FIPS 203, 204, 205 (August 13, 2024). Migration timeline from NIST IR 8547.

Discuss this topic on BestWordz Community -- Share your PQC migration plans, ask questions about NIST standards, and learn from other developers preparing for the quantum future.

💬 Discuss on BestWordz Community

Join the conversation about LLMs, Encryption, Cryptography on the BestWordz Community forum.

Visit Forum →