ML-KEM explained
ML-KEM is a key encapsulation mechanism: instead of two parties agreeing a shared secret by exchanging public values, one party encapsulates a fresh secret under the other's public key and sends the ciphertext. Its security rests on the hardness of the Module Learning With Errors problem.
Encapsulation rather than agreement
Diffie-Hellman is symmetric: both sides contribute a public value and both derive the same secret. A KEM is not. The recipient publishes a key. The sender generates a random secret, encapsulates it under that key, and transmits the ciphertext. The recipient decapsulates to recover it.
The shape difference matters in practice. The sender chooses the secret, so the sender's randomness quality directly determines the session's security — there is no second party whose contribution compensates.
The working mental model
The underlying problem is Learning With Errors: given a system of linear equations with small random errors added, recover the secret. Without the errors this is straightforward linear algebra; with them it becomes hard, and is believed hard for quantum computers too.
ML-KEM works over polynomial rings, which is what makes the keys and operations efficient enough to be practical. That is as far as the intuition takes you, and it is far enough for an architect — the security proof is not something to reason about informally.
What it costs in practice
Public keys and ciphertexts are larger than their elliptic-curve equivalents by roughly an order of magnitude, which matters most for handshake size and for constrained links. Computation is fast — often faster than the elliptic-curve operations it replaces.
So the cost is bandwidth and memory rather than CPU, which is a different constraint than most people expect. What to measure goes into that properly.
The randomness dependency
Both key generation and encapsulation consume randomness. Encapsulation is the one worth dwelling on: the sender samples a fresh secret per session, and if that sampling is predictable the session is compromised regardless of how sound ML-KEM is.
This is the same dependency ECDH always had, which is the point — the algorithm generation changed and the requirement did not.
Deploying it
Almost always in a hybrid construction today, combined with X25519 so that a break in either component alone is not fatal. Why hybrid, and how long it persists.
Keep reading
- Algorithms and standards
FIPS 203, 204 and 205, what each standard actually covers
NIST finalised three post-quantum standards in August 2024. FIPS 203 specifies ML-KEM for key encapsulation, FIPS 204 specifies ML-DSA for signatures, and FIPS 205 specifies SLH-DSA as a hash-based signature alternative with different assumptions.
- Algorithms and standards
Hybrid cryptography explained, classical and post-quantum side by side
A hybrid construction combines a classical algorithm with a post-quantum one so that the result is secure if either holds. X25519MLKEM768 is the common form in TLS today. It exists because post-quantum algorithms are new, and it costs bandwidth rather than confidence.
- Algorithms and standards
ML-DSA and SLH-DSA explained
ML-DSA is the general-purpose post-quantum signature scheme, based on lattice assumptions and suitable for most signing. SLH-DSA is a hash-based alternative with larger, slower signatures whose security depends only on hash functions — a deliberate hedge against advances in lattice cryptanalysis.