#Why this matters
Selecting post-quantum algorithms is only the first step. Real organizations run thousands of microservices, hardware security modules (HSMs), VPN appliances, and third-party SDKs built over decades around fixed assumptions: 2048-bit RSA keys, 32-byte ECDH shares, and single-packet TLS ClientHello messages.
Past migrations from SHA-1 to SHA-256 and TLS 1.0 to TLS 1.3 took years and repeatedly broke brittle middleboxes and custom parsers. Transitioning to FIPS 203, 204, and 205 requires systematic discovery, crypto-agile engineering, and controlled lab measurements before touching production traffic.
#Migration planning: CBOM and Mosca's theorem
Before changing any cipher configuration, defenders must answer two questions: where is cryptography used, and which systems expire first?
Mosca's theorem frames urgency with three variables:
x: confidentiality shelf life of the data (how many years secrets must remain private)y: migration time required to inventory, test, and upgrade systemsz: time until a cryptographically relevant quantum computer (CRQC) exists
Whenever x + y > z, recorded traffic is already exposed to Harvest Now, Decrypt Later (HNDL) attacks.
To compute y accurately, teams build a Cryptography Bill of Materials (CBOM) covering TLS termination proxies, internal mTLS meshes, SSH bastions, VPN concentrators, firmware/code-signing pipelines, and static data-encryption key wrappers.
- Discover (CBOM)Scan repos, binaries, certs, HSMs, TLS endpoints
- Classify (x+y vs z)Rank long-lived confidentiality links first
- Pilot (Hybrid KEM)Enable X25519MLKEM768 in staging and measure MTU
- Roll out (Agile PKI)Automate rotation, later adopt ML-DSA/SLH-DSA certs
True crypto-agility means avoiding hardcoded algorithm names, avoiding fixed-size key/signature buffers (for instance, allocating 256 bytes for a signature that becomes 3,309 bytes under ML-DSA-65), and separating cryptographic policy from business code through provider abstractions.
#Hybrid key exchange: X25519 + ML-KEM-768
During the early PQC era, security teams face two competing risks: classical X25519 will fall to a future CRQC, while newly standardized lattice schemes could harbour subtle implementation bugs or unforeseen cryptanalytic weaknesses. Hybrid key exchange protects against both by combining a classical and a post-quantum primitive in a single handshake.
In TLS 1.3, the flagship hybrid group is X25519MLKEM768 (paired with SecP256r1MLKEM768 for environments requiring NIST P-256 compliance):
Because both shared secrets enter the TLS 1.3 HKDF-Extract key schedule together, an attacker must break both X25519 and ML-KEM-768 to recover session traffic keys. Notice the wire-size shift compared to classical ECDHE:
| TLS 1.3 group | Client key_share |
Server key_share |
Combined secret fed to HKDF |
|---|---|---|---|
X25519 |
32 bytes | 32 bytes | 32 bytes (classical only) |
MLKEM768 |
1,184 bytes | 1,088 bytes | 32 bytes (PQ only) |
X25519MLKEM768 |
1,216 bytes | 1,120 bytes | 64 bytes (K_pq + K_classical) |
That extra 1,184 bytes in ClientHello has an immediate network consequence. Standard 1500-byte Ethernet gives a TCP Maximum Segment Size (MSS) of roughly 1,460 bytes (or 1,440 bytes with IPv6/TCP timestamps). Classical ClientHello messages (~300 to 600 bytes) fit inside a single TCP packet. Adding X25519MLKEM768 plus SNI, ALPN, and cipher extensions frequently pushes ClientHello past 1,460 bytes, splitting it across two TCP segments.
#Lab experiments with OpenSSL 3.5 and oqs-provider
OpenSSL 3.5 added native support for FIPS 203, 204, and 205, including X25519MLKEM768, directly in its default provider. On earlier OpenSSL 3.0 to 3.4 installations, you load the Open Quantum Safe oqs-provider (backed by liboqs) alongside the default provider to run the same experiments.
First, verify which providers and KEM algorithms are active in your lab environment, then spin up a local TLS 1.3 listener and test client negotiation:
$ openssl list -providers
Providers:
default
name: OpenSSL Default Provider
status: active
$ openssl list -kem-algorithms | grep -E "MLKEM|X25519"
MLKEM512 @ default
MLKEM768 @ default
MLKEM1024 @ default
X25519MLKEM768 @ default
$ openssl s_server -cert lab.crt -key lab.key -groups X25519MLKEM768:X25519 -accept 8443 -www &
$ openssl s_client -connect lab.local:8443 -groups X25519MLKEM768 < /dev/null | grep -E "Protocol|Negotiated|Peer signature"
Protocol : TLSv1.3
Negotiated TLS1.3 group: X25519MLKEM768
Peer signature type: ecdsa_secp256r1_sha256If you are running OpenSSL 3.2 or 3.4 with oqs-provider installed instead of OpenSSL 3.5, pass -provider oqsprovider -provider default to openssl list, s_server, and s_client, and check openssl list -kem-algorithms for the exact provider group name (such as x25519_mlkem768).
Notice the last line of the s_client output: Peer signature type: ecdsa_secp256r1_sha256. That highlights a crucial distinction: X25519MLKEM768 protects the ephemeral session key against HNDL today, while the server certificate signature can remain ECDSA or RSA until your PKI transitions to ML-DSA.
To benchmark real-world impact in a lab, combine openssl s_client or openssl s_time with tcpdump / tshark (and optionally Linux tc netem delay/loss simulation):
- Measure total handshake bytes (
ClientHello,ServerHello, and certificate chain) forX25519vs.X25519MLKEM768. - Count TCP segments carrying
ClientHelloto confirm whether your TLS configuration crosses the 1,460-byte MSS boundary. - Verify that clients offering
X25519MLKEM768:X25519cleanly negotiateX25519when connecting to classical-only servers without triggeringHelloRetryRequestloops unless intentionally testing fallback.
#Common mistakes
- Skipping middlebox and MTU testing: Assuming a hybrid TLS upgrade is purely a software change ignores firewalls, load balancers, and DPI boxes that break on multi-segment
ClientHellopackets. - Hardcoding buffer limits or ASN.1 expectations: Legacy C/C++ services or embedded TLS stacks with 1 KB or 2 KB handshake buffers fail abruptly when encountering ML-KEM key shares or ML-DSA certificate chains.
- Disabling classical fallback too early: Removing
X25519from server group lists before clients support PQC causes hard outages; keepX25519MLKEM768:X25519ordered cleanly during transition. - Confusing hybrid key exchange with PQC authentication: Hybrid
X25519MLKEM768secures confidentiality against HNDL, but servers still authenticate with RSA/ECDSA certificates until ML-DSA or SLH-DSA PKI is deployed.
#Summary
- Effective PQC migration starts with a CBOM inventory and Mosca's theorem (
x + y > z) to protect long-lived confidential data first. - Hybrid key exchange (
X25519MLKEM768) pairs X25519 with ML-KEM-768 so session confidentiality survives if either algorithm remains unbroken. - Because
X25519MLKEM768adds 1,184 bytes to the clientkey_share,ClientHellooften spans two TCP segments and must be tested against middleboxes. - OpenSSL 3.5 natively supports
X25519MLKEM768(while OpenSSL 3.0-3.4 usesoqs-provider+liboqs), enabling practical handshake verification and byte-level benchmarking in the lab.