A developer is implementing a client-side decryption module for a batch processing application. The application downloads encrypted data archives (each approximately in size) from an Amazon S3 bucket. Each archive was previously encrypted using envelope encryption with a customer managed key (CMK) in AWS KMS. The encrypted data key is stored alongside the archive in the Amazon S3 object metadata. What sequence of operations must the developer implement in the application to decrypt each archive?
- ACall the AWS KMS `Decrypt` API passing the entire encrypted archive payload directly to AWS KMS to receive the decrypted plaintext archive.
- Call the AWS KMS `Decrypt` API passing the encrypted data key to obtain the plaintext data key, use the plaintext data key to decrypt the archive locally, and then erase the plaintext key from memory.Answer
- CCall the AWS KMS `GenerateDataKey` API using the customer managed key to retrieve a new plaintext data key, and use this new key to decrypt the archive locally.
- DRetrieve the plaintext customer managed key directly from AWS Systems Manager Parameter Store, and use it to decrypt the archive locally.
Answer
Call the AWS KMS Decrypt API passing the encrypted data key to obtain the plaintext data key, use the plaintext data key to decrypt the archive locally, and then erase the plaintext key from memory.
The correct approach is the envelope decryption workflow. The application sends the encrypted data key to the AWS KMS `Decrypt` API. KMS decrypts it and returns the plaintext data key. The application then uses this plaintext key to decrypt the file locally, and subsequently deletes the plaintext key from memory to minimize security risks.
Step-by-Step Solution
Key Concept
AWS KMS Envelope Decryption Workflow
Estimated Time:1m 30s