What is key wrapping in cryptography?

Key wrapping encrypts one cryptographic key with another for storage or transport. This page covers the standards that define it, where practitioners meet it, and what it means for a post-quantum migration.

On this page

What key wrapping is and who meets it

You are likely meeting the term key wrapping in a vendor document, a tender response, or an audit request that asks how a platform protects its keys. In the first two sentences, key wrapping means encrypting one key with another key, called a key-encryption key (KEK), so that the first key can be stored or transported safely. NIST's glossary defines key wrapping as a method of cryptographically protecting keys using a symmetric key, providing both confidentiality and integrity protection. The defining technical document is RFC 3394, the AES Key Wrap Algorithm, dated September 2002 with Informational status, and it is the reference most vendors cite when they describe a wrapped key.

Practitioners meet the term in several places: in cloud key management documentation, where a data encryption key is wrapped by a KEK held in the service; in bring-your-own-key and key import procedures, where the vendor describes how customer key material is protected in transit and re-protected on arrival; in NIST SP 800-38F, which specifies the AES Key Wrap and padded variants used in federal and commercial systems; and in newer specifications such as RFC 9629, which describes how a key-encryption key derived from a key encapsulation mechanism can wrap a content key. Each of these documents uses the term to mean the same basic operation, so a question about whether a key is wrapped is a question about the specific mechanism and where its KEK lives.

When you review a vendor answer, confirm which wrapping algorithm and KEK size the product uses, where the KEK is held, and whether the source key material can be exported in wrapped form at all, since some hardware security module settings disable that by default. Ask whether any wrapping mechanism in the product depends on a symmetric or public-key primitive that your post-quantum migration plan will need to replace, and check the vendor's current documentation for the version you run.

Names and variants used in standards and products

This table lists the names, abbreviations and defining documents for key wrapping modes and related identifiers you will see in standards, product documentation and protocol specifications. Read each row as the name you will meet, what it refers to and where it is defined, then check the variant your product actually uses. Several of these names look similar but are not interchangeable, so confirm the exact mode before comparing configurations.

Name or termWhat it refers toWhere it is defined
KW (AES Key Wrap)The AES-based key wrap algorithm that protects key data in 64-bit blocks, with a default initial value and a requirement for at least two blocks.RFC 3394 and NIST SP 800-38F
KWP (AES Key Wrap With Padding)The padded variant of AES key wrapping that removes the requirement that the wrapped key be a multiple of 64 bits. Padded and unpadded output cannot be unwrapped interchangeably.RFC 5649 and NIST SP 800-38F
id-aes128-wrap-padAn algorithm identifier from RFC 5649 for AES-128 key wrapping with padding, with the parameter field absent. Identifiers exist for each KEK size.RFC 5649
TKW (TDEA Key Wrap)A legacy key wrap mode that uses TDEA as the block cipher and is intended for legacy applications. NIST's 2026 draft proposes removing it because TDEA is no longer approved.NIST SP 800-38F, with the removal proposed in the SP 800-38F Rev. 1 initial preliminary draft
KEK (key-encryption key)The key used to wrap another key. In RFC 9629 the KEK is derived from a KEM shared secret and then wraps the content key.Used across RFC 3394, RFC 5649 and RFC 9629
id-ori-kem (KEMRecipientInfo)The identifier for the KEMRecipientInfo recipient type, which lets CMS carry a content key wrapped under a KEK derived from a KEM. The wrap algorithm is included in the KDF input.RFC 9629, which updates RFC 5652

Where key wrapping shows up in systems and vendor documents

Key wrapping appears wherever one key must be stored or moved under the protection of another. The cards below cover the places a reader is most likely to meet the term, with the document that describes each one. Check the cited document for the parameters your deployment uses.

Cloud KMS envelope encryption

Google Cloud KMS describes a data encryption key (DEK) encrypted by a key encryption key (KEK) as wrapped. The KEK stays inside the key service, and decryption sends the wrapped DEK to the service to be unwrapped. The vendor documentation states that a plaintext DEK must not be stored. For a key wrapping reader, this is the most common everyday use: the wrapped DEK is the value your application stores alongside the ciphertext. Check where your KEKs are held and who can call the unwrap operation.

Envelope encryption docs

Bring-your-own-key imports

Azure Key Vault's BYOK article says the source HSM must allow key wrapping, meaning keys are exported in encrypted form, and that this is typically disabled by default. The target key is encrypted with a Key Exchange Key (KEK) generated in the Key Vault HSM. AWS KMS describes a similar flow: imported key material is encrypted with RSAES-OAEP in transit, then decrypted and re-encrypted under AES-GCM inside the HSM. Check whether key export is enabled on your source HSM, and confirm which wrapping algorithm your provider uses for the transport step.

Azure BYOK article

Key wrapping algorithms in standards

RFC 3394 defines the AES Key Wrap algorithm, dated September 2002 with Informational status. RFC 5649 adds padding, so key data need not be a multiple of 64 bits. NIST SP 800-38F specifies AES Key Wrap, AES Key Wrap With Padding and TKW, the last intended for legacy use with TDEA. These documents define the wrapping operation itself. Check which algorithm and KEK size your product uses, and whether padded and unpadded wrapped keys are being mixed, since RFC 5649 says they cannot be unwrapped interchangeably.

NIST SP 800-38F

Key wrapping with KEMs in CMS

RFC 9629 defines the KEMRecipientInfo recipient type in CMS, identified by id-ori-kem. A key-encryption key derived from a KEM shared secret wraps the content key using a named key-wrap algorithm. The standard binds the derived KEK to the wrap algorithm and requires the KEK length to match what that algorithm needs. This is where post-quantum KEMs meet key wrapping in signed and encrypted message formats. Check that your CMS implementation supports this recipient type and the wrap algorithm named in your profile.

RFC 9629 text

Federal key management profiles

NIST SP 800-152 is a Final publication dated October 2015 that sets requirements for the design, acquisition, setup, configuration, management, operation and use of federal cryptographic key management systems. It builds on SP 800-130. Key wrapping is one of the mechanisms such systems rely on to protect keys in storage and transit. Federal customers may reference this profile in procurement, so ask a key management vendor which parts of the profile their product claims to meet, and request the evidence for each claim.

NIST SP 800-152

How a wrapped key moves between storage and systems

In a wrapped key arrangement, a key-encryption key (KEK) protects a data or content key while that key sits in storage or crosses from one system to another. The data key is encrypted under the KEK, and the result is the wrapped key. Only the wrapped form should be written to disk, to a database, into a backup, or onto a network link. When the data key is needed again, the unwrap step uses the KEK to recover it. Teams planning a migration should map every place a wrapped key is stored or transferred, and confirm which component holds the KEK and which component performs the unwrap at each hop.

Google Cloud KMS documentation describes this pattern directly: a data encryption key encrypted by a key encryption key is wrapped, decryption uses the KEK to unwrap the DEK, and a plaintext DEK must not be stored. The same principle appears in cloud key import. AWS KMS documentation says imported key material is encrypted with RSAES-OAEP to protect it in transit before it is decrypted and re-encrypted under AES-GCM inside the service's HSM. Azure Key Vault BYOK notes that the source HSM must allow key wrapping, which it says is typically disabled by default. Confirm that setting before planning an import, because it determines whether the key can leave the source system in encrypted form at all.

Integrity matters as much as confidentiality. NIST's glossary defines key wrapping as a method of cryptographically protecting keys using a symmetric key and notes that it provides both confidentiality and integrity protection. RFC 3394 requires the unwrap operation to return an error when the recovered initial value does not match the expected one, so a tampered or corrupted wrapped key is rejected rather than silently accepted. When you review a system's key handling, ask whether unwrap failures are logged and surfaced to operators, since a failed unwrap is an early signal of storage corruption or unauthorized modification.

How a key is wrapped for storage or transport

The flow starts with a data encryption key (DEK) that protects the data itself. The DEK is encrypted by a key-encryption key (KEK), producing a wrapped key that can be stored alongside the data or sent to another system. When the DEK is needed again, the KEK unwraps it, and the plaintext DEK should never be written to storage. Google Cloud KMS documents this pattern directly. Azure Key Vault BYOK uses the same idea when a source HSM exports a key in encrypted form under a KEK generated in the target HSM, and that source HSM must allow key wrapping, which is typically disabled by default.

A DEK is wrapped by a KEK before storage or transfer and unwrapped when needed.

Standardization and status of key wrapping documents

The core key wrapping specifications have different standing, and readers should check each one before citing it. RFC 3394, Advanced Encryption Standard (AES) Key Wrap Algorithm, is dated September 2002 and has Informational status, which means it does not specify an Internet standard. RFC 5649, Advanced Encryption Standard (AES) Key Wrap with Padding Algorithm, is dated August 2009 and also has Informational status. It extends the first RFC to key data that is not a multiple of 64 bits. On the NIST side, NIST SP 800-38F, Recommendation for Block Cipher Modes of Operation: Methods for Key Wrapping, was published in December 2012 and is Final. It specifies AES Key Wrap, AES Key Wrap With Padding, and TKW, the last of which is intended for legacy applications that use TDEA.

NIST has opened a revision that affects what you may rely on in the future. On 5 May 2026 NIST published an initial preliminary draft of SP 800-38F Rev. 1 as a call for preliminary comments. The draft proposes removing TKW because TDEA is no longer approved, and it proposes revisiting approval of unspecified combinations of an encryption mode with an authentication method. Comments were due 10 July 2026. A draft is not a final standard, so confirm the status of the revision on the NIST page before you rely on any listed mode or delete TKW from a configuration. RFC 9629, Using KEM Algorithms in CMS, is a Proposed Standard dated August 2024. It defines how a key-encryption key derived from a KEM shared secret wraps a content key in CMS.

The sources listed on this page do not establish whether any of these documents is a requirement for commercial organizations, so do not treat the status above as an obligation. Your own regulator, contract or federal customer determines what you must follow. Read each document directly on its publisher's site for its current status, scope and any errata, and ask your assessor or counsel which of them apply to your environment.

What key wrapping means for a post-quantum migration

This sequence maps every place your organization wraps keys, records the algorithm and KEK size behind each one, flags modes the NIST draft may retire, and confirms with vendors and your own environment that wrapping is consistent before you change anything. The output is a verified list of wrapping dependencies that you can prioritize for post-quantum planning.

  1. Inventory every system that wraps keys

    Start by listing each place in your environment where one key is encrypted under another: cloud KMS envelope encryption, HSM key export, bring-your-own-key (BYOK) imports, and CMS-encrypted content. Assign each entry an owner, usually the platform or security team that runs the system, and note whether the wrapping happens inside your environment or inside a vendor's service. The step is complete when every wrapping use has a named system, owner and location, and the list has been reviewed by someone who did not build it. Many organizations find wrapping in places outside their main key management tooling, so include backup tools, database encryption and file transfer systems that handle key material.

  2. Record the wrap algorithm and KEK size

    For each entry in the inventory, record the wrap algorithm in use and the size of the key-encryption key (KEK). RFC 3394 defines the AES Key Wrap with KEK sizes of 128, 192 or 256 bits, and RFC 5649 adds a padded variant with a separate algorithm identifier per KEK size. Ask each system owner to confirm the exact algorithm identifier from configuration or logs rather than from memory, since the same product may offer several options. The output is a table with one row per system showing the algorithm, the KEK size and the version of the software or service that performs the wrap. Where a vendor cannot tell you the algorithm, record that gap as an open item.

  3. Check for TKW and unspecified mode combinations

    Review the wrap and mode choices recorded in the previous step against the NIST draft. NIST SP 800-38F specifies TKW, an analogous mode built on TDEA and intended for legacy use, and a preliminary draft of SP 800-38F Rev. 1 published on 5 May 2026 proposes removing TKW because TDEA is no longer approved. The same draft proposes revisiting approval of unspecified combinations of an encryption mode with an authentication method. Flag every system that uses TKW or an unspecified mode and authentication pairing, and record its owner. The draft's comments were due 10 July 2026, so confirm the current status of the document on the NIST site before you rely on it. This step produces a list of systems that may need replacement regardless of post-quantum plans.

  4. Ask vendors about KEM-based wrapping

    Send each vendor that handles wrapping for you a written question asking whether their product supports KEM-based wrapping as described in RFC 9629, which defines the KEMRecipientInfo recipient type for CMS. Ask which KEM they support, whether it is ML-KEM as defined in FIPS 203 (with its parameter sets ML-KEM-512, ML-KEM-768 and ML-KEM-1024), which wrap algorithm they pair with it, and the release in which this support became available. Request the answer in writing with the product name and version. The step is complete when every vendor has answered or the non-answer is recorded. Do not assume that a KEM is available in a product because the product name suggests a post-quantum feature, and do not treat a vendor's answer as confirmation that two named components are interoperable until you test them.

  5. Confirm padded and unpadded wrapping are not mixed

    RFC 5649 states that padded and unpadded AES Key Wrap cannot be unwrapped interchangeably, so a key wrapped with one form will fail to unwrap under the other. In your environment, check whether any pair of systems that exchange wrapped keys uses different forms, and check whether any system accepts both. Test this with a non-production key by wrapping on one system and attempting to unwrap on the other. The step produces a pass or fail result for each exchange path. A failing path must be resolved before any algorithm change, because a migration that alters one side will break the other.

  6. Document results in the migration inventory

    Consolidate the results from the earlier steps into the migration inventory, adding a column for wrapping algorithm, KEK size, mode and authentication, TKW or unspecified-mode flag, KEM support status from each vendor, and padding test outcome. Assign each row to the team that will act on it. Store the document under your normal change control so that the audit trail shows when each entry was verified and by whom. The step is complete when every wrapping use has a row, every open item has an owner, and the document has been signed off by the security lead.

Common confusions about key wrapping and related terms

Key wrapping sits close to several other terms that look similar but cover different things: data encryption, AES Key Wrap variants, KEK sizes and vendor key import. The cards below separate these so you can check what a specification, product or contract actually means when it uses the word.

Wrapping keys is not encrypting data

Key wrapping encrypts one key with another key, usually to store or transport it. Encrypting data encrypts the content itself, such as a file or a database record. In envelope designs a data encryption key (DEK) is wrapped by a key encryption key (KEK), and the DEK then encrypts the data. Google Cloud KMS documentation says a plaintext DEK must not be stored, so check which of the two operations a system is performing before assuming its keys are protected.

Google Cloud KMS docs

Padded and unpadded AES Key Wrap

RFC 3394 defines AES Key Wrap, which requires the wrapped key to be a multiple of 64 bits. RFC 5649 defines AES Key Wrap with Padding, which removes that requirement. RFC 5649 states that padded and unpadded wrapping cannot be unwrapped interchangeably, so a value wrapped with one variant will not unwrap with the other. Confirm which variant each system uses before moving wrapped keys between them.

RFC 5649 text

KEK size is not a post-quantum claim

RFC 3394 allows the key encryption key to be 128, 192 or 256 bits. The KEK length describes the symmetric key size and says nothing about whether the wrapping resists quantum attacks. Post-quantum readiness for key transport is a question about the key establishment or encapsulation method, such as the ML-KEM parameter sets in FIPS 203. Ask a vendor which algorithm protects the KEK, not only how long the KEK is.

FIPS 203 text

Wrapping versus bring your own key

Some vendors describe bring your own key (BYOK) as key wrapping, but the mechanism they document is a vendor-specific import process. Azure Key Vault BYOK, for example, requires the source HSM to allow exporting keys in encrypted form, which it says is typically disabled by default, and encrypts the target key with a Key Exchange Key. AWS KMS encrypts imported material with RSAES-OAEP before re-encrypting it under AES-GCM. Neither step is a single standard wrap algorithm, so review each vendor's documented import steps.

Azure BYOK article

Questions people search about key wrapping

What does key wrapping stand for in cryptography?

Key wrapping is the protection of one cryptographic key by encrypting it with another key, so the wrapped key can be stored or transported safely. NIST's glossary defines it as a method of cryptographically protecting keys using a symmetric key, and says it provides both confidentiality and integrity protection. The key being protected is often called the key data, and the key doing the protecting is the key-encryption key (KEK). The term describes the operation, not a specific algorithm, so the same idea applies whether the wrap uses AES Key Wrap, a padded variant, or a key-encapsulation mechanism. Read the specification the vendor cites to confirm which algorithm is actually in use.

Is key wrapping the same as key encryption?

In practice the two terms overlap, but they are not identical in scope. Key wrapping refers specifically to encrypting a key with another key, usually with an integrity check built in, while key encryption is the broader category that also covers encrypting data. NIST's glossary frames wrapping as protection of keys, and the specifications that define it, such as RFC 3394 and NIST SP 800-38F, describe it as a distinct mode of operation. Vendor documentation sometimes uses the two terms loosely, so check whether a document means the wrapping of keys or the encryption of content before comparing controls.

Which RFCs and NIST documents standardize key wrapping?

The main references are RFC 3394, which defines the AES Key Wrap algorithm and has Informational status, and RFC 5649, which defines AES Key Wrap with Padding and is also Informational. RFC 3394 does not specify an Internet standard. On the NIST side, SP 800-38F, published in December 2012 with Final status, specifies AES Key Wrap, AES Key Wrap With Padding, and TKW, an analogous mode that uses TDEA and is intended for legacy applications. NIST published an initial preliminary draft of SP 800-38F Rev. 1 on 5 May 2026 that proposes removing TKW because TDEA is no longer approved, with comments due 10 July 2026. For post-quantum key transport, RFC 9629 defines how a KEM-derived key encrypts the content key in CMS. Confirm the exact revision your vendor implements.

Can padded and unpadded key wrap variants be mixed?

No. RFC 5649 states that padded and unpadded wrapping cannot be unwrapped interchangeably, so a key wrapped with one variant must be unwrapped with the same variant. The padded variant removes the requirement that the wrapped key be a multiple of 64 bits, and it accepts key data from 1 octet up to 2^32 octets. A 1-octet input produces 16 octets of output. RFC 5649 also says the padded and unpadded forms should be used only for keying material. If a system stores keys under mixed variants, unwrap failures are likely, so inventory which variant each key store uses before any migration.

What changes for a system that uses key wrapping?

The change depends on what the system wraps keys with and where those keys travel. A system that wraps keys with a symmetric KEK may need no change to the wrap algorithm itself, but its key-transport path may depend on an asymmetric or KEM step that needs to move to post-quantum primitives. FIPS 203 defines ML-KEM with three parameter sets, ML-KEM-512, ML-KEM-768 and ML-KEM-1024, and NIST SP 800-227 describes how a KEM establishes a shared secret for symmetric tasks. Cloud key services also depend on this: Google Cloud KMS unwraps data keys with the KEK, and AWS KMS protects imported key material with RSAES-OAEP in transit. Inventory each wrap and transport step, then check with the provider which of them are post-quantum ready.

What should I ask a vendor about key wrapping?

Ask which wrap algorithm and specification the product uses, including the RFC or NIST document and the revision, and whether it uses the padded or unpadded variant. Ask how the KEK is generated, stored and protected, and whether the key-encryption key ever leaves the hardware module in plaintext. For imported keys, ask how key material is protected in transit, since Azure Key Vault BYOK notes that the source HSM must allow key wrapping, which is typically disabled by default. Ask whether the vendor's post-quantum plans cover the transport step as well as the wrap step, and whether the product can follow NIST SP 800-38F Rev. 1 when it is finalized. Request written answers with the version number attached.

Does key wrapping require a specific hardware module?

The sources do not require a specific hardware module for key wrapping. Wrapping is a software-level operation defined by algorithm specifications, and it can run in software or inside a hardware security module, depending on the product. Where keys are wrapped inside an HSM, the KEK stays in the module and the wrapped key is what leaves it. NIST SP 800-152 sets requirements for federal key management systems, including design, configuration and operation. Confirm with the vendor where the KEK is held and whether that placement meets the controls your compliance program requires.

How DeployOpen works on this

DeployOpen approaches key wrapping in a migration by first mapping where wrapped keys are created, stored and transported in your environment, then planning changes to the key-encryption keys and wrap algorithms in that setup. Each engagement is fixed-scope, with deliverables agreed in writing before work starts.

How we scope

  • We inventory where wrapped keys are generated, stored and unwrapped across your systems and cloud key services.
  • We identify which wrap algorithms and key-encryption key sizes each system uses, such as AES Key Wrap or KEM-based wrapping.
  • The written scope names the systems, key stores and deliverables in the migration, and confirms what is excluded.

How we build

  • We configure and test key wrapping in your own infrastructure, including HSM, cloud KMS and application key stores.
  • We check that unwrap behavior and integrity errors work correctly before any production key is re-wrapped.
  • We document each wrap algorithm, key-encryption key and recipient type so reviewers can trace every wrapped key.

How we hand over

  • You receive written configuration records and test results covering each wrapping path that was changed.
  • The handover names who holds key-encryption keys and how access and split knowledge are controlled.
  • Runbooks describe how to rotate key-encryption keys and recover from a failed unwrap operation.

How we support

  • Engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer.
  • We can retest wrapping paths after vendor updates or changes to key-encryption key sizes.
  • Confirm with your vendors and standards documents which wrap algorithm versions your platforms support before rollout.

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.