An application downloads a encrypted payload and its corresponding encrypted data key from an Amazon S3 bucket. The payload was encrypted client-side using envelope encryption with an AWS KMS customer managed key. Which of the following workflows should the developer implement in the application code to decrypt the payload?
- ASend the encrypted data key to the AWS KMS GenerateDataKey API operation to regenerate the plaintext key, and then decrypt the payload locally.
- Send the encrypted data key to the AWS KMS Decrypt API operation to retrieve the plaintext data key, decrypt the payload locally using the plaintext key, and then delete the plaintext key from memory.Answer
- CSend the encrypted payload directly to the AWS KMS Decrypt API operation, as KMS can decrypt payloads up to using a customer managed key.
- DStore the encrypted data key in AWS Systems Manager Parameter Store as a SecureString, and call the GetParameter API operation to automatically decrypt the payload.
Answer
Send the encrypted data key to the AWS KMS Decrypt API operation to retrieve the plaintext data key, decrypt the payload locally using the plaintext key, and then delete the plaintext key from memory.
The correct workflow involves calling the KMS Decrypt API operation with the encrypted data key. Because direct KMS cryptographic operations are capped at (), a payload cannot be decrypted directly by KMS. Instead, the application must delegate the decryption of the small data key to KMS. Once the plaintext data key is returned, the actual data payload is decrypted locally using cryptographic libraries in the application code, and the plaintext data key is discarded from memory.
Step-by-Step Solution
Key Concept
KMS Envelope Decryption Workflow
Estimated Time:1m 30s