KEM vs key exchange: encapsulation and agreement

A key encapsulation mechanism (KEM) lets one party send a fresh shared secret to a holder of a key pair, while key exchange describes the protocol that uses one or more such secrets; this page sets the two side by side for architects and reviewers.

On this page

KEM vs key exchange: what separates the two terms

A vendor document, standard or tender may name a key encapsulation mechanism (KEM) where you expected Diffie-Hellman, or the reverse, and the two terms are easy to confuse. A KEM is an interface with three operations, key generation, encapsulation and decapsulation, that produces a shared secret. Key exchange is the protocol role that agrees a session key between two parties. The distinction that matters is the interface a single algorithm exposes versus how a handshake combines secrets. A KEM describes what one algorithm does, while key exchange describes what the protocol does with the output.

Architects, TLS and SSH reviewers, and procurement teams meet this question when they read a product's supported algorithms or a tender's cryptographic requirements. FIPS 203 describes ML-KEM through the KEM interface rather than as a Diffie-Hellman style exchange, and its abstract says a KEM lets two parties agree on a shared secret key over a public channel. RFC 9180 shows how a Diffie-Hellman group can be wrapped into a KEM interface. In TLS, RFC 9954 negotiates each hybrid as a single named group and feeds the concatenated shared secrets into the TLS 1.3 key schedule in place of the usual (EC)DHE secret. In SSH, RFC 10042 defines hybrid methods pairing ML-KEM with ECDH.

When you review a document, check whether the term refers to the algorithm interface or to the protocol group name, such as X25519MLKEM768 or mlkem768x25519-sha256. Confirm the exact version and standard each one refers to, because RFC 9954 notes that concatenation requires fixed-length keys, ciphertexts and shared secrets. Ask the vendor which group names and standards their implementation supports, and check the protocol version in their documentation.

KEM and key exchange side by side

This table sets a key encapsulation mechanism against a Diffie-Hellman style key exchange across the attributes the sources support, including the operations each performs, the document that defines it and where it is supported. Read each row as the same question asked of both designs, since the two arrive at a shared secret in different ways. The main takeaway is that a KEM is a set of three operations, while DHKEM and ML-KEM fit that interface differently and reach the same shared-secret goal.

AttributeKEM (ML-KEM)Diffie-Hellman style exchange (DHKEM)
What it isA key encapsulation mechanism that lets two parties agree on a shared secret over a public channel (NIST FIPS 203)A key exchange in which the sender turns a Diffie-Hellman group into a KEM using an ephemeral key pair (RFC 9180)
Defining document and dateFIPS 203, published 13 August 2024 (NIST)RFC 9180 (HPKE), February 2022, Informational, from the IRTF CFRG
Interface operationsKey generation, encapsulation and decapsulation (FIPS 203)Encap produces a fresh shared secret and its encapsulation, and Decap recovers the secret with the private key (RFC 9180)
Sender operationEncapsulation produces a ciphertext and shared secret from the recipient's public key (FIPS 203)The sender generates an ephemeral key pair, computes a DH value with the recipient's public key and sends the serialized ephemeral public key (RFC 9180)
Recipient operationDecapsulation recovers the shared secret from the ciphertext with the private key (FIPS 203)Decap repeats the DH computation with the recipient's private key and derives the secret from the DH output and a context (RFC 9180)
ML-KEM parameter sets or named groupsParameter sets ML-KEM-512, ML-KEM-768 and ML-KEM-1024 (FIPS 203). TLS named groups MLKEM512, MLKEM768 and MLKEM1024 in draft-ietf-tls-mlkem-11, marked not recommended (IETF draft)Not applicable as a parameter set. Hybrid TLS groups such as X25519MLKEM768 pair ECDHE with ML-KEM (RFC 10024)
Current statusFIPS 203 is a published standard. The TLS ML-KEM draft is in the RFC Editor queue as of 17 September 2026 (IETF draft)RFC 9180 is Informational. RFC 10024 is a Standards Track hybrid group definition dated August 2026 (RFC 10024)
Where supportedOpenSSH 9.9 and 10.0 (mlkem768x25519-sha256 default in 10.0). OpenSSL 3.5.0, released 8 April 2025 (OpenSSH PQ page, OpenSSL 3.5 notes)Hybrid TLS 1.3 key exchange in RFC 9954 and RFC 10024. SSH hybrid methods in RFC 10042 (RFC 9954, RFC 10042)
Use in a hybridIts shared secret is concatenated with the ECDHE secret before entering the TLS 1.3 key schedule (RFC 9954)Its shared secret is concatenated with the ML-KEM secret, with the order set per group (RFC 10024)

What a KEM is and what key exchange is

A key encapsulation mechanism (KEM) is an interface with three operations: key generation, encapsulation and decapsulation. The sender uses the recipient's public key to produce a fresh shared secret and an encapsulation of it, and the recipient uses its private key to recover that secret from the encapsulation. FIPS 203 describes ML-KEM through this interface rather than as a Diffie-Hellman style exchange, and its abstract says a KEM lets two parties agree on a shared secret key over a public channel. ML-KEM is published as FIPS 203 with a date of 13 August 2024 and has three parameter sets, ML-KEM-512, ML-KEM-768 and ML-KEM-1024. NIST SP 800-227, Recommendations for Key-Encapsulation Mechanisms, was finalized in September 2025 and describes a KEM as a way for two parties to establish a shared secret key for use with symmetric-key algorithms. RFC 9180 defines the same interface as Encap(pkR), which produces a shared secret and its encapsulation, and Decap(enc, skR), which recovers the secret.

  • FIPS 203 interface: ML-KEM is specified by key generation, encapsulation and decapsulation, not by a DH-style exchange.
  • Parameter sets: ML-KEM-512, ML-KEM-768 and ML-KEM-1024 are listed in order of increasing security strength and decreasing performance.
  • SP 800-227 scope: the document gives recommendations for KEMs used to establish a shared secret for symmetric algorithms.
  • RFC 9180 operations: Encap(pkR) returns a fresh shared secret and an encapsulation, and Decap(enc, skR) recovers the secret.
  • Where it appears: ML-KEM is a standalone key agreement option in TLS 1.3 through the MLKEM512, MLKEM768 and MLKEM1024 group codepoints in the draft-ietf-tls-mlkem work.

Check the exact standard version and parameter set your product implements, and confirm which KEM your library exposes through its API.

Differences that change systems and decisions

A KEM and a Diffie-Hellman style exchange both leave two parties with a shared secret, but they put different messages on the wire and fit different slots in a protocol. The cards below cover the consequences a reviewer or engineer should check before choosing a group, a method, or a message format.

Encapsulation replaces the public value

In a KEM the sender produces a fresh shared secret and an encapsulation of it, and the recipient recovers the secret with its private key. In protocols built around a Diffie-Hellman exchange, the public value that each side sends is replaced by this encapsulation message in some designs. Check which message your protocol version expects in each direction, because a ciphertext and a public key are not interchangeable fields.

RFC 9180 text

Ephemeral pair in DHKEM

RFC 9180 turns a Diffie-Hellman group into a KEM by having the sender generate an ephemeral key pair for each encapsulation. The sender computes a DH value with the recipient's public key and sends its serialized ephemeral public key as the encapsulation. Review whether your implementation generates that ephemeral pair per message and discards it afterward, since reuse changes what the construction provides.

RFC 9180 text

Fixed sizes in hybrid concatenation

RFC 9954 builds hybrid TLS 1.3 key exchange by concatenating public keys, ciphertexts and shared secrets from the component algorithms. Because of this, each component must have fixed-length keys, ciphertexts and shared secrets. ML-KEM meets that requirement by design, but any component that varies in length cannot be concatenated this way. Confirm the sizes your hybrid group carries before sizing buffers or record limits.

RFC 9954 text

Key exchange method slot in IKEv2

RFC 9370 renames IKEv2 Transform Type 4 from Diffie-Hellman Group to Key Exchange Method, so that non-Diffie-Hellman methods such as a KEM can occupy the same slot. It also allows additional key exchanges named ADDKE1 to ADDKE7. Check that peers agree on the transform type and method list during negotiation, because a KEM-capable implementation and a DH-only peer will not share a method.

RFC 9370 text

Secret order differs by named group

RFC 10024 places the ML-KEM shared secret first in X25519MLKEM768, but places the ECDHE secret first in SecP256r1MLKEM768 and SecP384r1MLKEM1024. Anyone comparing transcripts, writing test vectors or reviewing a custom implementation must follow the order for the specific group, not assume one order across all hybrids. Confirm the ordering against the group named in the handshake.

RFC 10024 text

A KEM alone is not a protocol

FIPS 203 defines ML-KEM through key generation, encapsulation and decapsulation, and NIST SP 800-227 describes a KEM as a way to establish a shared secret over a public channel. Neither defines how the parties authenticate each other, negotiate parameters or derive session keys. A KEM is a component to place inside a protocol, so review the surrounding handshake for those jobs rather than treating the KEM as the whole exchange.

FIPS 203 text

Where a KEM and key exchange appear in protocols and products

A KEM shows up in protocols as a key exchange method, and the place to start is the protocol's own negotiation field, because each protocol names post-quantum options differently. In TLS 1.3, RFC 9846 obsoletes RFC 8446 and remains the base specification. Standalone ML-KEM groups are defined in draft-ietf-tls-mlkem-11, dated 17 September 2026 and marked Informational, currently in the RFC Editor queue, with codepoints MLKEM512 (0x0200), MLKEM768 (0x0201) and MLKEM1024 (0x0202). Hybrid groups are defined in RFC 10024 (August 2026, Standards Track), which names X25519MLKEM768 (0x11EC) as Recommended Y, and SecP256r1MLKEM768 and SecP384r1MLKEM1024 as Recommended N. Confirm which of these your TLS stack actually advertises before you assume a given group is in use.

SSH takes a different route. RFC 10042 (August 2026, Informational) defines hybrid methods that pair ML-KEM with traditional ECDH for the SSH transport layer. OpenSSH added mlkem768x25519-sha256 in version 9.9 and made it the default key agreement in version 10.0, as described on the OpenSSH post-quantum page. For IKEv2, RFC 9370 (May 2023, Standards Track) renames Transform Type 4 from Diffie-Hellman Group to Key Exchange Method, so a non-Diffie-Hellman method such as an ML-KEM can occupy the same slot, and it allows up to seven additional key exchanges named ADDKE1 to ADDKE7. Your IKEv2 peers must both support the method you configure, so check each vendor's documentation for the transform values it accepts.

On the library side, OpenSSL 3.5.0, released 8 April 2025, added ML-KEM, ML-DSA and SLH-DSA, placed hybrid post-quantum KEM groups in the default supported groups list, and made X25519MLKEM768 and X25519 the default TLS key shares, according to its release notes. Vendor documents and tenders often name these items (the TLS group, the SSH method, the IKEv2 transform), so when you review a product, ask which specification and version each one implements, and whether it is an RFC or a draft that could still change.

How to work out which one applies to your system

This sequence tells you whether a KEM or a key exchange method is the term that governs your deployment, and which library, configuration and contract wording confirm it. Each step ends with a check you can record and show a reviewer.

  1. Find the exact term in the vendor document

    Open the vendor document, tender or security questionnaire and locate the wording used for the post-quantum mechanism. Note whether it says key encapsulation mechanism, KEM, key exchange, key agreement or a named group such as X25519MLKEM768. Where the document cites a specification, record the RFC or FIPS number it points to, for example FIPS 203 for ML-KEM or RFC 10024 for TLS hybrid groups. Done when you have a written list of each term and the defining document it cites, with the vendor's wording quoted exactly.

  2. Check the TLS, SSH or IPsec configuration

    Review the configuration on each system that terminates encryption and list the named groups or entries it actually uses. For TLS, look at the supported groups setting. For SSH, look at the key agreement algorithms. For IPsec, look for Transform Type 4 entries in the IKEv2 proposal. Record the exact names, because a standalone group such as MLKEM768 and a hybrid group such as X25519MLKEM768 are configured separately. Done when every endpoint has a recorded list of configured names, checked against the configuration files rather than the vendor summary.

  3. Inventory the cryptographic libraries in use

    Identify which cryptographic library each service links against and its exact version. Relevant markers in the sources include OpenSSL 3.5.0, released 8 April 2025, which added ML-KEM and put hybrid groups in its default list, and OpenSSH 9.9, which added mlkem768x25519-sha256, with 10.0 making it the default. Older versions may not offer these names at all. Record the version and the package source for each service. Done when you have a table of service, library and version, and you have confirmed each version against the release notes for that library.

  4. Confirm whether hybrid or standalone groups are offered

    For each named group in your configuration, check the vendor documentation to see whether it is a hybrid group that pairs ML-KEM with a classical algorithm, or a standalone ML-KEM group. The RFCs describe hybrids as combining two algorithms so the session key stays secure while one component is unbroken, and describe standalone groups as ML-KEM alone. Record which form each group takes and whether the vendor marks it as recommended. Done when every group in the inventory is labeled hybrid or standalone with a citation to the vendor page that states it.

  5. Record what the contract or customer review asks

    Read the contract, statement of work or customer security review and note any request that names a key exchange method, a KEM, a specific group or a parameter set. Record the exact clause, the date of the document and the party that asked. Where the request names a term that differs from the one in your configuration, flag it for the vendor to answer in writing rather than assuming they match. Done when each request is logged with its clause reference and each mismatch is listed as an open question for the vendor.

  6. Match the term to the working definition

    Compare the recorded terms against the definitions in the sources. A KEM is defined in FIPS 203 and in RFC 9180 as a way for two parties to agree a shared secret over a public channel, through encapsulation and decapsulation. A Diffie-Hellman style key exchange in TLS, SSH or IPsec is the protocol slot that carries the agreed secret. Decide which of these your documents describe, and mark any place where the two are used interchangeably. Done when each recorded term has one assigned meaning and a cited definition.

  7. Write up which term applies to your system

    Summarize the findings in one page: the term each document uses, the configured group names, the library versions, whether each group is hybrid or standalone, and what the contract requires. State which term applies to each system and cite the record for each claim. Flag anything the sources do not settle and send it to the vendor for confirmation. Done when the summary is signed off by the security or platform lead and attached to the migration record for the system.

Common mix-ups between KEM and key exchange

A key encapsulation mechanism and a Diffie-Hellman style key exchange both establish a shared secret, but they use different interfaces and appear in different places in a protocol. The cards below cover the confusions that most often lead to wrong assumptions about naming, versions, drafts, hybrid ordering and defaults.

Not every KEM is Diffie-Hellman

A KEM exposes key generation, encapsulation and decapsulation, while a Diffie-Hellman exchange is usually described as each party combining its private key with the other's public key. RFC 9180 shows how a Diffie-Hellman group can be wrapped as a KEM, with the sender sending an ephemeral public key as the encapsulation. FIPS 203 describes ML-KEM through the KEM interface rather than as a Diffie-Hellman style exchange. Check which interface a given component implements before assuming the two behave the same way in your design.

RFC 9180 text

ML-KEM variants are parameter sets

ML-KEM-512, ML-KEM-768 and ML-KEM-1024 are three parameter sets of one algorithm, listed in FIPS 203 in order of increasing security strength and decreasing performance. They are not three separate protocols. A TLS or SSH configuration that names one of them still runs the same ML-KEM design at a different parameter set. Confirm which set a given group or method uses, since the choice changes key and ciphertext sizes.

FIPS 203

A draft codepoint is not an RFC

draft-ietf-tls-mlkem-11 defines standalone ML-KEM groups for TLS 1.3 (MLKEM512, MLKEM768 and MLKEM1024) and is dated 17 September 2026 as an Informational document in the RFC Editor queue. A codepoint shown in a draft may change before publication. Before relying on a group identifier in a deployment, check whether the specification has been published as an RFC and whether the identifier in your implementation matches the final text.

Draft tracker

Hybrid name order is not interchangeable

RFC 10024 places the ML-KEM shared secret first in X25519MLKEM768, but places the ECDHE secret first in SecP256r1MLKEM768 and SecP384r1MLKEM1024. Because RFC 9954 concatenates the component shared secrets into the TLS 1.3 key schedule, the order is part of what each named group defines. Do not assume two hybrid names with similar components produce the same input to the key schedule.

RFC 10024 text

A library default is not a guarantee

OpenSSL 3.5.0 made X25519MLKEM768 and X25519 the default TLS key shares, and OpenSSH 10.0 made mlkem768x25519-sha256 the default key agreement. A default describes what the software negotiates when nothing else is configured. It does not show what your deployment enforces, what peers accept, or what a downgrade path allows. Check the effective configuration on each endpoint and the groups or methods actually offered in the handshake.

OpenSSL 3.5 notes

Questions people ask about KEM and key exchange

Is a KEM the same thing as a key exchange?

No, though both let two parties end up with a shared secret over a public channel. A key encapsulation mechanism (KEM) has three operations: key generation, encapsulation and decapsulation. The sender encapsulates a fresh shared secret to the recipient's public key and sends the resulting ciphertext, and the recipient decapsulates it with the private key. FIPS 203 describes ML-KEM through this KEM interface rather than as a Diffie-Hellman style exchange. A Diffie-Hellman style key exchange works by both parties contributing public values and each computing the same secret. RFC 9180 shows how a Diffie-Hellman group can be wrapped into a KEM interface, so the two terms overlap in practice. Confirm how your protocol or product defines the operation before comparing them.

Which term is newer, KEM or key exchange?

The sources do not establish a date for when either term first appeared, so this page does not rank them by age. What the sources do show is the recent standardization of the KEM interface for post-quantum algorithms: FIPS 203 was published on 13 August 2024, and NIST SP 800-227 on key-encapsulation mechanisms was finalized in September 2025. Key exchange as a protocol step is older and appears throughout earlier TLS and IKEv2 work. Recent documents tend to use KEM when describing ML-KEM specifically, and key exchange when describing protocol negotiation. Check the document you are reading to see which meaning it uses.

Do I need both a KEM and a key exchange in one system?

Often the two work together rather than competing. In TLS 1.3, RFC 10024 defines hybrid named groups such as X25519MLKEM768, which pair an ML-KEM encapsulation with an ECDHE exchange, and RFC 9954 describes concatenating the component shared secrets into the TLS 1.3 key schedule. The design therefore uses a KEM for the post-quantum part and a classical key exchange for the other part. Standalone ML-KEM groups are also defined for TLS 1.3 in draft-ietf-tls-mlkem-11, which is still in the RFC Editor queue. Whether your system needs one, the other, or both depends on the protocol and the product versions it runs, so check the group list the software negotiates.

Which one does a standard or a customer ask for?

The answer depends on the document. NIST's post-quantum standards name ML-KEM in FIPS 203, and NIST SP 800-227 gives recommendations for key-encapsulation mechanisms. A customer or auditor may ask whether a system uses an approved KEM such as ML-KEM, or whether it supports a hybrid key exchange. Protocol standards such as RFC 10024 and RFC 10042 define the named groups and methods that appear in negotiation. Read the wording of each request carefully: it may name an algorithm, a protocol group, or both. Ask the requester which parameter sets, groups and versions they mean.

What should I ask a vendor about its KEM and key exchange support?

Ask which named groups or methods the product negotiates by default, and which ones it can be configured to use. For TLS, ask whether it supports X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024 or the standalone ML-KEM groups, and which version of the library provides them. For SSH, ask whether it offers mlkem768x25519-sha256 and what the default key agreement is. For OpenSSL, the 3.5.0 release notes describe the default hybrid groups, so ask whether the vendor's build includes that release or a later one. Ask whether the ML-KEM implementation follows FIPS 203, and whether any claim about it is backed by a validation the vendor can show you.

Why does the order of secrets in a hybrid group matter?

The order affects the input to the key schedule, so two implementations that differ in order would derive different keys. RFC 10024 places the ML-KEM shared secret first in X25519MLKEM768, and places the ECDHE secret first in SecP256r1MLKEM768 and SecP384r1MLKEM1024. RFC 9954 also notes that because the components are concatenated, each algorithm must have fixed-length keys, ciphertexts and shared secrets. When you compare products, check that both sides use the same group name and that the vendor implements the ordering the RFC specifies.

How big are the messages a KEM-based handshake sends?

The sizes are set by the algorithm and the group, and RFC 10024 gives them for its hybrid groups. For X25519MLKEM768, the client key share is 1216 bytes (1184 bytes of ML-KEM-768 encapsulation key plus 32 bytes of X25519), and the server share is 1120 bytes (1088 bytes of ML-KEM-768 ciphertext plus 32 bytes of X25519). For SecP384r1MLKEM1024, each direction carries 1665 bytes. Larger key shares can matter for network devices, middleboxes and constrained links, so check the sizes your path supports. These figures come from the RFC and apply to the groups it defines.

How DeployOpen works on this

DeployOpen helps teams separate the KEM interface from the Diffie-Hellman style exchange before any protocol change is made. The work starts with the protocol and group names that appear in the environment, so the team can see which parts are encapsulation and which parts are agreement. Each step is written down so a reviewer can check it against the standard.

How we scope

  • We list every handshake and key exchange point in the environment where a KEM or DH style exchange is used.
  • The written scope names the standards each system implements, such as FIPS 203, RFC 9180 or RFC 9954, and the versions in use.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts, and ongoing support is available as a retainer.

How we build

  • We configure the named key exchange groups on each endpoint so the encapsulation and agreement steps match the chosen design.
  • We check concatenation order and fixed-length key, ciphertext and shared secret sizes against the relevant RFC for each hybrid group.
  • We test the configured handshakes in your own environment and record which group and method each connection negotiates.

How we hand over

  • You receive a document mapping each KEM or key exchange component to the system, standard and version it applies to.
  • The handover names the exact group identifiers and method names configured, so your reviewers can match them to the source text.
  • Open questions on compatibility are listed with the vendor documentation or standard that should be checked for your versions.

How we support

  • Upgrades to libraries and protocol stacks are tracked so the encapsulation and agreement settings stay consistent after updates.
  • Retesting covers the handshakes after each change, so the negotiated groups can be confirmed against the documented design.
  • Support questions are answered against the written scope, and any change to that scope is agreed in writing first.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.