Question

Difficulty: EasyAWS KMS and Encryption

A developer needs to encrypt a database backup file of size 2 GB2\text{ GB} on an application server before uploading it to Amazon S3. The developer decides to use client-side envelope encryption with an AWS KMS customer managed key.

Which two actions must the developer perform to encrypt the file locally?

  1. Call the GenerateDataKey API operation to receive both a plaintext data key and an encrypted data key.Answer
  2. Encrypt the file locally with the plaintext data key, and then securely discard the plaintext key from memory.Answer
  3. C
    Call the KMS Encrypt API operation directly to encrypt the entire 2 GB2\text{ GB} file.
  4. D
    Call the GenerateDataKeyWithoutPlaintext API operation to get the encrypted key, and then decrypt it using an SSL certificate.
  5. E
    Store the database backup file directly in Systems Manager Parameter Store to automatically encrypt it with a secure string parameter.

Answer

The developer must call the GenerateDataKey API to obtain the data keys, encrypt the file locally with the plaintext data key, and then securely remove the plaintext data key from memory.
To perform envelope encryption, the application calls the GenerateDataKey API, which returns a plaintext data key and an encrypted version of that same key. The developer uses the plaintext data key to encrypt the large file locally. Once encrypted, the plaintext data key is discarded from memory, and the encrypted data key is stored alongside the ciphertext file so it can be decrypted later.

Step-by-Step Solution

1
Generate data keys using KMS API
Obtained a plaintext data key and an encrypted data key
KMS cannot encrypt payloads larger than 4 KB4\text{ KB} directly, so a local data key is required for envelope encryption.
2
Encrypt the database backup file locally
The file is encrypted using the plaintext data key
This performs the actual cryptographic operation on the large file locally.
3
Discard the plaintext data key from memory
The plaintext data key is removed from the application's memory
To ensure security, the plaintext data key should not persist in memory after use.

Key Concept

AWS KMS Envelope Encryption Workflow
Rate this question