Skip to main content
Category: Cryptography and Encryption

Key Wrapping

Also known as: Key Wrap, Wrapped Key
Simply put

Key wrapping is a way of protecting one cryptographic key by encrypting it with another key, so it can be stored or sent over an untrusted channel without being exposed. The protected result is often called a wrapped key or encrypted key. This technique guards the confidentiality of the key and, in some methods, also protects it from tampering.

Formal definition

Key wrapping is a method of cryptographically protecting keys using a symmetric key that provides both confidentiality and integrity protection (per NIST). Operationally, it is the process of encrypting one key with another key for secure storage or transmission over an untrusted channel; in envelope encryption schemes, a key-encryption key (KEK) encrypts a data-encryption key (DEK) to produce a wrapped DEK. The AES Key Wrap algorithm (RFC 3394) is designed specifically to wrap key data and operates on 64-bit blocks, with RFC 5649 specifying a padding convention that removes the requirement for the input key data length to be a multiple of the block size. This entry covers the concept and referenced algorithms only; it does not address key generation, key lifecycle management, hardware security module implementation details, or applicable regulatory obligations, which are governed separately. Note that wrapping a key protects the key material itself and does not by itself render any underlying data non-personal.

Why it matters

Key wrapping addresses a fundamental problem in key management: cryptographic keys are themselves sensitive material that must be protected, yet they often need to be stored alongside the data they protect or transmitted across channels that cannot be fully trusted. By encrypting one key with another, key wrapping allows an organization to keep a data-encryption key (DEK) in an untrusted store or move it over an untrusted channel while its confidentiality, and in some methods its integrity, is preserved. This is a core building block of envelope encryption architectures used across many cloud key management services.

For practitioners, the practical value is that a wrapped DEK can be handled more freely than an unwrapped one, because compromise of the wrapped form alone does not expose the underlying key without also compromising the key-encryption key (KEK). This separation supports designs where a smaller number of high-value KEKs are protected under stronger controls while larger numbers of DEKs are wrapped and distributed. The strength of the arrangement therefore depends on how the KEK is protected, which is governed by key generation, key lifecycle management, and hardware security module practices that are outside the scope of key wrapping itself.

A point that is frequently misunderstood at expert level is that wrapping a key protects the key material only. It does not by itself render any underlying data non-personal, and it does not on its own establish compliance with any regulatory obligation. Encryption of data under a wrapped key may be relevant to a broader security control set, but the personal or special category status of the underlying data, along with applicable transfer, retention, and accountability obligations, must be assessed separately.

Who it's relevant to

Privacy engineers and security architects
Those designing encryption and key management systems use key wrapping as a component of envelope encryption, where a KEK protects DEKs for secure storage or transmission. They should treat the protection of the KEK, and the surrounding key lifecycle, as separate concerns that determine the overall strength of the design. They should also avoid treating a wrapped key as a mechanism that makes underlying data non-personal.
Information security teams
Security teams responsible for confidentiality and integrity controls may rely on key wrapping to allow wrapped keys to reside in untrusted stores or move over untrusted channels. Key wrapping supports these confidentiality and, per NIST, integrity objectives for key material specifically, but does not by itself cover key generation, HSM implementation, or availability controls.
Data protection and governance leads
Governance and compliance professionals should understand that key wrapping is a technical control over key material and not a determinant of the legal status of underlying data. It does not on its own render data non-personal or satisfy transfer, retention, or accountability obligations, all of which must be assessed separately and, under accountability frameworks, evidenced rather than merely asserted.

Inside Key Wrapping

Key-Encrypting Key (KEK)
The cryptographic key used to encrypt (wrap) another key. In key wrapping, the KEK protects one or more data-encryption keys so they can be stored or transmitted in encrypted form. The KEK itself must be protected, typically within a key management system or hardware security module.
Data-Encryption Key (DEK) or Wrapped Key
The key being protected through wrapping. It is encrypted under the KEK, producing a wrapped (ciphertext) form of the key that can be stored alongside the data it protects without directly exposing the key material.
Wrapping Algorithm
The defined cryptographic mechanism used to encrypt the target key under the KEK. Dedicated key-wrapping constructions are designed specifically to protect key material rather than arbitrary plaintext, though authenticated encryption modes are also used for this purpose.
Key Hierarchy
The layered structure in which higher-level keys protect lower-level keys. Key wrapping commonly supports an envelope arrangement where a KEK wraps DEKs, allowing key rotation and centralized control at the KEK level without re-encrypting all underlying data.
Unwrapping Operation
The inverse process in which the KEK is used to decrypt the wrapped key, recovering the original key material for use. Access to the unwrapping capability is generally restricted to authorized systems or roles, since it exposes the protected key.

Common questions

Answers to the questions practitioners most commonly ask about Key Wrapping.

Does wrapping a key with key wrapping make the underlying data non-personal or take it out of regulatory scope?
No. Key wrapping protects a cryptographic key by encrypting it under another key; it does not alter the classification of the data those keys ultimately protect. As with encryption and tokenization generally, applying cryptographic protection to keys does not render the associated personal data non-personal. Where the data protected can be linked back to an identifiable individual through access to the relevant keys, it typically remains personal data under regimes such as the EU GDPR and UK GDPR, and remains in scope for applicable obligations. Key wrapping is a security control, not a legal reclassification mechanism.
Is key wrapping the same thing as encrypting the data itself?
No. Key wrapping specifically refers to encrypting a cryptographic key using another key (a key-encryption key), typically so that the wrapped key can be stored or transmitted without exposing it in plaintext. Encrypting the data itself is a separate operation performed with a data-encryption key. The two are related within a key hierarchy but serve different purposes: data encryption protects the content, while key wrapping protects the keys that protect the content. Conflating them can obscure where a given control actually sits in the architecture.
Where does key wrapping typically fit within a key hierarchy?
Key wrapping is generally used to protect lower-level keys, such as data-encryption keys, by encrypting them under a higher-level key-encryption key. This allows the wrapped keys to be stored alongside or near the data they protect while the key-encryption key is held in a more strongly controlled location. The specific hierarchy, storage locations, and controls depend on the implementation and are out of scope for this entry beyond the general principle.
How does key wrapping relate to information security versus data governance responsibilities?
Key wrapping is primarily an information security control, supporting confidentiality and, depending on the mechanism, integrity of cryptographic material. Data governance concerns such as ownership, stewardship, and policy define who is accountable for keys and how key management decisions are recorded, but they do not perform the technical protection themselves. The two typically overlap in key management policy and in the evidence maintained to demonstrate control, without being the same function.
Who is accountable for key wrapping when a data controller uses a data processor?
Accountability generally follows the broader allocation of roles: a controller determines the purposes and means of processing and remains responsible for ensuring appropriate security measures, while a processor acts on the controller's instructions and typically implements agreed technical controls, which may include key wrapping. The precise division should be documented in the arrangement between the parties. Under accountability-oriented frameworks, both parties should be able to produce demonstrable evidence of the controls they are responsible for, rather than relying on stated intent.
What does key wrapping not address that must be handled separately?
Key wrapping addresses the protection of key material at rest or in transit but does not by itself cover key generation quality, access controls to the key-encryption key, key rotation, revocation, retention and destruction of keys, or the lawful basis for processing the underlying data. Cross-border transfer mechanics, retention rules, and enforcement consequences are out of scope for this entry. A complete key management approach must address these matters through additional controls and documented processes.

Common misconceptions

Key wrapping is just ordinary encryption applied to a key, so any encryption mode is equally appropriate.
Key wrapping is a specific application of cryptography aimed at protecting key material, and dedicated wrapping constructions or authenticated encryption modes are generally used for this purpose. The security properties needed for protecting keys differ from those for general data, so treating wrapping as interchangeable with any encryption approach is an oversimplification. Selection depends on the applicable standards and implementation context.
Wrapping a data-encryption key makes the underlying protected data non-personal or removes it from the scope of data protection regulation.
Encrypting or wrapping keys is a security control affecting confidentiality; it does not change the regulatory classification of the underlying data. Encryption and tokenization do not render data non-personal, and personal data protected by a wrapped key generally remains personal data. Wrapping addresses key protection, not the legal characterization of the data.
Once keys are wrapped, key management is complete and no further governance is required.
Key wrapping protects key material at rest or in transit but does not by itself address the broader lifecycle: rotation of the KEK, access control over unwrapping, retention, and demonstrable accountability. Under governance frameworks, accountability requires evidence of these controls rather than the presence of wrapping alone. Lifecycle and access governance remain necessary.

Best practices

Protect the key-encrypting key at a higher assurance level than the keys it wraps, typically within a hardware security module or a controlled key management system, since compromise of the KEK exposes all keys wrapped under it.
Use a wrapping mechanism designed or appropriate for protecting key material rather than assuming any general-purpose encryption mode is suitable, and align the choice with applicable standards and your implementation context.
Restrict and log access to the unwrapping operation, granting it only to authorized systems or roles, because unwrapping exposes the protected key material.
Structure keys into a defined hierarchy so that a KEK can be rotated without re-encrypting all underlying data, and document how rotation is performed.
Maintain demonstrable evidence of key management controls, including access, rotation, and lifecycle handling, since accountability under governance frameworks requires evidence rather than stated intent.
Do not treat wrapped keys as a substitute for data protection compliance; recognize that wrapping is a security control and that protected personal data generally remains in scope of applicable regulation, which is out of scope for the wrapping mechanism itself.