SysTutorials

Post-Quantum Algorithms: Why We Need Them and What We Chose

Almost every secure connection on the internet today is built on RSA, Diffie-Hellman, or elliptic-curve cryptography. All three rest on the same assumption: certain math problems are too hard for any computer to solve. Quantum computers break that assumption, and the industry is now replacing these algorithms with post-quantum alternatives. This post covers why the switch is happening, how the new algorithms were chosen, and how each one works.

The reason

Public-key cryptography depends on two problems that have resisted classical attacks for decades:

In 1994, Peter Shor showed that a quantum computer can solve both problems in polynomial time. A sufficiently large, error-corrected quantum computer (a “cryptographically relevant” one) would break RSA-2048 and Curve25519 in hours, not millennia. Grover’s algorithm, the other famous quantum attack, only gives a quadratic speedup against symmetric primitives, so AES-256 and SHA-384 remain fine. The casualty is public-key cryptography specifically: key exchange and digital signatures.

Two factors make this an urgent problem rather than a distant one:

  1. Harvest now, decrypt later. An adversary can record encrypted traffic today and decrypt it once quantum hardware catches up. Data that must stay confidential for 10+ years (state secrets, medical records, long-lived intellectual property) is effectively already exposed. This is why agencies like the NSA and browsers like Chrome started migrating before any quantum computer could threaten RSA in practice.
  2. Migration takes a decade. Past crypto transitions (DES to AES, SHA-1 to SHA-256) each took 10+ years across protocols, libraries, hardware, and certificates. Starting early is the only way to finish in time. No one knows the exact timeline; estimates for a cryptographically relevant machine range from the 2030s to “never”, and underestimating it would be catastrophic.

Post-quantum cryptography (PQC) is the answer: public-key algorithms built on problems believed hard for both classical and quantum computers. They run on ordinary CPUs, so no quantum hardware is needed to use them.

The choices

NIST ran an open standardization process starting in 2016. It received 82 submissions and accepted 69 as first-round candidates; three rounds of public cryptanalysis narrowed the field. Selection criteria went beyond raw security:

The primary results were announced in 2022 and published as FIPS standards in August 2024:

StandardAlgorithmOriginTypeProblem family
FIPS 203ML-KEMCRYSTALS-KyberKey encapsulationLattice
FIPS 204ML-DSACRYSTALS-DilithiumSignaturesLattice
FIPS 205SLH-DSASPHINCS+SignaturesHash-based
FIPS 206 (draft)FN-DSAFalconSignaturesLattice (NTRU)
Selected 2025HQCHQCKey encapsulationCode-based

NIST also hedged its bets. Three of the four primary algorithms come from lattices, so HQC was added in March 2025 as a backup KEM from a different family. That caution is not theoretical: two well-regarded candidates, SIKE (isogeny-based) and Rainbow (multivariate), fell to classical attacks in 2022 after years of public scrutiny. The process caught them before standardization, which is exactly the point of running it in public.

The algorithms

Each of the chosen algorithms fills a distinct role, and the trade-offs between them explain why NIST picked more than one.

ML-KEM (Kyber): the key exchange

ML-KEM (Module-Lattice Key Encapsulation Mechanism, FIPS 203) replaces ECDH/RSA key exchange. A KEM is a simpler primitive than a full public-key encryption scheme: the sender encapsulates a shared secret under a public key, and the holder of the secret key decapsulates it. In TLS terms, it slots into the same place Diffie-Hellman occupied.

Its security rests on the Module Learning-With-Errors problem: operations happen over polynomial rings, where the public key is a noisy linear function of a secret matrix, and distinguishing that structure from randomness is hard for classical and quantum computers alike. The “module” structure means the implementation reduces to polynomial multiplication, which runs fast via the Number Theoretic Transform.

At the default parameter set ML-KEM-768, public keys are 1,184 bytes and ciphertexts 1,088 bytes, versus 32 bytes for X25519. That is larger, but workable in TLS, which is why deployment is already broad: Chrome and Firefox ship hybrid X25519MLKEM768 for TLS, Apple uses ML-KEM in iMessage PQ3, OpenSSH 9.x supports it, and AWS KMS and Cloudflare use it internally.

ML-DSA (Dilithium): the default signature

ML-DSA (Module-Lattice Digital Signature Algorithm, FIPS 204) replaces RSA and ECDSA signatures. It uses the same module-lattice family as ML-KEM (MLWE plus the Module-SIS problem) with a Fiat-Shamir-with-aborts construction: the signer samples a candidate response, checks a safety condition, and retries on failure. The arithmetic is integer-only and forgiving to implement in constant time, which made it NIST’s primary signature recommendation.

The cost is size. An ML-DSA-65 public key is 1,952 bytes and a signature is 3,309 bytes, versus 64 bytes for an Ed25519 signature. That is manageable inside protocols but painful anywhere certificates are chained: a full TLS handshake with PQC certs carries tens of kilobytes of signatures, and constrained devices feel it. Expect ML-DSA everywhere keys and code are signed, with FN-DSA filling the size-sensitive niche.

SLH-DSA (SPHINCS+): the conservative fallback

SLH-DSA (Stateless Hash-Based Digital Signature Algorithm, FIPS 205) is the only standardized scheme that assumes nothing beyond hash functions. It is built from a one-time signature (WOTS+) and a few-time signature (FORS) bound together by a Merkle tree. Security reduces to well-studied hash properties, the most conservative assumption in the whole portfolio.

The trade-offs are speed and size: signatures run roughly 8 to 50 KB depending on the “fast” or “small” parameter variants. The “stateless” part matters: earlier hash-based schemes (XMSS, LMS) keep a counter of used one-time keys, and reusing a key under a different message leaks the private key, a fatal failure mode if state handling has any bug. SLH-DSA tracks nothing, at the cost of size.

This is the scheme you pick when long-term confidence beats performance: firmware signing, code signing, root certificates. If lattices ever fall to new mathematics, SLH-DSA survives, which is its reason for existing alongside the lattice defaults.

FN-DSA (Falcon): the compact one

FN-DSA (FFT over NTRU Lattice Digital Signature Algorithm, drafted as FIPS 206, standardization still in progress) comes from the NTRU lattice family rather than Kyber/Dilithium’s module lattices. Its selling point is compactness: Falcon-512 signatures are about 666 bytes with 897-byte public keys (versus 3,309 bytes for an ML-DSA-65 signature), and verification is fast.

The catch is implementation risk. FN-DSA signature generation requires floating-point operations (discrete Gaussian sampling over an FFT), and floating-point code is notoriously hard to make constant-time across platforms. That is a real side-channel hazard, and it is why standardization has taken longer and why ML-DSA became the default despite being larger.

HQC: the backup key exchange

HQC (Hamming Quasi-Cyclic, backup KEM selected in March 2025, standard to follow) is code-based. Its foundation is the syndrome decoding problem: decoding a random linear code in the presence of errors is NP-hard classically and has resisted quantum attacks since the 1970s. It is the same problem family behind the classic McEliece cryptosystem.

HQC’s parameters are larger than ML-KEM’s (keys and ciphertexts in the low kilobytes) and it is slower. That is acceptable because its role is insurance: if lattice cryptography meets the fate of SIKE and Rainbow, a non-lattice KEM will already be standardized, reviewed, and ready to swap in. Code-based schemes have the longest track record of any PQC family, which is precisely why they earn the backup slot.

What migration looks like

Deployment today is mostly hybrid: combine a classical and a post-quantum primitive, and the connection stays secure as long as either one holds. TLS key exchange via X25519MLKEM768 is exactly this pattern. Hybrids buy time while PQC implementations mature and guard against a surprise break in a brand-new scheme.

Signatures are the slower half of the migration, since ML-DSA and FN-DSA sizes stress certificate chains, HSMs, and firmware update formats. The practical to-do list for most engineering teams is short:

  1. Inventory where public-key crypto lives in your systems (crypto bills of materials help here).
  2. Ensure protocol and library versions support hybrid KEM (recent OpenSSL, BoringSSL, Go, OpenSSH all do).
  3. Plan signature agility for certificates and code signing, where the larger sizes hurt.

The algorithms are settled. The remaining work is plumbing, and given harvest-now-decrypt-later, “later” is closer than it looks.

← All posts