---
title: "Post-Quantum Encryption in Practice: ML-KEM, TLS 1.3, and Why Origins Lag Behind Browsers"
description: "Around 70% of browser traffic to Cloudflare already negotiates hybrid post-quantum key exchange (X25519MLKEM768), yet origin support trails at roughly 28.7%. How NIST FIPS 203, 204, and 205 work, why a 1,216-byte key share trips legacy middleboxes, and how to test and enable ML-KEM on Nginx and OpenSSL 3.5."
author: Aleksei Aleinikov
date: 2026-11-30
lang: en
tags: [post-quantum-encryption, ml-kem, post-quantum-tls, cloud-security, zero-trust, web-security]
canonical: https://www.alekseialeinikov.com/en/blog/topics/security/post-quantum-encryption-ml-kem-tls-guide
source: alekseialeinikov.com
---

# Post-Quantum Encryption in Practice: ML-KEM, TLS 1.3, and Why Origins Lag Behind Browsers

Every major browser already speaks post-quantum TLS by default. According to [Cloudflare Radar](https://radar.cloudflare.com/post-quantum), roughly **70% of human HTTPS traffic** hitting Cloudflare's edge now negotiates hybrid post-quantum key exchange, up from under 3% at the start of 2024. Yet origin server support across the wider web lags far behind—hovering around **28.7%** on Cloudflare's origin readiness tracking.

That gap explains why **post-quantum encryption** is no longer an academic topic for cryptographers. The client side moved first via Chrome 131+, Edge 131+, and Firefox 132+. Now platform, security, and SRE teams are left dealing with the practical consequences: older OpenSSL builds on Linux origins, `1,216`-byte key shares that split `ClientHello` across two TCP packets, and legacy corporate DPI boxes that choke on the handshake.

![Post-quantum encryption cover: classical X25519 reinforced by an ML-KEM lattice prism in TLS 1.3](https://media.alekseialeinikov.com/security/c8e4a19d7b32/cover-1200.f081376a15c89236.webp)

## What Post-Quantum Cryptography Actually Protects Against

A common misconception is that quantum computers break *all* encryption equally. They do not. The threat splits cleanly between **asymmetric (public-key) cryptography** and **symmetric cryptography**:

- **Asymmetric key exchange and signatures (broken by Shor's algorithm):** RSA, Diffie-Hellman, ECDH (`X25519`, `P-256`), ECDSA, and Ed25519 rely on integer factorization or discrete logarithms. A sufficiently large fault-tolerant quantum computer running Peter Shor's algorithm breaks them in polynomial time.
- **Symmetric encryption and hashes (resilient):** AES-256, ChaCha20-Poly1305, SHA-256, and SHA-3 are only affected by Grover's algorithm, which gives at most a quadratic speedup—roughly halving effective bit strength. **AES-256 still provides ~128 bits of quantum security** and does not need to be replaced.

That distinction drives the entire migration order. Symmetric data encryption at rest is already fine if you use AES-256. The immediate exposure is **key exchange** on the wire, because of **Harvest Now, Decrypt Later (HNDL)**: an adversary can passively record encrypted TLS sessions today, store them cheaply, and decrypt them years later once cryptanalytically relevant quantum hardware exists.

> [!KEY]
> Key exchange is urgent today because recorded traffic can be decrypted retroactively. Certificate signatures only need to resist forgery at the moment of verification, so key exchange (`ML-KEM`) ships years before post-quantum PKI (`ML-DSA`).

## The NIST Post-Quantum Standards (`FIPS 203`, `204`, `205`)

In August 2024, NIST finalized its first three post-quantum cryptography standards. Unlike classical ECC keys that fit in 32–64 bytes, lattice and hash-based primitives trade compact keys for quantum resistance:

| Standard | Derived From | Purpose | Default Variant | Public Key | Private Key | Ciphertext / Signature |
| :--- | :--- | :--- | :--- | ---: | ---: | ---: |
| **Classical X25519** | Curve25519 | Key exchange | X25519 | 32 B | 32 B | 32 B (share) |
| **FIPS 203 (ML-KEM)** | CRYSTALS-Kyber | Key exchange (KEM) | ML-KEM-768 | 1,184 B | 2,400 B | 1,088 B |
| **Classical Ed25519** | Curve25519 | Digital signature | Ed25519 | 32 B | 32 B | 64 B |
| **FIPS 204 (ML-DSA)** | CRYSTALS-Dilithium | Digital signature | ML-DSA-65 | 1,952 B | 4,032 B | 3,309 B |
| **FIPS 205 (SLH-DSA)** | SPHINCS+ | Stateless hash signature | SLH-DSA-128s | 32 B | 64 B | 7,856 B |
| **FIPS 205 (SLH-DSA)** | SPHINCS+ | Fast hash signature | SLH-DSA-128f | 32 B | 64 B | 17,088 B |

Notice the shared secret in **ML-KEM** is always **32 bytes** regardless of parameter set (`ML-KEM-512`, `768`, or `1024`), so symmetric session keys downstream (`AES-256-GCM` or `ChaCha20-Poly1305`) stay identical. For signatures, **ML-DSA-65** (`FIPS 204`) jumps from 64 bytes to **3,309 bytes**, while **SLH-DSA** (`FIPS 205`) scales up to **7,856–49,856 bytes** depending on whether you pick small (`s`) or fast (`f`) variants—which is why full post-quantum certificate chains take longer to roll out without bloating TLS handshakes.

![NIST post-quantum cryptography byte sizes: ML-KEM, ML-DSA, and SLH-DSA compared against classical X25519 and Ed25519](https://media.alekseialeinikov.com/security/c8e4a19d7b32/pqc-nist-standards-sizes-1200.f23eb1cb8fbc51d0.webp "Post-quantum key exchange adds roughly 1.1 KB, whereas hash-based signatures jump by two orders of magnitude.")

## Hybrid `X25519MLKEM768`: Why Both Algorithms Run Together

Instead of switching straight to pure `ML-KEM-768`, TLS 1.3 deployments use a **hybrid key exchange** standardized as **`X25519MLKEM768`** (IANA group codepoint `0x11EC`).

During the TLS 1.3 handshake, the client sends **both** key shares concatenated into one `key_share` extension:

- **32 bytes** for classical `X25519`
- **1,184 bytes** for `ML-KEM-768` encapsulation key
- **1,216 bytes total**

Both shared secrets are fed into the TLS 1.3 key schedule. An attacker must break **both** elliptic-curve Diffie-Hellman *and* module-lattice learning-with-errors to recover the traffic keys. Even if future cryptanalysis weakens `ML-KEM`, the connection remains as strong as classical `X25519`. For a refresher on how TLS and mutual TLS handshakes bind identity and session keys, see [mTLS vs TLS Explained](https://www.alekseialeinikov.com/en/blog/topics/security/mtls-vs-tls-explained).

## The Hidden Network Trap: `ClientHello` Size, MTU, and Middleboxes

Expanding the `key_share` from `32` bytes to `1,216` bytes changes network behavior on the wire:

- A classical TLS 1.3 `ClientHello` sits around **300–500 bytes**, fitting comfortably inside a single TCP segment.
- With `X25519MLKEM768`, `ClientHello` grows to **1,300–1,500+ bytes**. Once TCP/IP headers and other TLS extensions are counted, it frequently crosses the typical **~1,400-byte MTU** and splits across **two TCP segments**.

![Classical X25519 ClientHello (~400 bytes in one packet) vs hybrid X25519MLKEM768 ClientHello (~1,450 bytes split across two TCP segments hitting DPI middleboxes)](https://media.alekseialeinikov.com/security/c8e4a19d7b32/pqc-clienthello-footprint-1200.2d5e678b0692cd88.webp "Crossing the ~1,400-byte MTU exposes bugs in legacy firewalls and TLS inspection proxies.")

That single-packet assumption breaks poorly written network gear:

1. **Legacy firewalls and load balancers** that inspect only the first TCP segment of a `ClientHello` fail to reassemble the extension and reset the connection (`ERR_SSL_PROTOCOL_ERROR`).
2. **Corporate Deep Packet Inspection (DPI) proxies** that do TLS decryption for DLP often reject unknown group codepoint `0x11EC` instead of ignoring it and falling back to `X25519`.

> [!WARNING]
> Before enforcing `X25519MLKEM768` on internal or B2B endpoints, test through your actual corporate VPNs, egress proxies, and WAF/DPI appliances. Most production breakage comes from middlebox packet parsing, not CPU overhead on the server.

## How to Verify Post-Quantum TLS Today

You do not need special tooling to check whether your browser, edge, or origin negotiates `X25519MLKEM768`:

1. **In Chrome / Edge / Firefox:** Open DevTools (`F12`) → **Security** tab → reload the page. Look at **Connection → Key exchange**. Modern Cloudflare-proxied sites show **`X25519MLKEM768`**.
2. **Check local OpenSSL support (requires OpenSSL 3.5+):**

```bash
openssl list -kem-algorithms | grep -i mlkem
```

3. **Test any origin or edge endpoint directly over TLS 1.3:**

```bash
openssl s_client -groups "X25519MLKEM768" -tls1_3 -connect your-domain.com:443 </dev/null 2>/dev/null | grep -i "Negotiated TLS1.3 group"
```

If the server supports it, the output prints `Negotiated TLS1.3 group: X25519MLKEM768`. If it prints `X25519` or fails to negotiate, the origin's TLS library is either older than OpenSSL 3.5 or has not enabled the group.

4. **Check via Cloudflare Radar API:** Cloudflare exposes `/radar/post_quantum/tls/support` under the [Cloudflare Radar API](https://developers.cloudflare.com/radar/) (authenticated with `Authorization: Bearer <API_TOKEN>`) alongside Logpush and HTTP Traffic Analytics for domain-level key-exchange telemetry.

## How to Enable `X25519MLKEM768` on Nginx and Your Origin

Cloudflare enables `X25519MLKEM768` by default on the **visitor-to-edge** leg for proxied domains. However, if the **edge-to-origin** leg still falls back to classical `X25519`, traffic between Cloudflare and your origin server remains classical unless your origin stack supports it.

On **Nginx**, support depends on the OpenSSL binary Nginx is linked against—not just the OS default package. Check with `nginx -V` to verify **OpenSSL 3.5 or newer**, then configure TLS 1.3 to prioritize hybrid ML-KEM with a classical fallback:

```nginx title="nginx-pqc.conf" {3-4}
server {
    listen 443 ssl;
    ssl_protocols TLSv1.3;
    ssl_ecdh_curve X25519MLKEM768:X25519;

    ssl_certificate     /etc/ssl/certs/fullchain.pem;
    ssl_certificate_key /etc/ssl/private/privkey.pem;
}
```

Keeping `:X25519` after `X25519MLKEM768` ensures legacy clients and older middleboxes still connect cleanly instead of failing the handshake.

## Why Only ~28.7% of Origins Support It (Linux, AWS, and CDNs)

The gap between ~70% browser/edge adoption and ~28.7% origin readiness comes down to **TLS library packaging**, not reluctance from teams:

| Layer | Default Post-Quantum Status | Underlying Stack & Reason |
| :--- | :--- | :--- |
| **Browsers (Chrome 131+, Edge 131+, Firefox 132+)** | Enabled by default | BoringSSL / NSS ship `X25519MLKEM768` out of the box |
| **Cloudflare Edge (Visitor → Edge)** | Enabled by default | Proxied domains automatically advertise `X25519MLKEM768` |
| **AWS (`s2n-tls` / CloudFront / KMS)** | Supported on modern endpoints | AWS `s2n-tls` supports hybrid `ML-KEM` key exchange; check specific ALB/CloudFront policy support |
| **Standard Linux Origins (Ubuntu 22.04/24.04, Debian 12)** | Disabled by default | Default repos ship OpenSSL 3.0.x; native `ML-KEM` requires **OpenSSL 3.5+** (or a custom BoringSSL/quictls build) |

In practice, if your app sits behind a CDN or cloud load balancer, the **external hop** may already be post-quantum while the **internal or edge-to-origin hop** still negotiates classical `X25519`. If you are planning broader cryptographic hygiene for compliance frameworks like NIS2, pair this TLS audit with your [NIS2 cloud compliance checklist](https://www.alekseialeinikov.com/en/blog/topics/security/nis2-compliance-checklist-aws-azure-google-cloud) and review where encryption vs tokenization fits in [Tokenization vs Encryption](https://www.alekseialeinikov.com/en/blog/topics/security/tokenization-vs-encryption-2026-what-takes-data-out-of-scope).

## Practical Migration Order for Engineering Teams

Do not treat post-quantum migration as a single monolithic rewrite:

1. **Keep AES-256 and SHA-256/SHA-3 as-is:** Do not waste cycles swapping symmetric encryption.
2. **Inventory long-lived confidential data first:** Any TLS traffic, VPN tunnel, or backup archive that must remain confidential for 5–15+ years is exposed to Harvest Now, Decrypt Later today.
3. **Upgrade TLS termination to OpenSSL 3.5+ / BoringSSL:** Enable `X25519MLKEM768:X25519` on public ingress, API gateways, and origin servers—not only at the CDN edge.
4. **Test middleboxes before strict enforcement:** Watch for multi-packet `ClientHello` resets on corporate DPI and older hardware load balancers.
5. **Track `ML-DSA` (`FIPS 204`) for certificates later:** Wait for ACME / CA ecosystems and certificate transparency tooling to standardize hybrid/PQC certificate chains before replacing `ECDSA` / `RSA` leaf certificates.

## The Bottom Line

Post-quantum encryption has already crossed the threshold from research paper to live internet traffic on the **key-exchange** layer. Browsers and CDNs moved first; origin servers and enterprise middleboxes are the bottleneck now. Upgrading TLS termination to OpenSSL 3.5+, preferring `X25519MLKEM768:X25519`, and testing for multi-packet `ClientHello` drops closes the Harvest Now, Decrypt Later gap without touching your symmetric ciphers or waiting for post-quantum certificates.

> [mTLS vs TLS Explained: How Mutual Authentication Works](https://www.alekseialeinikov.com/en/blog/topics/security/mtls-vs-tls-explained)
