Hybrid Mode  |  X25519 (Classical) + ML-KEM (Post-Quantum)  |  Defense in Depth

Hybrid KEM Simulator

Real-world TLS 1.3 deployments don't switch straight to pure post-quantum cryptography — they run hybrid key exchange, combining a classical algorithm (X25519) with a post-quantum one (ML-KEM) into a single session key. If either algorithm is ever broken — a cryptanalytic break in ML-KEM, or a future quantum computer breaking X25519 — the combined key stays secure as long as the other half holds. This simulator walks through both sides of that handshake and proves the two independently-derived session keys match.

1
Generate the Recipient's Hybrid Key Pair
One X25519 key pair (classical) plus one ML-KEM key pair (post-quantum) — this represents the server's static keys

2
Sender: Hybrid Encapsulate
Using the recipient's two public keys, derive a classical secret (X25519 ECDH) and a PQC secret (ML-KEM), then combine them into one session key
Recipient's public keys auto-filled from Step 1. Click Encapsulate.

3
Recipient: Hybrid Decapsulate
Using its own private keys plus the sender's ephemeral public key and ciphertext, re-derive the identical session key
Private keys and encapsulated values auto-filled. Click Decapsulate.
Complete Steps 2 and 3 to compare session keys...

Why Hybrid Key Exchange, Not Pure Post-Quantum

ML-KEM has been through eight years of public cryptanalysis and is now a final NIST standard, but it is still a comparatively young algorithm family next to elliptic-curve Diffie-Hellman, which has stood since the 1980s. Real-world TLS 1.3 deployments — including major browsers and CDNs shipping PQC support today — don't switch straight to pure ML-KEM. They run a hybrid key exchange: both a classical algorithm and a post-quantum algorithm run independently, and their outputs are combined into a single session key. The security argument is simple — the combined key is only as weak as its strongest half. If a future mathematical attack ever broke ML-KEM, the classical X25519 secret would still protect the session against any adversary without a quantum computer. If a quantum computer ever broke X25519, the ML-KEM secret would still protect the session against it.

How the Combiner Works

This simulator uses a simple SHA-256 concatenation combiner: sessionKey = SHA-256(classicalSecret || pqcSecret). It demonstrates the core idea clearly, but production systems use a formally specified KDF instead — for example, IETF's hybrid key exchange drafts for TLS 1.3 specify precise input ordering and a proper HKDF construction, since the exact combiner matters for the security proof. Standardized hybrid groups already in use include X25519Kyber768 (X25519MLKEM768 post-finalization) and SecP256r1MLKEM768.

ComponentBasisBreaks if...
X25519 (classical)Elliptic curve discrete logA large-scale quantum computer runs Shor's algorithm
ML-KEM (post-quantum)Module lattice problemsAn unforeseen classical or quantum mathematical attack on lattices
Hybrid combined keyBoth of the aboveBoth algorithms are broken simultaneously — the actual goal of hybrid mode

Curious where HQC fits in as a second, structurally independent PQC algorithm? See the HQC tool and the PQC Standards Tracker.

References

  1. NIST FIPS 203 — ML-KEM Standard (2024)
  2. IETF — Hybrid Key Exchange in TLS 1.3
  3. Open Quantum Safe (OQS)