A small safe protects the key to a large box. The box is encrypted locally; its wrapped key can travel beside it.
Encrypt the file or protect its data key?
The essentials in 30 seconds
before you dive into the detailsPicture this
Small safe, large box
Box key
Data key
Encrypts the payload locally.
Small safe
KMS key protection
Protects the wrapped data key.
Use envelope encryption for large payloads. KMS protects the data key while the application encrypts the payload locally.
GenerateDataKey returns plaintext and encrypted key copies. Store the encrypted copy; discard plaintext key material after use.
Exam trap
EncryptionContext is authenticated, non-secret metadata. It must match on decrypt and must not contain secrets.
One sentence to remember
Encrypt the payload locally and keep only the wrapped data key with it.
1 media item5 rule steps5 scenarios6 flashcards