liveBook · Manning

Content encryption key

As explained in Software Security for Developers

A content encryption key is a symmetric key used to encrypt the actual protected content in an encryption scheme.

A content encryption key (CEK) is a symmetric key that encrypts the actual protected content. In hybrid encryption, AES handles the content because it is faster, while RSA protects the CEK during transit or storage. section 6.3.2

A typical hybrid-encryption exchange works like this:

  • Generate a random AES CEK. section 6.3.2
  • Encrypt the content with the CEK. section 6.3.2
  • Wrap the CEK by encrypting it with the recipient’s RSA public key. section 6.3.2
  • Let the recipient use the RSA private key to unwrap the CEK, then decrypt the content. section 6.3.2

JWE representation

A JWE can carry encrypted content, an optional encrypted CEK, and an authentication tag. With AES-GCM and a 256-bit key, the encrypted-key component may be omitted when a preagreed method derives or supplies the CEK. section 11.5.1

Figure 6.5 Hybrid encryption uses a high-performance symmetric algorithm such as AES to encrypt content. Then the AES CEK is encrypted with the recipient’s RSA public key, allowing the recipient to use their private key to first the CEK and then decrypt the content.
figure

Trace how AES encrypts the content while RSA encrypts the CEK. section 6.3.2

How Software Security for Developers covers it

How deep it goes
Explains CEK generation, content encryption, RSA wrapping, unwrapping, and JWE representation.
Examples
Uses AES-GCM with a 256-bit key, RSA-OAEP wrapping, and a structured JWE carrying encrypted data.
What you can do after
Apply hybrid encryption by configuring AES for content and RSA-OAEP for wrapping the CEK.
How it connects
Connects content encryption keys with hybrid encryption, AES, RSA, key wrapping, and JSON Web Encryption.

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.