Block cipher modes

AES-KWP

The NIST and RFC 3394/5649 modes for encrypting and authenticating cryptographic keys

standard Safe API Specified in a FIPS standard

About AES-KWP

AES-KWP is one of 2 AES Key Wrap variants in the NextSSL registry, a block cipher mode of operation. It uses a 16–32-byte key and a 16-byte (128-bit) block. Its registry entry cites NIST SP 800-38F and RFC 5649. It is also known as aes-key-wrap-pad and kwp. NextSSL lists it in the standard tier and exposes it through the safe API.

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–2012
  1. AES Key Wrap published

  2. AES key wrap specified in RFC 3394

  3. Padded variant in RFC 5649

  4. 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

Wrapping data-encryption keys under a key-encryption keyJWE and CMS key transportHSM and KMS key export

Sizes

FieldBytesMeaning
key16 – 32Secret key
nonce0Nonce / IV
block16Block

Use it

from nextssl_demo import NextSSL

ns = NextSSL()              # safe API: safe and standard tiers
ct = ns.call("blockmode_encrypt", "aes-kwp", None, key, iv, data)[0]
pt = ns.call("blockmode_decrypt", "aes-kwp", None, key, iv, ct)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Other AES Key Wrap variants

1

Frequently asked questions

What is AES-KWP?

AES-KWP is a block mode in the AES Key Wrap family. AES Key Wrap (KW) and Key Wrap with Padding (KWP) are deterministic authenticated-encryption modes designed specifically for protecting cryptographic keys. It is also known as aes-key-wrap-pad, kwp.

What are the AES-KWP sizes?

In NextSSL, AES-KWP uses: key 16 to 32 bytes, nonce 0 bytes, block 16 bytes.

Who designed AES-KWP and when?

AES-KWP belongs to the AES Key Wrap family, first published in 2001. Its origin: NIST SP 800-38F; RFC 3394; RFC 5649.

Which standards define AES-KWP?

AES-KWP is referenced by NIST SP 800-38F, RFC 5649. It is specified in a FIPS standard.

Is AES-KWP safe to use?

AES-KWP is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.

What other AES Key Wrap variants are there?

NextSSL also registers aes-kw in the AES Key Wrap family.