AES Key Wrap
The NIST and RFC 3394/5649 modes for encrypting and authenticating cryptographic keys
Overview
AES Key Wrap (KW) and Key Wrap with Padding (KWP) are deterministic authenticated-encryption modes designed specifically for protecting cryptographic keys. They are defined in NIST SP 800-38F, RFC 3394 and RFC 5649.
KW treats the key to be wrapped as a sequence of 64-bit blocks with a 64-bit integrity check value. It runs six passes over the blocks; each step encrypts the integrity register together with one block using AES and XORs a step counter into the result. On unwrapping, the integrity value must match the expected constant, so tampering is detected. KWP adds a length indicator and padding so keys of any byte length can be wrapped.
NextSSL includes AES-KW and AES-KWP. Key wrap is used in CMS, JOSE/JWE, PKCS #11, cloud key-management services and hardware security modules. KWP can wrap keys of any length from one byte. Both modes produce output 8 bytes longer than the input, carrying the integrity check value. Unwrapping fails cleanly on any modification.
History
2001–2012AES Key Wrap published
AES key wrap specified in RFC 3394
Padded variant in RFC 5649
KW and KWP approved in NIST SP 800-38F
Security notes
KW and KWP are secure deterministic authenticated encryption for high-entropy keys, and need no nonce. They are slow and not intended for general data. Because they are deterministic, wrapping the same key twice produces the same output.
Typical uses
Variants in NextSSL
2Frequently asked questions
Which AES Key Wrap variants does NextSSL include?
NextSSL registers 2 AES Key Wrap variants: aes-kw, aes-kwp.