liveBook · Manning

Key wrapping

As explained in Software Security for Developers

Key wrapping is the encryption of one cryptographic key with another key for secure transport or storage.

Key wrapping encrypts one cryptographic key with another key. In hybrid encryption, AES protects the content while RSA protects the AES content encryption key (CEK), combining performance with secure key exchange. section 6.3.2 section 6.6

Follow this sender-and-recipient pattern:

  • Generate a random AES CEK and encrypt the content with AES. section 6.3.2
  • Wrap the CEK by encrypting it with the recipient’s RSA public key, then send the encrypted CEK with the encrypted content. section 6.3.2
  • Unwrap the CEK with the RSA private key and use it to decrypt the content. section 6.3.2

Recommended configuration

Use AES-GCM with a 256-bit key for bulk encryption and RSA-OAEP with a key size of at least 2,048 bits for wrapping. TLS, IPsec, JWE, and SSH use hybrid encryption. section 6.3.2 section 6.5

How Software Security for Developers covers it

How deep it goes
Explains the sender and recipient steps, algorithm choices, and RSA size guidance without covering implementation code or mathematical internals.
Examples
Uses an AES CEK wrapped with an RSA public key, alongside TLS, IPsec, JWE, and SSH as protocol examples.
What it assumes
Distinguishes symmetric AES encryption from public-key RSA encryption and assumes no deeper cryptographic mathematics.
What you can do after
Apply key wrapping via AES and RSA to encrypt content efficiently and exchange its encryption key securely.
How it connects
Connects key wrapping with AES, RSA, hybrid encryption, TLS, IPsec, JWE, and SSH.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.