Lesson 1.1 named all three NIST standards. This lesson goes inside the most immediately deployed of the three: ML-KEM, the Module-Lattice-Based Key-Encapsulation Mechanism. It is the post-quantum replacement for RSA and ECDH in key exchange, and it is already shipping in browsers, cloud infrastructure, and TLS libraries today.
Unit 1 progress
By the end of this lesson you will be able to
Explain what a Key Encapsulation Mechanism is and how it differs from key exchange
Describe the three-step ML-KEM process in plain language
Explain why ML-KEM is secure against quantum attacks while RSA key exchange is not
Identify where ML-KEM appears in real-world deployments today
Part 1 — The key exchange problem
Every time your browser connects to a website over HTTPS, something remarkable happens before a single byte of content is transferred: your browser and the server must agree on a shared secret key, a string of random bits that will be used to encrypt everything that follows, over a channel that an attacker could be watching. The attacker can see every message exchanged during this negotiation. Yet somehow, at the end of it, both sides know a secret that the attacker does not.
This is the key exchange problem. RSA and Diffie-Hellman (ECDH) solve it today using mathematical problems, prime factoring and discrete logarithms, that are hard for classical computers but easy for a quantum computer running Shor's algorithm. ML-KEM solves the same problem using a different mathematical foundation: the hardness of certain problems involving lattices, which quantum computers cannot solve efficiently.
Glossary term #7
Key Encapsulation Mechanism (KEM)
A cryptographic mechanism for securely transmitting a shared secret from one party to another using public-key cryptography. The sender "encapsulates" a randomly generated key inside a ciphertext using the recipient's public key. Only the recipient, who holds the corresponding private key, can "decapsulate" it to recover the shared secret. ML-KEM (FIPS 203) is the post-quantum KEM.
A KEM is slightly different from classic Diffie-Hellman key exchange, though it accomplishes the same goal. In ECDH, both parties contribute randomness and the shared secret emerges from their interaction. In a KEM, the sender generates the shared secret, encrypts it under the recipient's public key, and sends the ciphertext. The recipient decrypts it. The shared secret is then used as the key material for a symmetric cipher (like AES). The result is the same: both parties share a secret that no eavesdropper can compute.
Part 2 — How ML-KEM works, step by step
ML-KEM has three operations: key generation, encapsulation, and decapsulation. Walk through each step below.
Part 3 — ML-KEM vs RSA key exchange
The table below compares the two approaches across the dimensions that matter most for migration planning.
Being replaced
RSA / ECDH key exchange
Mathematical basis
Integer factoring (RSA) or discrete logarithm (ECDH)
Quantum resistance
None — broken by Shor's algorithm
Key sizes
RSA-2048: 256 bytes public key. EC P-256: 32 bytes
Where used
TLS 1.2/1.3, VPN, SSH, email, all PKI
Status
Deprecated by NIST post-2030 (SP 800-131A Rev 3)
Replacement
ML-KEM (FIPS 203)
Mathematical basis
Module Learning With Errors (M-LWE) — lattice problem
Quantum resistance
Believed secure against classical and quantum attacks
Key sizes
ML-KEM-768: 1,184-byte public key (larger, but fast)
Finalized August 2024. Shipping in OpenSSL 3.x, BoringSSL
The larger key and ciphertext sizes are the main practical implication of ML-KEM. Public keys are roughly 4× larger than RSA-2048 public keys and far larger than EC keys. In most TLS handshake contexts this adds a small but measurable overhead, typically one extra network round trip in constrained environments. For most applications, this is an acceptable trade-off. For IoT devices, smart cards, and other constrained hardware, key size is a genuine design constraint that Unit 4 addresses in detail.
ABCWhere ML-KEM is deployed right now
As of 2024–2025: Google Chrome and Chromium deployed ML-KEM in TLS as the X25519MLKEM768 hybrid key share. AWS, Cloudflare, and Google Cloud offer hybrid post-quantum TLS using ML-KEM. OpenSSL 3.2+ supports ML-KEM via the OQS provider. The NSA's Commercial National Security Algorithm Suite 2.0 (CNSA 2.0) mandates ML-KEM for key establishment. This is not future roadmap, it is current deployment in infrastructure you already use.
Part 4 — Hybrid key exchange and why it exists
When you see ML-KEM deployed in TLS today, it is almost always deployed in "hybrid" mode, combining ML-KEM with a classical algorithm like X25519. A typical hybrid key share label is X25519MLKEM768. This means the TLS handshake performs both a classical ECDH key exchange and an ML-KEM encapsulation, then combines both shared secrets cryptographically.
The reason for hybrid deployment is belt-and-suspenders security during the transition period. If a catastrophic weakness were found in ML-KEM, a scenario considered unlikely but not impossible for a relatively new standard, the classical component would still protect the session. Conversely, the ML-KEM component protects against Shor's algorithm. A session protected by both is secure against both classical and quantum adversaries, and against unknown weaknesses in either algorithm alone.
Hybrid mode is not permanent. As confidence in ML-KEM grows and the deprecation of classical algorithms takes effect post-2030, deployments will transition to ML-KEM-only. But for now, hybrid is the responsible deployment strategy, and it is what you should expect to see in any serious PQC TLS deployment.
CFor IT professionals: what to look for in your environment
When auditing your TLS deployments for PQC readiness, look for: (1) whether your TLS library version supports ML-KEM (OpenSSL 3.2+, BoringSSL recent builds, AWS-LC); (2) whether hybrid key exchange is enabled in your TLS configurations; (3) whether your load balancers and CDN providers have enabled hybrid PQC TLS. Certificate migration (ML-DSA) is a separate, later step, key exchange migration comes first.
Part 5 — The lattice mathematics behind ML-KEM (plain language)
You do not need to understand the mathematics deeply to work with ML-KEM. But a plain-language picture of why it is hard for quantum computers to break is worth having, because you will be asked this question.
A lattice is a regular, grid-like arrangement of points in many dimensions. Imagine a chessboard, a two-dimensional lattice of squares. Now imagine that same structure in 256 dimensions. The hard problem ML-KEM uses is called the Learning With Errors (LWE) problem: given a noisy version of a set of linear equations over this lattice, find the hidden solution. The "with errors" part is critical, small random noise is added to every equation, which makes finding the exact answer dramatically harder.
Why can't quantum computers solve this efficiently? Shor's algorithm works by exploiting the periodic structure of factoring and discrete logarithm problems, it finds patterns. LWE problems do not have that exploitable periodic structure. The best known quantum algorithms for LWE offer no meaningful advantage over classical algorithms. This is why lattice-based cryptography is the leading candidate for post-quantum security: the problems it relies on appear to be hard for both classical and quantum computation.
Comprehension check
Question 1 of 3
In an ML-KEM key exchange, which party generates the shared secret during encapsulation?
Question 2 of 3
Why is ML-KEM currently deployed in "hybrid" mode alongside classical ECDH in TLS, rather than replacing it entirely?
Question 3 of 3
Why does the Learning With Errors (LWE) problem resist quantum attacks, unlike RSA's factoring problem?