DEV Community

Post Quantum TLS: What Hybrid Key Exchange Actually Changes

Post quantum cryptography is no longer something security teams can leave entirely to research departments. NIST finalized ML-KEM as a post quantum key encapsulation mechanism in 2024, and the IETF is actively standardizing hybrid key agreement for TLS 1.3. The practical transition is already visible in modern TLS implementations and large internet infrastructure. For engineering teams, however, the important question is not simply what ML-KEM does. The bigger question is what actually changes when a TLS connection moves from a traditional exchange such as X25519 to a hybrid mechanism such as X25519MLKEM768. The answer is more specific than "TLS becomes quantum safe." Hybrid key exchange changes how the session secret is established while leaving most of the application-facing TLS architecture intact. It also introduces larger handshake messages, new compatibility considerations, different implementation dependencies, and a much greater need to understand which cryptographic mechanism is actually being negotiated. Why TLS Needs Hybrid Key Exchange TLS 1.3 commonly uses ephemeral elliptic-curve key exchange such as X25519. This provides strong protection against currently practical classical attacks, but a sufficiently capable quantum computer could threaten the mathematical assumptions behind elliptic-curve cryptography. That creates a long-term confidentiality problem. An attacker can potentially capture encrypted traffic today and retain it for future decryption if quantum computing eventually makes the underlying key exchange vulnerable. This is commonly described as a harvest-now, decrypt-later risk. Hybrid key exchange addresses that problem without requiring the internet to abandon established cryptography overnight. Instead of replacing X25519 immediately, the TLS handshake combines a classical exchange with a post quantum mechanism. The current IETF draft defines hybrid TLS 1.3 mechanisms including X25519MLKEM768, which combines X25519 with ML-KEM-768. (IETF Datatracker) This approach gives organizations a practical transition path because the classical and post quantum components both contribute to establishing the session secret. What Changes Inside a TLS 1.3 Handshake? The overall TLS 1.3 handshake remains recognizable. Clients still send a ClientHello, servers respond with a ServerHello, certificates are used for authentication, and the connection eventually transitions to encrypted application traffic. The major change occurs in the key exchange information. A traditional connection might negotiate X25519, while a hybrid connection can negotiate X25519MLKEM768. The latter combines the X25519 ECDH exchange with ML-KEM-768. The current IETF specification defines the resulting shared secret for X25519MLKEM768 as the combination of the ML-KEM and X25519 shared secrets. (IETF Datatracker) | Area | Traditional TLS 1.3 | Hybrid TLS 1.3 | |---|---|---| | Key exchange | X25519 or another classical group | X25519 + ML-KEM-768 | | TLS version | TLS 1.3 | TLS 1.3 | | Authentication | RSA, ECDSA, etc. | Can initially remain classical | | Application protocol | HTTP, HTTP/2, HTTP/3, APIs | No fundamental change | | Session encryption | Symmetric encryption | Symmetric encryption | | Key exchange size | Relatively small | Significantly larger | | Quantum protection | Classical security assumptions | Adds post quantum key establishment | This distinction matters because hybrid TLS is not a new application protocol. It is a change to the cryptographic machinery underneath the connection. If you want to understand where this key exchange occurs in the broader TLS flow, this TLS handshake packet-level breakdown provides useful context on ClientHello, key shares, certificates, and TLS 1.3 message flow. What ML-KEM Adds to X25519 ML-KEM is a key encapsulation mechanism standardized by NIST under FIPS 203. NIST defines ML-KEM-512, ML-KEM-768, and ML-KEM-1024 parameter sets, with ML-KEM-768 being the post quantum component used in X25519MLKEM768. (NIST Computer Security Resource Center) The fundamental difference is the mathematical assumption behind each mechanism. X25519 relies on elliptic-curve Diffie-Hellman. ML-KEM is based on lattice cryptography and the Module Learning with Errors problem. A hybrid handshake uses both rather than betting the future of the connection on one algorithm. This is why Cloudflare describes X25519MLKEM768 as a hybrid key agreement that maintains the security provided by X25519 while adding the post quantum component. Cloudflare currently recommends this hybrid mechanism in its deployed PQC support. (Cloudflare Docs) The design is therefore less about replacing something that already works and more about reducing dependence on a single cryptographic assumption during the transition to post quantum cryptography. The Handshake Gets Much Larger One of the most visible practical changes is the size of the key exchange. The current IETF draft specifies a 1,216-byte client key exchange value for X25519MLKEM768. That consists of 1,184 bytes for the ML-KEM-768 portion and 32 bytes for X25519. (IETF Datatracker) That is considerably larger than the compact key exchange material engineers are accustomed to seeing with X25519 alone. The larger handshake can affect infrastructure in ways that are easy to overlook, particularly when TLS traffic passes through multiple network components. Engineering teams should test: - ClientHello and ServerHello sizes - Packet fragmentation and MTU behavior - TLS termination performance - Reverse proxies and load balancers - Firewalls and TLS inspection appliances - Mobile and high-latency networks - Connection establishment latency - CPU and memory consumption - Failure and fallback behavior The impact depends heavily on the workload. A service using long-lived HTTP/2 connections may barely notice the additional handshake overhead, while an API creating huge numbers of short-lived connections can be much more sensitive to it. Hybrid TLS Does Not Automatically Replace Your Certificate This is one of the most important distinctions in post quantum migration. Key exchange and authentication are different cryptographic functions. A TLS certificate authenticates the server. The ephemeral key exchange establishes the shared secret from which the session's symmetric encryption keys are derived. Therefore, enabling X25519MLKEM768 does not automatically mean an organization must replace every RSA or ECDSA certificate. That does not make certificates irrelevant to post quantum migration. Digital signatures are themselves an important part of the longer-term transition. NIST has separately standardized post quantum signature algorithms including ML-DSA and SLH-DSA. (NIST Computer Security Resource Center) A sensible migration strategy should therefore treat these as related but separate workstreams: | Migration area | Main concern | |---|---| | Hybrid key exchange | Protecting session establishment against future quantum attacks | | Digital signatures | Maintaining quantum-resistant authentication | | Certificates | Delivering and validating public-key authentication | | Software signing | Protecting code and update integrity | | VPNs | Protecting long-lived private communications | | Stored encryption | Protecting information whose confidentiality must survive for years | Hybrid TLS is an important first step, but it is not the entire post quantum migration. Supporting PQC Is Not the Same as Negotiating PQC A common deployment mistake is to check whether a TLS library supports ML-KEM and assume that every connection is therefore protected by hybrid key exchange. That assumption is wrong. A client may support X25519MLKEM768 while a particular server only supports X25519. In that situation, the connection can continue using a classical key exchange. The important question is therefore not: Does my system support PQC? The more useful question is: What key exchange group did this connection actually negotiate? Recent DEV Community testing demonstrates this distinction clearly. A .NET application can report ML-KEM support while the negotiated connection still needs to be checked separately for a group such as X25519MLKEM768. (DEV Community) For infrastructure teams, the validation process should include: - Confirming TLS library capability - Confirming client supported groups - Confirming server supported groups - Inspecting the negotiated group - Testing classical fallback - Monitoring third-party connections - Recording results across environments This turns PQC readiness from a configuration claim into something measurable. TLS Libraries Become a Critical Migration Dependency Application teams may not need to change application code, but they may need to change the cryptographic stack underneath that code. This is particularly important for runtimes that bundle their own TLS libraries. For example, recent DEV Community testing of Node.js demonstrated how the bundled OpenSSL version can determine whether a connection negotiates X25519 or X25519MLKEM768. The same application code can therefore produce different TLS behavior depending on the runtime and cryptographic library underneath it. (DEV Community) That means teams should inventory: - Operating system TLS libraries - Language runtimes - OpenSSL versions - Reverse proxies - Load balancers - Service meshes - API gateways - Container base images - Cloud-managed TLS services The application source code may be unchanged while its cryptographic behavior changes significantly because one underlying dependency has been upgraded. What Hybrid TLS Changes for Developers For most developers, hybrid TLS should remain below the application layer. There is no need to redesign a REST API simply because the underlying TLS connection uses ML-KEM. HTTP requests, JSON payloads, authentication logic, database queries, and application business logic do not fundamentally change. The relevant dependency chain looks more like: Application โ†’ Runti

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.