← Back to section · Post-Quantum Migration
Designing Hybrid Key-Exchange Combiners: Joining Two Shared Secrets into One
The security of a hybrid KEM rests almost entirely on its combiner: concatenation order, context binding, and KDF choice decide whether the promise that the whole stays secure as long as one component does actually holds.
Run X25519 and ML-KEM-768 side by side, obtain a shared secret from each, and merge the two into a session key — that is hybrid key exchange. The idea is straightforward, but what actually determines security is not the two component algorithms; it is the unassuming piece in the middle: the combiner. Get the combiner wrong and strong components are wasted; get it right and the hybrid delivers its core promise — if the classical component falls to a quantum computer, or the post-quantum component falls to classical cryptanalysis, the whole still stands as long as one component does. For migration engineering, the combiner is not an implementation detail; it is an audit item that must be checked line by line during selection.
The Plainest Construction: Concatenate, Then Run a KDF
Mainstream constructions are surprisingly uniform: concatenate the two shared secrets in a fixed order and feed them, together with protocol context, into a key derivation function (KDF) whose output seeds the symmetric keys. The TLS 1.3 hybrid key exchange draft takes exactly this route — the ML-KEM shared secret and the ECDHE shared secret are concatenated into TLS’s existing key schedule (built on HKDF), and the handshake transcript naturally binds both parties’ key-share messages into the derivation. SSH’s hybrid schemes (such as mlkem768x25519-sha256) likewise concatenate the two exchange results and hash them.
The concatenation order must be fixed and written into the specification. If the order is left open, the two endpoints may disagree about which secret comes first — at best the handshake fails; at worst an attacker gains room to make the endpoints derive divergent views of the key. Such requirements look trivial, but they are the first lesson of combiner review: wherever implementers are given freedom, interoperability incidents or security holes eventually follow.
What a Combiner Must Defend Against
First, component independence. The combined result should need only one component to hold: if ML-KEM is broken tomorrow, the combined key’s security should degrade to that of X25519, not to zero. Concatenation-plus-KDF constructions have been analyzed in the cryptographic literature (often called concatenation combiners), and the conclusion is that, provided the KDF behaves well, the combination’s confidentiality is no weaker than the stronger component.
Second, context binding. Concatenating the shared secrets alone is not enough. A robust combiner also feeds both public keys and both ciphertexts into the KDF input. Then, even if an attacker substitutes a public key or ciphertext on the wire, the two endpoints cannot be made to derive an attacker-controlled key while believing the exchange succeeded; this also defeats cross-protocol reuse and replay. The X-Wing combiner is an explicit example of this approach: when combining ML-KEM-768 with X25519, it writes both public keys and ciphertexts into a SHA3-256-based derivation and stamps the output with a fixed construction identifier string, so the key is bound from birth to this exchange and this construction.
Third, randomness and length handling. The two components’ shared secrets need not be the same length (ML-KEM outputs 32 bytes and X25519 outputs 32 bytes, but other pairings are less tidy), so the combiner must handle lengths with an unambiguous encoding, eliminating concatenation ambiguity — the possibility that different splits of the components produce the same byte string. Fixed-length encoding or length prefixes are the standard remedy, and whether the specification states this is the easiest check in a review — and the one that should never be missing.
An Easily Missed Detail: Domain Separation and Construction Labels
Another requirement implementers tend to dismiss as formalism is domain separation. A combined key may be used only for the protocol, construction, and parameter set it was created for, never borrowed by another context. The method is to include fixed label strings — protocol name, construction name, version — in the KDF input. X-Wing is especially explicit here: its derivation includes a hard-coded construction identifier and a formula-like fixed separator string, precisely so that X-Wing’s output keys are cryptographically unrelated to the outputs of any other combination method. TLS’s key schedule likewise uses labels to separate every derived key. In a combiner review, the presence of labels and their conformance to the specification is the cheapest check available, yet it blocks an entire class of cross-protocol confusion problems. There is a practical migration benefit too: a combination carrying version and construction identifiers can negotiate old and new constructions smoothly when a parameter set or component is later replaced; a combination without identifiers can only be switched hard, at the protocol version level, at higher risk and cost.
Deployment Reality: What Deployed Combinations Look Like
From a migration standpoint, the good news is that mainstream combinations are no longer paper designs. In the TLS ecosystem, X25519MLKEM768 has become the hybrid group enabled by default by browsers and large service providers; in SSH, OpenSSH has preferred the sntrup761x25519 hybrid exchange by default since 9.0, moving to mlkem768x25519 in 10.0. These deployments share one pattern: the combination logic is defined uniformly by the protocol specification, leaving implementers no room to improvise. IKEv2, through the multiple key exchange framework of RFC 9370, allows several key-exchange rounds to be stacked into one negotiation and derived jointly — the same idea in a more general form.
The correct posture for a migration team is therefore not “design a combiner” but “verify that the combiner in the library you use matches the specification”: concatenation order, KDF, bound fields, group identifiers, checked item by item against the specification and its test vectors. A home-grown combination — even merely swapping the hash function for a house favourite — invalidates the existing security analysis and is something migration engineering should explicitly avoid.
Review Checklist: Five Questions to Ask a Vendor
Distil the analysis into an executable checklist. One: does the combination have a public specification and public analysis, and which document? Two: does the KDF input include both public keys and ciphertexts, or only the shared secrets themselves? Three: are concatenation order and encoding fixed in the specification? Four: does the implementation pass the specification’s test vectors, including negative cases? Five: when a component must later be replaced (say, moving from ML-KEM-768 to a higher parameter set), how are combiner versions negotiated and identified — a combination without version identifiers will replay today’s migration at the next upgrade.
Hybrid key exchange is the earliest-landing, strongest-consensus part of the whole post-quantum migration, and that consensus rests precisely on restraint in combiner design: simple construction, complete binding, no improvisation. The migration team’s job is to carry that restraint, unchanged, into its own selection and acceptance process.
Tags: Hybrid Key ExchangeCombinerML-KEMKey Derivation