Hybrid KEM Demo (X25519 + ML-KEM)
NewTry X25519MLKEM768 and P256MLKEM768 hybrid KEMs in your browser: generate keys, encapsulate and decapsulate, and compare sizes with pure ML-KEM and X25519.
Generate key pair
Makes a fresh X25519MLKEM768 key pair: a public key of 1,216 bytes (X25519 + ML-KEM-768 material) and a 32-byte secret seed to keep. The library expands the seed when decapsulating.
Public key
Secret seed
Demo secret. Keep it private and never use it for real data.
| Algorithm | Public key | Ciphertext | Shared secret |
|---|---|---|---|
| X25519MLKEM768 | 1,216 B | 1,120 B | 32 B |
| ML-KEM-768 (PQ half) | 1,184 B | 1,088 B | 32 B |
| X25519 (key exchange) | 32 B | 32 B | 32 B |
X25519MLKEM768: public key 1,216 B · secret seed 32 B · ciphertext 1,120 B · shared secret 32 B. Security level: hybrid · about AES-192 PQ + X25519.
How to read this demo (beginner)
Analogy: belt and suspenders. Classical X25519 is one strap; ML-KEM-768 is the other. An attacker must defeat both before the shared secret is exposed. That is why real HTTPS migrations start with hybrids.
The “secret” shown here is a short seed the library expands — different packaging from the pure ML-KEM demo. Nothing leaves your browser; still, these are toy keys, not for production.
Processed on your device — nothing is uploaded.
How to use Hybrid KEM
- 1Choose X25519MLKEM768 (the usual TLS choice) or P256MLKEM768, then press Run full demo.
- 2Or step through Generate, Encapsulate and Decapsulate with Hex or Base64 keys.
- 3Confirm the shared secrets match and read the size table against pure ML-KEM and X25519.
What this page covers
- Belt-and-suspenders hybrid: classical + ML-KEM together
- One-click full demo with matching shared secrets
- Size table: postcard (X25519) vs parcel (hybrid)
- Secrets stay in this tab — nothing uploaded
- Plain-language FAQ for TLS migration beginners
About Hybrid KEM
Think belt and suspenders: a hybrid uses an old lock (X25519 or P-256) and a new post-quantum lock (ML-KEM) together, so both must fail before a session secret is exposed. Press Run full demo to watch two sides invent a shared secret in your browser, then compare how much bigger the hybrid ‘parcel’ is than plain X25519.
Common uses
- Learn hybrids before reading vendor TLS release notes.
- Show a teammate why handshake sizes grow a little.
- Generate sample values while evaluating a library.
- Compare with the pure ML-KEM demo on this site.
Example
Input
X25519MLKEM768
Result
X25519MLKEM768: public key 1,216 B · secret seed 32 B · ciphertext 1,120 B · shared secret 32 B
Good to know
- These presets follow the @noble/post-quantum hybrid combiners. Wire formats in TLS, SSH or VPN stacks can differ slightly; treat values here as educational, not wire-compatible with every server.
- The secret key in these presets is a compact seed, not the expanded classical-plus-PQ secret. Do not use demo keys to protect real traffic.
- Industry guidance in 2026 urges accelerating NIST PQC migration; hybrids let you start without abandoning classical peer support overnight.
Hybrid KEM FAQ
Why use a hybrid instead of pure ML-KEM?
A hybrid keeps a classical algorithm in the path so a surprise break in either the new or the old scheme alone does not expose the session. It also eases rollout while some peers only speak classical ECDH.
Is X25519MLKEM768 the same as X-Wing?
They are related ideas (combine X25519 with ML-KEM-768) but combiners and labels differ across drafts and libraries. This page uses the noble hybrid preset labelled ml_kem768_x25519; always match the exact construction your protocol specifies.
Does the hybrid shared secret look like X25519’s?
No. The combiner hashes classical and PQ contributions into a fresh 32-byte secret. You should not expect it to equal either component secret on its own.
When should I pick P256MLKEM768?
When your environment already standardises on NIST P-256 for classical ECDH and wants a matching hybrid. Otherwise X25519MLKEM768 is the more common internet choice.