Key encapsulation vs key wrapping: two ways to move a key

Key encapsulation produces a fresh shared secret from a recipient's public key, while key wrapping protects an existing key with another key. Architects and reviewers meet both in the same protocols, and RFC 9629 combines them.

On this page

Why key encapsulation and key wrapping get confused

A vendor document, a standard or a tender may name both key encapsulation and key wrapping in the same sentence, and it is easy to assume they are the same operation. They are not. Key encapsulation creates a fresh shared secret and its encapsulation from a recipient's public key, while key wrapping protects an existing key under another key. The key distinction is whether a new secret is created: an encapsulation mechanism produces one, and a key wrap takes a key that already exists and encrypts it. Reviewers often meet the question when a product claims post-quantum protection and the document does not say which of the two operations it uses.

Architects, security reviewers, PKI engineers and protocol engineers are the people most likely to meet this question, usually when reading a design or checking a claim against a specification. The terms appear in different places. NIST SP 800-38F defines key wrap methods such as KW and KWP, which protect keys under an AES key-encryption key. RFC 3394 specifies the AES Key Wrap algorithm itself. RFC 9180 defines a KEM's Encap and Decap operations, which produce and recover a shared secret. RFC 9629 combines both techniques: a KEM establishes a pairwise secret, and a key-wrap algorithm named in the wrap field protects the content-encryption key.

When a document names both, ask which operation produces the key that protects the data, and whether a new secret is generated for each recipient. Confirm the exact standard and section the vendor relies on, and check whether the key-wrap portion depends on a mode that a pending revision may change. The sources listed here do not say which vendor products implement which combination, so that should be confirmed directly with the vendor and tested in the reader's own environment.

Key encapsulation and key wrapping side by side

This table compares key encapsulation (KEM) and key wrapping on what each does, the document that defines it, its status and its inputs and outputs. Read each row across the two columns, since the two mechanisms are defined in separate documents and are not interchangeable. The main takeaway is that wrapping protects an existing key with another key, while encapsulation creates a new shared secret for a recipient from a public key.

AttributeKey encapsulation (KEM)Key wrapping
What it doesLets two parties establish a shared secret over a public channel from the recipient's public keyProtects an existing key by encrypting it under another key with integrity checking
Defining documentsFIPS 203 (ML-KEM), NIST SP 800-227, RFC 9180 (HPKE)NIST SP 800-38F, RFC 3394 (AES Key Wrap)
Document dateFIPS 203 published 13 August 2024; SP 800-227 finalized September 2025; RFC 9180 February 2022SP 800-38F December 2012; RFC 3394 September 2002
StatusFIPS 203 and SP 800-227 are NIST standards; RFC 9180 is InformationalSP 800-38F is under revision (comments closed 10 July 2026); RFC 3394 is Informational
InputsRecipient's public keyA key-encryption key of 128, 192 or 256 bits and the key data to wrap
OutputsA fresh shared secret and an encapsulation of itWrapped key data, with integrity checked on unwrap
Key sizes (where given)ML-KEM-768 encapsulation key 1184 bytes and ciphertext 1088 bytes (RFC 10024)RFC 3394 key-encryption key lengths of 128, 192 or 256 bits
Integrity checkNot described as a wrapping step; the shared secret is derived through the KEMRecovered value is compared with a default initial value on unwrap, and no key is returned if it fails
Where supportedTLS 1.3 hybrid groups such as X25519MLKEM768 (RFC 10024); HPKE (RFC 9180)CMS key wrap in RFC 9629 with a key-wrap algorithm named in the wrap field; NIST-approved modes KW, KWP and TKW

What each one is and where practitioners meet it

A key encapsulation mechanism (KEM) lets one party send a fresh shared secret to a recipient who holds a public key. NIST SP 800-227, Recommendations for Key-Encapsulation Mechanisms, finalized in September 2025 (18 September 2025 on the NIST page), describes a KEM as a way for two parties to establish a shared secret key over a public channel for use with symmetric-key algorithms. In RFC 9180 (HPKE, February 2022, Informational, from the IRTF CFRG), a KEM provides Encap(pkR), which produces a fresh shared secret and an encapsulation of it, and Decap(enc, skR), which recovers the shared secret from the encapsulation using the private key. FIPS 203 standardizes ML-KEM, published on 13 August 2024, with three parameter sets named ML-KEM-512, ML-KEM-768 and ML-KEM-1024, listed in order of increasing security strength and decreasing performance.

  • Where it is met in ML-KEM parameter sets: FIPS 203 defines the parameter sets, and a reviewer choosing one should read the parameter table in that document rather than assume a level from the name alone.
  • Where it is met in TLS hybrid groups: RFC 10024 (August 2026, Standards Track, formerly draft-ietf-tls-ecdhe-mlkem) defines X25519MLKEM768 (4588, 0x11EC, Recommended Y), SecP256r1MLKEM768 (4587, 0x11EB, Recommended N) and SecP384r1MLKEM1024 (4589, 0x11ED, Recommended N) as TLS 1.3 named groups.
  • Message sizes: RFC 10024 gives the X25519MLKEM768 client key share as 1216 bytes (1184 ML-KEM-768 encapsulation key plus 32 X25519) and the server share as 1120 bytes (1088 ML-KEM-768 ciphertext plus 32 X25519). SecP384r1MLKEM1024 shares are 1665 bytes each way.
  • Hybrid purpose: RFC 9954 (July 2026, Informational) describes hybrid key exchange as using multiple algorithms together so the session key stays secure while at least one component is unbroken, motivated by the possibility that recorded traffic could be decrypted later.
  • Protocol context: RFC 9846 (TLS 1.3, July 2026, Standards Track) obsoletes RFC 8446 along with RFCs 5077, 5246, 6961, 7627 and 8422.

Before relying on a group name, confirm in your TLS stack's documentation and the RFC text which groups and versions your library and peers actually negotiate.

Which differences matter in practice

Encapsulation and key wrapping both move a key from one party to another, but they start from different inputs and leave different results behind. The cards below set out the consequences that affect design, review and storage decisions.

A fresh secret per recipient

A KEM's Encap takes only the recipient's public key and produces a new shared secret along with its encapsulation. RFC 9629 requires that each recipient receive a fresh KEM shared secret and says both sides discard it after use. Reviewers should confirm that implementations generate a new secret for every recipient instead of reusing one across a set of recipients.

RFC 9629 text

Protecting an existing key or agreeing a new one

Key wrapping protects a key that already exists, such as a content-encryption key that must be carried to a recipient. A KEM establishes a new shared secret that the two parties then use as a key. Architects should identify which of the two cases applies to each key in the design, because it determines whether the key material was generated before the exchange or during it.

RFC 9180 text

Inputs each method needs

Encapsulation needs only the recipient's public key. Wrapping needs an existing key-encryption key, which must already be shared or derived before the wrap can take place. Teams planning key distribution should list the key material each side holds before the exchange, because wrapping adds a dependency on that prior secret.

How integrity is checked

RFC 3394 checks integrity by comparing the recovered value with the default initial value A6A6A6A6A6A6A6A6, and returns no key data when the two do not match. NIST SP 800-38F describes KW and KWP as authenticated-encryption modes. Reviewers should confirm which check their implementation performs and whether a failed check is reported clearly to the caller.

RFC 3394 text

Size and parameter rules

RFC 3394 accepts key-encryption keys of 128, 192 or 256 bits and wraps data in 64-bit blocks, with at least two blocks. ML-KEM is standardized with three parameter sets, ML-KEM-512, ML-KEM-768 and ML-KEM-1024, and the sizes of encapsulation keys and ciphertexts depend on the set chosen. Teams should record which sizes their protocols and storage must accommodate.

FIPS 203 text

One session or stored data

A KEM output is normally used to protect a single session, and both sides discard the shared secret after use. A wrapped key may be stored, backed up or sent later, so it needs key lifecycle controls such as retention and access rules. Security teams should decide whether each use is for one session or for data at rest before choosing a method.

Where each shows up in protocols, libraries and vendor documents

Key encapsulation and key wrapping both move a key from one party to another, but they appear in different standards and product documents. A key encapsulation mechanism (KEM) is standardized as ML-KEM in FIPS 203, with parameter sets ML-KEM-512, ML-KEM-768 and ML-KEM-1024. It is used in protocols such as HPKE in RFC 9180, where Encap takes only the recipient's public key and returns a fresh shared secret and its encapsulation. In TLS 1.3, RFC 10024 defines hybrid named groups that combine ML-KEM with a classical key exchange, including X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024. Key wrapping appears in SP 800-38F, which specifies KW, KWP and TKW, and in RFC 3394, which defines the AES Key Wrap algorithm. RFC 9629 combines both techniques: a KEM produces a pairwise secret, and a key-wrap algorithm named in the wrap field protects the content-encryption key.

Vendor documents, tenders and audit requests do not always use these names consistently. A product may describe a post-quantum feature as "key encapsulation" when it is really a hybrid TLS group, or describe a wrapping scheme as "post-quantum" when the wrapping is only AES-based. Do not rely on the label alone. Ask the vendor which standard the feature implements, and check the configuration keys, the TLS group name negotiated in the handshake, the library version and the module's documented mechanism. For example, confirm whether a TLS endpoint offers X25519MLKEM768 in its supported groups, and whether a key-management product uses KW or KWP from SP 800-38F. The sources on this page do not say which products implement which mechanisms, so verify that against each product's own documentation and version.

How the two steps combine in one message

The diagram starts at the recipient's public key, which feeds KEM Encapsulate. That call produces a fresh pairwise shared secret and its encapsulation, which is sent in the kemct field. A KDF then turns the shared secret into a key-encryption key of the length set by kekLength. A key-wrap algorithm named in the wrap field uses that key to protect the content-encryption key, which is carried in encryptedKey. Check that each recipient gets its own fresh shared secret, and that both sides discard it after use.

How a KEM and a key-wrap algorithm combine in one KEMRecipientInfo, per RFC 9629.

Whether the two are used together or one replaces the other

Key encapsulation and key wrapping are not alternatives in RFC 9629. The standard uses both in one structure. KEM Encapsulate produces a fresh pairwise shared secret for each recipient, a KDF turns that secret into a key-encryption key (KEK), and a key-wrap algorithm named in the wrap field uses that KEK to protect the content-encryption key. The fields a reviewer should check are kem, kemct, kdf, kekLength, the optional ukm, wrap and encryptedKey. kemct carries the encapsulation, kekLength states the size of the KEK derived from the secret, and wrap names the key-wrap algorithm used for encryptedKey. RFC 9629 also requires a fresh KEM shared secret for each recipient and says both sides discard it after use. A design review should confirm that each recipient gets its own encapsulation and that the implementation discards the shared secret. Check these against the RFC text and the library you deploy, since the sources listed here do not describe how individual products implement them.

On the key-wrap side, the relevant standard is NIST SP 800-38F, which approves KW, KWP and TKW. NIST announced a pre-draft call on 5 May 2026 to revise SP 800-38F in a way that would remove TKW, because TDEA is no longer approved, with comments closing on 10 July 2026. Teams that rely on TKW for legacy key storage should note this change and plan a replacement among the approved modes, and they should confirm the final revision text once NIST publishes it. The same notice says SP 800-38F section 3.1 approves unspecified pairings of an encryption mode with an authentication method and that NIST wants to revisit them, so any configuration that depends on those pairings is also exposed to the revision.

The sources do not say that KEM replaces key wrapping. RFC 9629 keeps a key-wrap algorithm in the structure, and the KEM supplies only the key material for the KEK. Anyone who reads that a KEM can move a key should check whether the design still needs a wrap step for the content key, and should not assume the wrap can be dropped. When reviewing a vendor claim that its product uses KEM for key transport, ask which fields of the recipient structure it fills, which wrap algorithm it names, and what it does with the shared secret after use. The answers tell you whether the product follows the RFC 9629 pattern or handles the key in a different way that the sources listed here do not cover.

How to work out which one applies to your system

This sequence establishes whether a named mechanism in your system is a key encapsulation mechanism, a key wrap, or both, and records the exact algorithm, version and key lengths that a tender response or audit must state. Each step produces evidence you can check against the vendor documentation and your own environment.

  1. Check the requirement or contract for the named mechanism

    Start with the requirement, tender or contract that names the mechanism, such as a KEM, a key wrap, or a specific mode like KW or KWP. Record the exact term used and any standard it cites, for example NIST SP 800-38F for key wrapping or FIPS 203 for ML-KEM. The step is complete when you have written down the wording the requirement uses, so you know which of the two functions it is asking about. Where the requirement names only a general term such as quantum-safe, record that wording as it stands and flag it for clarification rather than assuming a meaning.

  2. Check the inventory for KEM and key wrap use

    Review your cryptographic inventory and mark each place a key is moved between parties or stored under another key. Separate the entries where a sender uses a recipient's public key to produce a fresh shared secret (a KEM, as in RFC 9180) from those where a key-encryption key protects a content-encryption key (a key wrap, as in RFC 3394). Some systems use both together, as RFC 9629 describes for CMS. The step is complete when each inventory row is labeled as KEM, wrap, both, or unclear, with the owning component named.

  3. Read vendor documentation for the exact algorithm and version

    For each labeled entry, read the vendor's documentation for the algorithm name, parameter set and software version in use. Confirm whether a named group such as ML-KEM-768 or an AES key wrap uses a 128, 192 or 256-bit key-encryption key. Note the edition and release, since support can differ between versions. Where the documentation is silent on a point, record that gap instead of inferring it. The step is complete when each entry has an algorithm, parameter set and version recorded with a link or document reference.

  4. Check TLS or CMS configuration for hybrid groups or wrap fields

    Inspect the live configuration of the components that terminate or produce these exchanges. For TLS 1.3, look for hybrid named groups in the supported and preferred group lists, such as X25519MLKEM768 as defined in RFC 10024. For CMS, look for KEMRecipientInfo structures and the wrap field that identifies the key-wrap algorithm. Export or capture the relevant settings with the tool your team already uses. The step is complete when each configured group or wrap field is recorded against the inventory entry it belongs to, and any mismatch with the vendor documentation is noted.

  5. Confirm parameters and key-encryption key length locally

    Before you answer a tender or audit question, verify the parameter set and key-encryption key length in your own environment rather than relying on a document alone. Check that the observed ML-KEM variant and the wrap key length match what you recorded in the earlier steps, and that the key sizes are consistent with the values in the cited specification. Where you find a difference, resolve it with the vendor before stating a compliance position. The step is complete when your environment check matches your records, and any remaining difference has an owner and an open ticket.

Common mix-ups between the two names

Key encapsulation and key wrapping both end with a key that the receiver can use, which is why they get conflated in vendor documents and design reviews. The cards below separate the cases where the two names are mixed up and say what to check in each.

A KEM is not a wrap

Both a KEM ciphertext and a wrapped key look like opaque bytes, so reviewers often call a KEM a wrap. Encap takes only the recipient's public key and produces a fresh shared secret together with its encapsulation, so no existing key is being protected. When you review a design, ask what key is being protected and where it came from. If a KEM output is used as a key-encryption key, the wrap step still belongs to a separate algorithm such as AES Key Wrap.

RFC 9180 text

ML-KEM-768 is not a 128-bit key

ML-KEM-768 is a parameter set of the key-encapsulation mechanism in FIPS 203. A 128-bit key-encryption key belongs to a key wrap such as AES Key Wrap, which accepts 128, 192 or 256-bit keys. The two appear together in RFC 9629, where a KEM produces a secret that a KDF turns into the key-encryption key, but neither value implies the other. Check each parameter on its own line in the design rather than reading one as the other.

FIPS 203 text

TKW is under revision

NIST SP 800-38F describes TKW as a TDEA-based mode included for legacy applications. NIST announced on 5 May 2026 a pre-draft call for comments on revising the publication to remove TKW because TDEA is no longer approved, with comments closing on 10 July 2026. Do not treat TKW as a current choice for new designs, and confirm the status of any existing use against the latest NIST notice.

NIST revision notice

Key wrap support is not KEM support

A product that lists AES Key Wrap, KWP or a KDF in its key management features has not thereby added post-quantum key encapsulation. Key wrap protects a key that already exists, while a KEM establishes a new shared secret over a public channel. Ask the vendor which named operations it supports, such as ML-KEM encapsulation in a protocol group, and whether those operations are present in the version you run.

Sizes belong to one parameter set

Byte sizes depend on the parameter set, so figures from one set cannot be read as applying to another. RFC 10024 gives ML-KEM-768 encapsulation keys of 1184 bytes and ciphertexts of 1088 bytes, while SecP384r1MLKEM1024 key shares run to 1665 bytes in each direction. When sizing a handshake or a KEM-based key transport, take the figures for the exact set and group you deploy, and confirm them against the specification for your version.

RFC 10024 text

Questions readers ask about key encapsulation and key wrapping

Are key encapsulation and key wrapping the same thing?

No. They solve different problems. A key encapsulation mechanism (KEM) lets two parties establish a shared secret over a public channel: according to NIST SP 800-227, it is a way for two parties to establish a shared secret key over a public channel for use with symmetric-key algorithms. In RFC 9180, the sender's Encap call produces a fresh shared secret and an encapsulation of it using only the recipient's public key. Key wrapping, by contrast, protects a key that already exists by encrypting it under another key. NIST SP 800-38F describes its approved methods (KW, KWP and TKW) as protecting the confidentiality and integrity of cryptographic keys. One creates a new secret; the other protects a secret you already hold.

Which one is newer, and which one does NIST standardize?

Key wrapping is the older technique. NIST SP 800-38F, published in December 2012, specifies KW, KWP and TKW, and RFC 3394 (September 2002) specifies the AES Key Wrap algorithm. NIST's post-quantum KEM standard is FIPS 203, which standardizes ML-KEM and is listed as published on 13 August 2024. NIST SP 800-227, Recommendations for Key-Encapsulation Mechanisms, was finalized in September 2025. So NIST standardizes both techniques, but the KEM standards are the newer of the two. Note that NIST announced on 5 May 2026 a pre-draft call for comments on revising SP 800-38F to remove TKW because TDEA is no longer approved, with comments closing on 10 July 2026. Confirm the current revision status on the NIST publication pages before citing it.

Does a rule or customer require one of them specifically?

The sources listed on this page do not show a general rule or regulation that requires either technique by name for commercial organizations. The NSA's CNSA 2.0 requirements apply to national security systems, and a commercial organization may meet them only through a contract with a federal customer. Ask the customer or regulator which technique their control language refers to, and whether it names a specific standard such as SP 800-38F or FIPS 203, before assuming either is mandatory. Your own contract or tender language is the authoritative source for any requirement that applies to you.

Does a system need both key encapsulation and key wrapping?

Not always, but many designs use both. RFC 9629 combines them directly: a KEM Encapsulate step gives a pairwise shared secret, a key derivation function turns that secret into a key-encryption key, and a key-wrap algorithm named in the wrap field protects the content-encryption key. Its KEMRecipientInfo structure carries the kem, kemct, kdf, kekLength, optional ukm, wrap and encryptedKey fields. The KEM supplies the fresh, per-recipient secret, and the wrap protects the key that will encrypt the content. If your system only needs to agree on a session key, a KEM alone may be enough. If it must store or transport an existing key under a key-encryption key, wrapping is the relevant technique.

How do key encapsulation and key wrapping differ in what each one protects?

A KEM protects the establishment of a new shared secret, which is then used to derive symmetric keys. Key wrapping protects a key that already exists so it can be moved or stored. RFC 9629 requires a fresh KEM shared secret for each recipient and says both sides discard it after use. Wrapping keeps the same key but changes how it is encrypted for transport. In practice a KEM answers 'how do we agree on a key,' and wrapping answers 'how do we protect this key while it is stored or moved.' Check the specific use in your design, because some protocols combine them as in RFC 9629.

What should I ask a vendor about key encapsulation and key wrapping?

Ask which technique each component uses and for which purpose. Specifically ask:

  • Whether the product uses a KEM (for example ML-KEM under FIPS 203) to establish session secrets, and which parameter set it runs, such as ML-KEM-768 or ML-KEM-1024.
  • Whether key-wrapping modes are used to protect stored or transported keys, and whether they are KW, KWP or TKW under SP 800-38F.
  • Whether TKW or TDEA is still present, given the 2026 revision notice on removing TKW.
  • How the vendor handles fresh per-recipient secrets and their disposal, as described in RFC 9629.

Ask for the version numbers and the standards clauses that apply to each feature, and confirm them against the vendor's own documentation.

Where do key encapsulation and key wrapping appear in TLS and similar protocols?

In TLS 1.3 hybrid key exchange, post-quantum KEM material appears as part of the key share. RFC 10024 defines hybrid named groups such as X25519MLKEM768 and SecP384r1MLKEM1024. 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 ciphertext plus 32 bytes of X25519). RFC 9954 describes hybrid key exchange as using multiple algorithms together so the session key stays secure while at least one component is unbroken. Key wrapping is not the mechanism that carries the TLS handshake. Confirm the exact group names and sizes against RFC 10024 for the version you run.

How DeployOpen works on this

DeployOpen starts by confirming which of the two operations a given system performs, since a KEM establishes a fresh shared secret while key wrapping protects an existing key. We then build and test the configuration against the scope agreed in writing, and document the result for architecture and security reviewers.

How we scope

  • We list every place in your environment where a key is encapsulated or wrapped, including protocols and file formats.
  • We record which algorithm, key wrap mode or KEM parameter set each system uses, with versions confirmed in your environment.
  • Engagements are fixed-scope, so deliverables and timelines for this review are agreed in writing before work starts.

How we build

  • We configure systems so each recipient receives a fresh KEM shared secret, following the handling described in RFC 9629.
  • We check key wrap usage against the modes named in NIST SP 800-38F and confirm which ones your chosen libraries support.
  • We test integrity failure behavior, confirming that a wrapped key which fails its integrity check is rejected rather than used.

How we hand over

  • You receive a written record of each encapsulation and wrapping path, with the standard and version each one follows.
  • The record notes where NIST has announced pending revisions, so your team knows which settings may change later.
  • We walk your architects and reviewers through the findings so they can check the design against their own requirements.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after the initial review is complete.
  • We retest affected configurations when libraries are upgraded or when the relevant standards change.
  • Ask any implementation partner to confirm compatibility for the exact versions you run before relying on a setting.

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.