Path: blob/main/frontier/08-lattices-post-quantum/connect/hybrid-tls-post-quantum.ipynb
483 views
Connect: Hybrid TLS with Post-Quantum Key Exchange
Module 08 | Real-World Connections
Chrome, Cloudflare, and the world's biggest CDNs are already shipping lattice-based key exchange --- combined with classical ECDH as a safety net.
Introduction
A sufficiently powerful quantum computer could break every Diffie-Hellman and elliptic curve key exchange deployed today. Shor's algorithm solves the discrete logarithm problem in polynomial time, making ECDH (Module 06) and classical DH (Module 05) vulnerable.
But quantum computers capable of breaking 256-bit ECC do not exist yet. And the post-quantum alternatives (ML-KEM, based on lattice problems from this module) are newer and less battle-tested.
The solution: hybrid key exchange. Combine a classical scheme (X25519) with a post-quantum scheme (ML-KEM-768) so that:
If ML-KEM turns out to have a flaw, X25519 still protects you.
If a quantum computer arrives, ML-KEM protects you.
Security is the maximum of both schemes, not the minimum.
This is not hypothetical. Chrome enabled X25519Kyber768 by default in Chrome 124 (April 2024). Cloudflare supports it on all domains. AWS, Apple, and Signal have also deployed post-quantum hybrid key exchange.
The Hybrid Approach
In a hybrid TLS 1.3 handshake, the client and server perform two independent key exchanges in a single flight:
X25519 (classical ECDH on Curve25519, from Module 06):
Client sends an X25519 public key share
Server responds with its X25519 public key share
Both derive a 32-byte shared secret
ML-KEM-768 (post-quantum, from this module):
Client sends an ML-KEM encapsulation key (public key)
Server encapsulates a shared secret and sends the ciphertext
Client decapsulates to recover the 32-byte shared secret
Combine: The final shared secret is derived by feeding both shared secrets into a Key Derivation Function (KDF):
An attacker must break both X25519 and ML-KEM to recover the session key. A classical attacker cannot break X25519; a quantum attacker (presumably) cannot break ML-KEM. So the combined scheme is secure against both.
The TLS 1.3 Hybrid Handshake
Here is how the hybrid handshake works in TLS 1.3:
The key observation: everything fits in a single round trip. The client sends both key shares in the ClientHello, and the server responds with both in the ServerHello. This means hybrid PQ adds zero extra round trips compared to classical TLS 1.3.
The cost is bandwidth: the ClientHello grows by about 1184 bytes (the ML-KEM encapsulation key), and the ServerHello grows by about 1088 bytes (the ML-KEM ciphertext). This is significant but manageable.
Why Hybrid? Defense in Depth
The hybrid approach is motivated by two kinds of uncertainty:
Uncertainty about quantum computers:
We do not know when (or if) large-scale quantum computers will exist.
If they never arrive, classical ECDH alone would have sufficed.
But harvest-now, decrypt-later attacks are real: adversaries can record encrypted traffic today and decrypt it once quantum computers exist.
Uncertainty about post-quantum schemes:
ML-KEM is based on Module-LWE, which has been studied for ~15 years.
Classical schemes (RSA, ECDH) have been studied for 40+ years.
What if someone finds a classical attack on Module-LWE? (Several early PQ candidates were broken classically, e.g., SIKE in 2022.)
The hybrid approach addresses both risks simultaneously:
| Threat Model | X25519 | ML-KEM | Hybrid |
|---|---|---|---|
| Classical attacker | Secure | Secure | Secure |
| Quantum attacker | Broken | Secure | Secure |
| Classical break of ML-KEM | Secure | Broken | Secure |
| Quantum + ML-KEM broken | Broken | Broken | Broken |
The hybrid fails only if both schemes are broken simultaneously --- the least likely scenario.
Deployment Timeline
Post-quantum hybrid key exchange is already deployed at massive scale:
| Date | Event |
|---|---|
| 2022-10 | Cloudflare and Google begin experimental X25519+Kyber deployment |
| 2023-08 | Signal deploys PQXDH (X25519 + Kyber-1024) for all new chats |
| 2024-04 | Chrome 124 enables X25519Kyber768 by default for all users |
| 2024-08 | NIST publishes FIPS 203 (ML-KEM), finalizing the standard |
| 2024-09 | AWS Key Management Service adds ML-KEM hybrid support |
| 2024-11 | Apple iMessage deploys PQ3 protocol with ML-KEM |
| 2025+ | Ongoing migration of TLS, SSH, VPN, and certificate infrastructure |
The transition is happening now, driven by the harvest-now-decrypt-later threat. Organizations with long-lived secrets (government, healthcare, finance) are migrating first.
Summary
| Concept | Key idea |
|---|---|
| Hybrid key exchange | Combines classical ECDH (X25519) with post-quantum ML-KEM (Kyber) in a single TLS 1.3 handshake |
| Defense in depth | The final key comes from both shared secrets, so an attacker must break both schemes simultaneously |
| Zero extra round trips | Both key shares fit in the existing ClientHello and ServerHello messages. The only cost is about 2.2 KB of additional bandwidth. |
| Already deployed | Chrome, Cloudflare, Signal, AWS, and Apple have all shipped post-quantum hybrid key exchange |
| Module 08 in practice | LWE is the hardness assumption, Ring-LWE is the efficiency mechanism, and lattice reduction determines the security parameters |