ML-KEM and ECDH: what each does and why the choice matters for your key exchange
You have likely met both names in a vendor document, a TLS or SSH configuration, or an audit request. ML-KEM is a key encapsulation mechanism standardized by FIPS 203, and ECDH is an elliptic-curve Diffie-Hellman key agreement. The distinction that matters most is that ML-KEM is post-quantum while ECDH is classical. Security leads, network engineers and vendor-risk reviewers meet this question when they read a server's supported key exchange groups, decide what a hybrid group means for their estate, or answer a question about post-quantum readiness. This page reports what the listed sources say about each mechanism and does not rank either side.
The two mechanisms work differently at the protocol level. ECDH has each party contribute a public value, and both derive a shared secret from their own private value and the other party's public value. ML-KEM works as a key encapsulation mechanism with three functions: key generation, encapsulation and decapsulation. One party publishes an encapsulation key, the other encapsulates a secret against it, and only the holder of the matching decapsulation key recovers that secret. The sizes differ in practice. The sources give a 1184-byte ML-KEM-768 encapsulation key and a 1088-byte ciphertext, against 32 bytes each way for X25519. Confirm the sizes your configuration actually sends, since they affect handshake messages and any fixed-size limits in your path.
Because the sizes differ, the choice shapes what you must test. The IETF hybrid draft (RFC 10024) defines groups such as X25519MLKEM768 that combine ML-KEM with an ECDHE exchange, and a client key_share of 1216 bytes in that group compares with the 32-byte X25519 share alone. Draft-ietf-tls-mlkem-11 says implementers must weigh security, performance and operational constraints when choosing between a standalone ML-KEM group and a hybrid. Check which groups your TLS stack and SSH server offer and which one each peer negotiates, and confirm the version and build you run, because support varies. Ask your vendor to name the exact group and version they ship.
How ML-KEM-768 and ECDH with X25519 compare on the attributes the sources give
This table sets ML-KEM-768 against ECDH with X25519 on the attributes the cited sources state, including what each is, the defining document, status, size and where each is supported. Read each row against its named RFC or FIPS, since sizes apply to the stated parameter set and group only. Sizes in the table are the ones the sources give, so confirm them against your own TLS or SSH stack before planning capacity.
| Attribute | ML-KEM-768 | ECDH with X25519 |
|---|---|---|
| What it is | A key encapsulation mechanism with key generation, encapsulation and decapsulation functions (RFC 9794, FIPS 203) | A Diffie-Hellman key agreement function on Curve25519 (RFC 7748) |
| Defining document and date | FIPS 203, final standard published 13 August 2024 (NIST FIPS 203) | RFC 7748 (NIST SP 800-56A Rev. 3, April 2018, covers the broader ECDH scheme) |
| Status | Final NIST standard (FIPS 203) | Specified in an RFC; the sources list no NIST FIPS status for X25519 |
| Purpose | Two parties establish a shared secret key over a public channel (FIPS 203) | Key agreement implementing ECDH (RFC 7748) |
| Encapsulation key or public value size | 1184 bytes (draft-ietf-tls-mlkem-11) | 32 bytes (RFC 7748) |
| Ciphertext or key share size | 1088 bytes (draft-ietf-tls-mlkem-11) | 32 bytes (RFC 7748) |
| Shared secret size | 32 bytes (draft-ietf-tls-mlkem-11) | 32 bytes (RFC 7748) |
| Where it is supported | TLS 1.3 hybrid group X25519MLKEM768 (RFC 10024) and standalone ML-KEM groups in draft-ietf-tls-mlkem-11; OpenSSH hybrid mlkem768x25519-sha256 (OpenSSH PQ page) | TLS 1.3 (EC)DHE key exchange (RFC 8446), and as the X25519 component of hybrid groups (RFC 10024) and OpenSSH mlkem768x25519-sha256 (OpenSSH PQ page) |
What ML-KEM and ECDH are, and which document defines each
ML-KEM is a key encapsulation mechanism, meaning a scheme with three functions: key generation, encapsulation and decapsulation. One party publishes an encapsulation key, the other party uses it to produce a ciphertext and a shared secret, and the first party recovers that same shared secret by decapsulating the ciphertext. NIST published FIPS 203, which specifies ML-KEM for two parties to establish a shared secret key over a public channel, as a final standard on 13 August 2024. It defines three parameter sets: ML-KEM-512, ML-KEM-768 and ML-KEM-1024.
- Defining document: FIPS 203 is the reference for the algorithm itself. Engineers working from a protocol specification should still check the FIPS text for the exact parameter set being deployed.
- Where it appears in TLS: The IETF has defined standalone ML-KEM groups for TLS 1.3 in draft-ietf-tls-mlkem, which is still a draft, and RFC 10024 defines hybrid groups that combine ML-KEM with an ECDHE exchange.
- Where it appears in SSH: OpenSSH uses the hybrid mlkem768x25519-sha256, which pairs ML-KEM with X25519. It became the default in OpenSSH 10.0 (April 2025).
- Size profile: For ML-KEM-768, the encapsulation key is 1184 bytes and the ciphertext is 1088 bytes, with a 32-byte shared secret. These are larger than the 32-byte values used by X25519, so message sizes and handshake buffers can change.
- Guidance on use: NIST SP 800-227, published as final on 18 September 2025, gives recommendations for implementing and using KEMs securely.
Before relying on a configuration, confirm the exact parameter set, the protocol group identifier and the implementation version your platform actually negotiates.
ECDH is elliptic-curve Diffie-Hellman, a key agreement method in which two parties each contribute a public value and derive a shared secret from their own private value and the other party's public value. NIST SP 800-56A Rev. 3, dated April 2018, specifies key-establishment schemes based on the discrete logarithm problem over finite fields and elliptic curves, including Diffie-Hellman and MQV variations. RFC 7748 defines X25519 as the function used to implement ECDH key agreement on Curve25519.
- Defining documents: NIST SP 800-56A Rev. 3 governs the schemes for federal and NIST-aligned use, and RFC 7748 defines the X25519 and X448 functions used in IETF protocols.
- Size profile: X25519 uses 32-byte public values and produces a 32-byte shared secret, which is why it is compact in handshakes.
- Where it appears in TLS 1.3: TLS 1.3 key exchange uses (EC)DHE, PSK-only, or PSK with (EC)DHE, as set out in RFC 8446. Static RSA and static Diffie-Hellman cipher suites were removed, so an ephemeral exchange is always part of a TLS 1.3 handshake that uses one.
- Where it appears in hybrids: In RFC 10024, X25519MLKEM768 combines an X25519 component with an ML-KEM-768 component in a single TLS 1.3 key share, so ECDH is usually the classical half of a post-quantum hybrid, not a standalone choice in new deployments that require post-quantum key establishment.
- Role in SSH: X25519 is the classical component of the default OpenSSH hybrid, which means a configuration that disables the hybrid may fall back to classical-only exchanges. Check the negotiated key exchange in your own environment.
When reviewing a configuration, confirm which document each named group or function comes from and whether the implementation under review follows that document's current revision.
Four differences between ML-KEM and ECDH that change what a system must do
ML-KEM and X25519 both establish a shared secret, but they do it through different operations, with different message sizes, and under different protocol rules. Each card below names one of those differences and the check it leads to in a system or configuration.
Post-quantum versus classical protection
ML-KEM-768 is a post-quantum key encapsulation mechanism standardized in FIPS 203, while X25519 is an elliptic-curve Diffie-Hellman function defined in RFC 7748. ECDH is a classical algorithm, so a system that relies on it alone does not carry post-quantum protection. Teams should confirm which key exchange their TLS, SSH or VPN endpoints actually negotiate, because a configuration that offers only X25519 has not changed its exposure. Where both are offered, the hybrid group combines the two rather than replacing one with the other.
FIPS 203 textEncapsulate and decapsulate instead of exchange
Diffie-Hellman has each side contribute a public value and both derive the secret from the other's value. ML-KEM works differently: one party generates a key pair, the other runs encapsulation against the encapsulation key to produce a ciphertext and a shared secret, and the first party runs decapsulation on that ciphertext. Code that calls a Diffie-Hellman function therefore needs a different call sequence, and the protocol message flow must carry a ciphertext in one direction. Check every library and code path that performs the exchange, not only the handshake configuration.
NIST SP 800-227Much larger keys and ciphertexts
The ML-KEM-768 encapsulation key is 1184 bytes and its ciphertext is 1088 bytes, against 32 bytes each for an X25519 public value. In a hybrid group, RFC 10024 gives a client key share of 1216 bytes for X25519MLKEM768 and a server key share of 1120 bytes. Larger messages can change handshake sizes, fragmentation, buffer limits and packet-inspection rules on middleboxes. Load balancers and firewalls should be tested with the hybrid handshake before rollout.
RFC 10024TLS 1.3 limits where ML-KEM fits
RFC 8446 defines TLS 1.3 key exchange as (EC)DHE, PSK-only, or PSK with (EC)DHE, so ML-KEM can only enter TLS 1.3 as a named key exchange group. Because of this, adding ML-KEM is a change to the supported groups list and to the key_share handling, not a change to the cipher suite. Teams should check whether their TLS stack allows adding a group without a code change, and whether any older stacks in the path can only negotiate the existing groups. The draft defining standalone ML-KEM groups tells implementers to weigh standalone and hybrid options against their own constraints.
RFC 8446How the exchange flow differs when ML-KEM encapsulates a secret instead of Diffie-Hellman
In a Diffie-Hellman exchange, both parties generate a key pair and send their public value to the other. Each side then combines its own private value with the peer's public value to arrive at the same shared secret. The exchange is symmetric in structure: each party sends one public value and receives one, and neither side produces a secret that is transported to the other. For X25519, as defined in RFC 7748, the public value and the resulting shared secret are each 32 bytes. An engineer reviewing a TLS 1.3 or SSH handshake that uses ECDH will see a key_share carrying a single public value in each direction, with no separate ciphertext message.
A key encapsulation mechanism works differently at the level of messages. RFC 9794 defines a KEM as a scheme with three functions: key generation, encapsulation and decapsulation. The party that will receive the secret generates an encapsulation key and sends it. The sender runs the encapsulation function on that key, which yields a ciphertext to send back and a shared secret that only the sender holds until decapsulation. The receiver then runs the decapsulation function on the ciphertext with its private key to recover the same secret. For ML-KEM-768, the encapsulation key is 1184 bytes and the ciphertext is 1088 bytes, both far larger than the 32-byte X25519 values, so the handshake's message sizes change along with its structure. Confirm the exact sizes for the parameter set you deploy against FIPS 203.
The draft-ietf-tls-mlkem-11 notes that ML-KEM's IND-CCA security exceeds what ephemeral key establishment requires, and it cites formal analyses supporting the replacement of Diffie-Hellman by an IND-CCA-secure KEM. For a reviewer, the practical point is that a KEM handshake has a fixed sender and receiver role, while an ECDH handshake is symmetric. Check whether your protocol stack represents the ciphertext as a separate field, and whether the hybrid groups in RFC 10024 concatenate the two shared secrets in an order you need to match during interoperability testing. Hybrid groups add a second, traditional component to the same flow.
How a client and server reach a shared secret with ML-KEM and with ECDH
The diagram sets the two exchanges side by side between a client and a server. In the ECDH branch, each side sends a 32-byte X25519 public value and both derive the same shared secret, which RFC 7748 specifies as 32 bytes. In the ML-KEM branch, the client sends a 1184-byte ML-KEM-768 encapsulation key, the server returns a 1088-byte ciphertext, and both hold the 32-byte shared secret. Check the sizes against the version and parameter set you run, since the hybrid groups in RFC 10024 carry these values combined with X25519.
Client and server exchange X25519 public values or an ML-KEM-768 encapsulation key and ciphertext.
Where ML-KEM and ECDH appear in TLS 1.3, SSH and vendor documents
Engineers mostly meet ML-KEM and ECDH inside protocol specifications and product documentation rather than in cryptographic standards alone. In TLS 1.3, classical ECDH appears as the (EC)DHE key exchange that the protocol requires, while RFC 8446 removed static RSA and static Diffie-Hellman cipher suites. RFC 10024 defines three hybrid groups that pair ML-KEM with an ECDHE exchange: X25519MLKEM768 (code point 0x11EC, marked Recommended), SecP256r1MLKEM768 (0x11EB) and SecP384r1MLKEM1024 (0x11ED), with the latter two not marked Recommended. Draft-ietf-tls-mlkem-11 separately defines standalone ML-KEM groups and asks implementers to weigh security, performance and operational constraints before choosing standalone ML-KEM over a hybrid. Confirm which group names and code points your TLS stack negotiates, since draft status and RFC status differ.
In SSH, the OpenSSH project lists mlkem768x25519-sha256 as a hybrid of ML-KEM and X25519. Per the OpenSSH post-quantum page, it was added in version 9.9 and became the default in version 10.0, released in April 2025. Earlier OpenSSH releases offered sntrup761x25519-sha512 from version 9.0 (April 2022), which is a different lattice KEM. Check the output of ssh -Q kex on each host and the KexAlgorithms setting in sshd_config and ssh_config, because a build older than 9.9 will not offer the ML-KEM hybrid and a configuration override can remove it even on newer builds.
Classical ECDH is defined in two places that vendor documents often cite. NIST SP 800-56A Rev. 3 (April 2018) specifies discrete-logarithm key-establishment schemes over finite fields and elliptic curves, including Diffie-Hellman and MQV variations. RFC 7748 defines X25519 and X448 as the Diffie-Hellman functions used in many protocols, with 32-byte public values and a 32-byte shared secret for X25519. When a vendor says a product uses ECDH, ask which curve, which document it follows and whether the implementation is validated under the relevant NIST program, since the RFC and the SP describe different scopes.
How to work out whether ML-KEM, ECDH or the hybrid applies to your systems
This sequence establishes which key exchange group each of your TLS and SSH endpoints negotiates, and which standards or vendor documents name the group each one uses. The result is a checked record of whether a system runs ECDH alone, ML-KEM alone or a hybrid of the two, and which version confirms it.
Identify requirements that name a standard
Collect the contracts, policies, federal customer requirements and internal standards that refer to a specific key exchange standard or group, such as FIPS 203, RFC 10024 or a named hybrid. Record each clause that names a group or algorithm, along with the system it covers. The output is a list of requirements that state which key exchange is expected, and a note of any that name only a general goal without a specific group.
Inventory TLS and SSH key exchange endpoints
List every TLS and SSH endpoint your organization runs, including load balancers, reverse proxies, VPN concentrators, file transfer services and internal APIs. For each one, record the owning team, the software and its version, and the protocol versions it accepts. The output is a complete endpoint register, so later steps have a defined set of systems to check.
Read vendor documentation for each named group
For each software product and version in the inventory, read the vendor's documentation to see which key exchange groups it offers and which it negotiates by default. Note whether the vendor lists a hybrid such as X25519MLKEM768 or mlkem768x25519-sha256, a standalone ML-KEM group, or only classical ECDHE groups. The output is one entry per product and version that states the group names the vendor documents.
Check configuration for group names and code points
On each endpoint, inspect the configuration that controls key exchange, such as supported groups or key exchange algorithm lists, and record the exact group names and code points in use. Compare the entries with the names defined in the relevant RFC or the OpenSSH documentation. The output is a configuration record per endpoint that lists the active groups and any that are disabled.
Confirm the negotiated group in a live handshake
Where your tooling allows, open a test connection to each endpoint and record the key exchange group the server actually selects with a supported client version. This confirms what a configuration file allows compared with what is negotiated in practice. The output is a log of negotiated groups per endpoint, dated and tied to the client and server versions used.
Match each system to a requirement
Set each endpoint's negotiated group against the requirements gathered in the first step, and mark whether it runs ECDH alone, ML-KEM alone or a hybrid. Flag any system where the requirement and the negotiated group do not match, and any system with no requirement that names a group. The output is a reviewed table linking each system to the group it uses and the requirement it is checked against.
Confirm compatibility with each vendor
Send each vendor the product name, version and configuration you recorded, and ask them to confirm that the named group works with the clients and peers you run. Ask them to state the versions in which the group is supported and any known interoperability limits. The output is written vendor confirmation for each product and version, filed with the inventory record.
Questions people ask about ML-KEM and ECDH
Are ML-KEM and ECDH the same thing?
No. ML-KEM is a key encapsulation mechanism (KEM) standardized by NIST in FIPS 203, published as a final standard on 13 August 2024, with three parameter sets: ML-KEM-512, ML-KEM-768 and ML-KEM-1024. ECDH is a key agreement scheme, covered in NIST SP 800-56A Rev. 3, which both parties run to derive a shared secret from elliptic-curve values. The two work differently: in ECDH each side contributes a public value and both compute the same secret, while in a KEM one side encapsulates a secret to the other side's encapsulation key and the other side decapsulates it. Their sizes also differ. For ML-KEM-768 the encapsulation key is 1184 bytes and the ciphertext is 1088 bytes, against 32 bytes each way for X25519. Confirm which mechanism a given product uses by checking its key exchange group names in its configuration or documentation.
Which one is newer, and which one does a rule or customer ask for?
ECDH is the older of the two and is defined in classical standards such as NIST SP 800-56A Rev. 3, which dates from April 2018. ML-KEM is the newer design, standardized in FIPS 203 in August 2024. The sources listed on this page do not say that any rule or customer requires one by name, so check the specific requirement in the document you are working from. Customers and frameworks that ask about post-quantum readiness usually ask whether a post-quantum KEM is supported, and whether it is used alone or combined with a classical exchange. Read the requirement's exact wording before deciding which group to enable.
Do I need both ML-KEM and ECDH, and what do the hybrid groups do?
A hybrid group runs both components in one exchange and combines their secrets, so the session stays protected if one component is broken. RFC 10024, a Proposed Standard dated August 2026, defines three TLS 1.3 hybrid groups that combine ML-KEM with an ECDHE exchange: X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024. The draft for standalone ML-KEM groups, draft-ietf-tls-mlkem-11, says implementers must weigh security, performance and operational constraints when choosing between standalone ML-KEM and a hybrid. Hybrids cost more bytes on the wire. For X25519MLKEM768, the client key share is 1216 bytes and the server key share is 1120 bytes. Whether you need the classical component depends on your policy and your peers' support, so confirm that with the relevant standard and your own risk owner.
Can X25519 and ML-KEM-768 be combined in one key exchange?
Yes. X25519MLKEM768 is the TLS 1.3 hybrid group that does this, and RFC 10024 defines it with code point 4588 (0x11EC) and marks it as Recommended. Its key shares are built from ML-KEM-768 values concatenated with X25519 values. In RFC 10024 the ML-KEM shared secret comes first in the combined secret, a choice the RFC says was made for FIPS reasons so that the first component's implementation must be certified. OpenSSH uses the same idea in its hybrid mlkem768x25519-sha256, which became the default in OpenSSH 10.0 (April 2025). Check that both client and server list the group name you expect, since a mismatch will fall back or fail.
What should I ask a vendor about the key exchange groups they support?
Ask for a list of the exact key exchange group names they support, the protocol version each one is used with, and whether each group is standalone or hybrid. For TLS, ask whether they support the groups defined in RFC 10024, such as X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024, and whether those are enabled by default. For SSH, ask whether mlkem768x25519-sha256 is available and at which version. Ask which version and build contains the support, and whether it is on by default or must be enabled in configuration. Request the configuration keys or documentation pages that control these settings, and ask what the vendor's disclosed test or certification results cover, if any. The answers should be specific to the version you run.
How much does it cost to move from ECDH to ML-KEM?
The sources listed on this page do not give a cost figure for this change, so treat any number you see with caution and ask for its source. The main cost components are the time your engineers spend inventorying where key exchange happens, enabling and testing new groups, and handling the larger key shares, which can affect bandwidth, latency and any device or middlebox that inspects handshakes. Costs recur when you must keep up with new versions of libraries and protocols. A quote from any provider, DeployOpen included, should list the scope, the systems covered, who does the testing and what evidence is delivered. We do not estimate prices here, and a written scope is the basis for a quote.
Can my team do this migration without outside help?
Many teams can make the change internally if they have the right people and a clear inventory. The work involves finding every place key exchange occurs, checking which libraries and versions support the target groups, enabling them in a test environment, and confirming that peers can negotiate them. The RFCs and NIST documents linked on this page are the primary references for that work. Teams without experience in TLS or SSH configuration, or with many systems to change, often bring in outside help for scope, testing and evidence. Your decision depends on your staffing, change process and the systems involved, so assess those first.
How DeployOpen works on this
DeployOpen works on ML-KEM vs ECDH by first mapping where your systems perform key exchange, then testing and configuring the hybrid or standalone groups your protocols support. Each engagement is fixed-scope, with the deliverables and timeline agreed in writing before work starts.
How we scope
- We inventory the protocols and services in your environment that negotiate ECDH or ML-KEM key exchange today.
- We agree in writing which key exchange groups and versions each system must support, including hybrid and standalone options.
- We confirm with you which client and server software versions are in use, since support for specific groups varies by release.
How we build
- We configure key exchange groups such as X25519MLKEM768 in TLS and mlkem768x25519-sha256 in SSH, where your versions support them.
- We check key share sizes against your network path and load balancers, since ML-KEM-768 values are much larger than X25519 values.
- We test negotiation fallback paths so that clients without post-quantum support still connect as your policy allows.
How we hand over
- We document the configured groups, cipher settings and the reasons each system uses a hybrid or standalone group.
- We provide test results showing which handshakes negotiate ML-KEM and which fall back, with the evidence needed for review.
- We record any systems that cannot be upgraded so your team can plan isolation or replacement with clear ownership.
How we support
- Ongoing support is available as a retainer, covering upgrades when new versions change how key exchange groups are negotiated.
- We can retest after software upgrades to confirm that negotiated groups and fallback behavior still match your documented policy.
- We can review draft standards and vendor updates as they change, so your documentation stays aligned with what your systems do.

