AWS KMS and Envelope Encryption
KMS manages cryptographic keys and uses envelope encryption with data keys to protect large application data.
How it works
AWS Key Management Service (KMS) manages cryptographic keys and controls their use. With envelope encryption, an application requests a plaintext data key and a copy encrypted under a KMS key. The application uses the plaintext data key to encrypt data locally, removes it from memory when no longer needed, and stores the encrypted key with the data.
When to use it
Choose it when the requirement is to centrally control key usage while encrypting large volumes of application data.
Real-world example
An application encrypts medical images before storing them in S3. It obtains a data key from KMS, encrypts the file locally, and stores the encrypted key with the file for later decryption.
Key facts
- Multi-Region KMS keys share key material across Regions but do not replicate application data.
- KMS returns a plaintext data key and an encrypted copy; the application encrypts data locally and stores the encrypted key.
Common pitfall
The KMS Encrypt API limits plaintext size and is unsuitable for sending large files directly. Protect the plaintext data key and remove it from memory as soon as practical.
Often confused with
Secrets Manager stores and automatically rotates secrets like passwords and credentials rather than cryptographic encryption keys.
References
Prepared by Cloud Quest. Check current behavior and limits in the AWS documentation:
Keywords you will see in SAA-C03 questions
- centralized key policy
- encrypt large data
Understand it for real with 3D models and simulated labs
Connect the concept to a working architecture.