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.
Trace how AES encrypts the content while RSA encrypts the CEK. section 6.3.2
