# Envelope Encryption

Envelope encryption protects data with a data encryption key and protects that key with a separate key-encryption key.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/envelope-encryption

> Envelope encryption separates bulk data encryption from the protection and management of encryption keys. It combines efficient local encryption with centralized key controls, allowing cloud systems to protect large datasets without sending every byte through a key management service.

Practice exams covering Envelope Encryption: [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DEA-C01 AWS Certified Data Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [SCS-C03 AWS Certified Security - Specialty](https://blowstack.com/practice-exams/aws-certified-security-specialty), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Envelope Encryption

Envelope encryption combines efficient data encryption with separately governed key protection, while requiring careful handling of metadata, permissions, rotation, and plaintext-key lifetime.

1. **Separate data keys and key-encryption keys**: Use DEKs for bulk data encryption and a separately protected KEK to wrap those keys. This keeps the long-lived protection key out of ordinary storage and application data paths.
2. **Efficient bulk encryption**: Encrypt large payloads locally or within the storage service rather than sending them to a key management API. Key-service requests handle small key material, although request latency, quotas, and costs still affect system design.
3. **Portable encrypted key metadata**: Store the wrapped DEK with the ciphertext and the metadata needed to interpret it. Protect metadata integrity and never persist the plaintext DEK alongside the encrypted data.
4. **Independent choice of encryption location**: Apply the same key hierarchy in client-side or server-side encryption. Select the location based on which components may see plaintext, not on the assumption that envelope encryption implies client-side protection.
5. **Distinct rotation and re-encryption operations**: Distinguish KEK rotation, DEK rewrapping, and bulk data re-encryption. Rewrapping may simplify migration between KEKs, but it does not remediate exposure of the plaintext DEK.
6. **Authorization and key-lifecycle dependencies**: Control who can unwrap data keys and plan for key availability, recovery, and deletion. Cached plaintext keys and already decrypted data remain usable even after future key-service access is revoked.

## Cloud services for Envelope Encryption

AWS KMS supplies centrally governed key protection, while Amazon S3 and Amazon EBS perform bulk encryption within their storage workflows. Applications needing encryption before upload can instead encrypt locally and store ciphertext plus wrapped data keys in S3. AWS CloudHSM supports designs requiring direct control over HSM-backed key operations, with greater integration and operational responsibility. Across these approaches, storage permissions and key-use permissions must be designed together, and recovery plans must preserve access to the keys needed for both current data and retained backups.

- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: Amazon S3 applies envelope encryption for server-side encryption, including SSE-KMS, where AWS KMS protects the key hierarchy used for object encryption. S3 Bucket Keys can reduce KMS request traffic, so SSE-KMS does not necessarily imply a separate KMS request for every object operation.
- **[AWS CloudHSM](https://blowstack.com/tools/cloud-services-hub/aws-cloudhsm)**: AWS CloudHSM supplies customer-controlled HSM resources that applications can use to protect KEKs and wrap or unwrap DEKs. Applications must implement a compatible workflow and manage HSM availability and administration; CloudHSM is not a drop-in replacement for every KMS integration.

## Envelope Encryption exam questions

Real practice exam questions on Envelope Encryption, with the correct answer and its explanation.

### Question 1 (SOA-C03)

**Question:**

An application stores client-side encrypted backup files in Amazon S3. Each file is encrypted with a unique data key. A separate metadata object contains the data key encrypted under a symmetric customer managed AWS KMS key. The file format supports replacing the encrypted data key without modifying the encrypted file.

A CloudOps engineer must migrate all existing backups to a different customer managed KMS key so that the original KMS key can be deleted. The migration must not download or rewrite the backup files, and plaintext data keys must not leave AWS KMS during the migration. Both KMS keys are enabled, and the engineer has the required permissions.

Which procedure meets these requirements?

**Correct answer:** Call AWS KMS ReEncrypt for each encrypted data key, specifying the original key as the source and the new key as the destination. Save the returned encrypted data keys in the metadata objects, verify migration completion, and then schedule deletion of the original key.

**Explanation:** ReEncrypt decrypts and re-encrypts the data key entirely within AWS KMS. The returned data key ciphertext is protected by the new KMS key, while the underlying data key and encrypted backup file remain unchanged. After all metadata is successfully migrated and verified, the backups no longer depend on the original key.

### Question 2 (SAP-C03)

**Question:**

A genomics company produces 200-GB research exports and stores them in Amazon S3. Each export must be encrypted by the producing application before upload. Storage administrators can read and copy all stored object bytes but must not be able to recover the research data. A separate analysis role is authorized to decrypt exports through AWS KMS.

Exports must remain recoverable after the producing application's local state and databases are deleted. Each export must therefore contain all export-specific information needed for recovery, without containing any plaintext encryption keys. The company will use a symmetric customer managed KMS key with AWS-generated key material and automatic annual rotation. Existing exports must remain readable without being rewritten after rotation.

Which implementation meets these requirements?

**Correct answer:** Call GenerateDataKey for each export. Use the plaintext data key with an established authenticated-encryption library to encrypt the export locally, and then discard the plaintext key. Store the encrypted data key and required cryptographic metadata with the ciphertext. Have the analysis role call KMS Decrypt on the encrypted data key and use the recovered key to decrypt the export locally.

**Explanation:** This design uses envelope encryption. The encrypted data key can safely accompany the encrypted export because recovering the plaintext data key requires KMS authorization. The export remains self-contained without exposing a plaintext key. Automatic KMS key rotation retains the older key material needed to decrypt previously encrypted data keys, so existing exports do not require rewriting.

### Question 3 (DEA-C01)

**Question:**

A data engineering team uploads daily 20-GB extract files to Amazon S3. Security policy requires the application to encrypt each file before uploading it and prohibits persisting plaintext encryption keys. The team wants to use AWS KMS to control access to decryption while minimizing the amount of data sent to KMS. Which solution meets these requirements?

**Correct answer:** Call KMS GenerateDataKey with a symmetric customer managed KMS key. Encrypt the file locally with the plaintext data key, store the encrypted data key with the encrypted file, and remove the plaintext key from memory. For restoration, call KMS Decrypt on the encrypted data key and decrypt the file locally.

**Explanation:** This is envelope encryption. GenerateDataKey returns a plaintext data key for local encryption and an encrypted copy that can safely be stored with the ciphertext. Only the data key, not the 20-GB file, needs to be processed by KMS. Removing the plaintext key after use avoids persisting it, and KMS permissions control recovery of the data key.

### Question 4 (SCS-C03)

**Question:**

A company is designing encryption for multi-gigabyte investigation packages. An application must encrypt each package locally and store exactly one copy of the payload ciphertext. The production security team and an independent recovery team each control a different symmetric customer managed AWS KMS key. Either team must be able to decrypt a package using only its own KMS key, even when the other team's key is disabled. Neither team may receive permissions to use the other team's key. The ingestion application is authorized to use both keys, and plaintext data keys may exist temporarily in application memory.

Which encryption workflow meets these requirements?

**Correct answer:** Call GenerateDataKey with the production KMS key and encrypt the package locally with the returned plaintext data key. Call Encrypt with the recovery KMS key to encrypt that same plaintext data key. Store both encrypted data keys and the required cryptographic metadata with the payload ciphertext, and remove the plaintext data key from memory.

**Explanation:** The payload is encrypted once with one data key, while two independent KMS keys protect separate copies of that same data key. Either team can use its own KMS key to decrypt its corresponding encrypted data key and then decrypt the payload locally. Disabling either KMS key does not prevent recovery through the other.

### Question 5 (DVA-C02)

**Question:**

A media-processing application encrypts each 2-GB video locally with a unique AES-256 data key obtained from AWS KMS GenerateDataKey. It stores the encrypted video, the CiphertextBlob returned by GenerateDataKey, and the required AES-GCM metadata. The application removes the plaintext data key from memory after encryption. A separate worker must decrypt a video after the original application instance has terminated. The worker has the necessary KMS permissions. Which approach should the worker use?

**Correct answer:** Submit the stored CiphertextBlob to KMS Decrypt. Use the returned plaintext data key with the stored AES-GCM metadata to decrypt the video locally, then remove the plaintext data key from memory.

**Explanation:** The CiphertextBlob contains the data key encrypted under the KMS key. KMS Decrypt recovers that original data key for the authorized worker. The worker can then decrypt the large video locally without sending its contents to KMS.

### Question 6 (DOP-C02)

**Question:**

A company's CI/CD pipeline produces deployment bundles that range from 500 MB to 3 GB. Ephemeral build workers upload the bundles to an external artifact repository. Release workers retrieve the bundles several weeks later. Repository administrators must not be able to read the bundle contents.

A DevOps engineer must automate protection of the bundles by using a symmetric customer managed AWS KMS key. Each bundle must use a distinct encryption key, and no plaintext encryption key may be persisted. Encrypting or decrypting a bundle must require no more than two AWS KMS API requests, regardless of bundle size. Release workers have no access to the original build workers.

Which implementation meets these requirements?

**Correct answer:** Have each build worker call GenerateDataKey for each bundle. Use the plaintext data key with an established authenticated-encryption library to encrypt the bundle locally, then remove the plaintext key from memory. Store the encrypted data key and required cryptographic metadata with the encrypted bundle. Have release workers call KMS Decrypt on the encrypted data key and decrypt the bundle locally.

**Explanation:** GenerateDataKey returns a fresh plaintext data key and a copy encrypted under the KMS key. Local encryption handles the large bundle without passing its contents through KMS. The encrypted data key can safely accompany the ciphertext, and a later authorized worker can recover it with one Decrypt request. This provides a distinct key per bundle without persisting plaintext keys.

### Question 7 (SAA-C03)

**Question:**

A healthcare company runs an application on Amazon EC2 that produces 100 MB diagnostic files. The application uploads the files to a third-party archival service over HTTPS. A new security requirement states that each file must be encrypted before it leaves the EC2 instance and that the archival provider must never receive the ability to decrypt it. The company wants centralized control over decryption permissions without operating its own key management infrastructure. Plaintext encryption keys must not be persisted. Which solution meets these requirements?

**Correct answer:** Use AWS KMS GenerateDataKey to obtain a plaintext data key and an encrypted copy. Encrypt each file locally with an established encryption library, remove the plaintext key from memory after use, and upload the encrypted file and encrypted data key.

**Explanation:** This approach uses envelope encryption. The file is encrypted before upload, and only the encrypted data key is stored with it. Authorized applications can recover the data key through KMS, while the archival provider cannot decrypt the file without permission to use the protecting KMS key.

## Practice Envelope Encryption in a full exam

Questions on Envelope Encryption in each practice exam, with every answer option and an explanation for each:

- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 4 questions
- [SCS-C03](https://blowstack.com/practice-exams/aws-certified-security-specialty): 4 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 3 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 2 questions
- [DEA-C01](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate): 2 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 2 questions
- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 2 questions

## What is Envelope Encryption

Envelope encryption uses a hierarchy of keys rather than a single key for every operation. A data encryption key, or DEK, encrypts the actual data, typically using a symmetric authenticated-encryption algorithm such as AES-GCM. A separate key-encryption key, or KEK, encrypts or wraps the DEK. The encrypted data, wrapped DEK, and required cryptographic metadata form a package that can be stored together. The KEK is protected separately, usually by a key management system or hardware security module.

A typical encryption workflow starts by generating a cryptographically random DEK. The application or storage service uses its plaintext form to encrypt the data, obtains an encrypted copy of the DEK under the KEK, and removes the plaintext DEK from memory as soon as practical. To decrypt, an authorized component submits the wrapped DEK to the key management system, obtains the plaintext DEK, and decrypts the data locally. Storing the wrapped DEK beside the ciphertext is normal; storing the plaintext DEK there would defeat the separation.

In AWS, an application can call AWS KMS GenerateDataKey to receive both a plaintext data key and an encrypted copy. It encrypts its payload locally and retains only the encrypted key with the payload. Later, AWS KMS Decrypt can recover the data key for an authorized caller. This avoids the small payload limit of direct KMS encryption and avoids sending a large file through KMS. Production implementations should use established encryption libraries and authenticated formats rather than assembling cryptographic protocols themselves.

Envelope encryption does not determine whether encryption is client-side or server-side. With client-side encryption, the application encrypts data before uploading it, so the storage service receives ciphertext. With server-side encryption, a storage service performs the encryption after receiving the data. Amazon S3 with SSE-KMS is an example of server-side encryption using envelope encryption. Choose the encryption location according to the trust boundary: requirements to encrypt before upload call for client-side encryption, while requirements for managed at-rest protection may be satisfied by server-side encryption. Transport encryption remains necessary in either case.

The key service choice depends on operational and control requirements. AWS KMS provides managed key protection, authorization, auditing, and integrations with storage services. AWS CloudHSM provides customer-controlled HSM resources for applications requiring more direct control over keys and cryptographic operations, but brings additional responsibility for integration, availability, and administration. CloudHSM is not automatically interchangeable with a KMS key in every service integration. Envelope encryption itself does not require asymmetric cryptography; the KEK can also be symmetric.

Key rotation is frequently misunderstood. Rotating the backing key material for a logical KMS key does not automatically re-encrypt existing data or replace its wrapped DEKs. Where the encryption format and service support it, a DEK can be rewrapped under another KEK without decrypting and re-encrypting the bulk data. However, changing the encryption key for existing managed storage may require a service-specific copy or migration operation. If a plaintext DEK was compromised, merely rewrapping it does not restore confidentiality; the affected data needs a new DEK and re-encryption.

Operational controls remain essential. Restrict both data access and key-use permissions, separate key administration from decryption privileges, and audit key operations. Use authenticated metadata to bind ciphertext to its intended context; AWS KMS encryption context is nonsecret additional authenticated data and must match when decrypting. Data-key caching can reduce latency and request costs, but increases plaintext-key lifetime and can delay the effect of access revocation. Disabling a KEK blocks future unwrap operations, not use of keys already held in memory. Permanent loss of all usable KEK material can make the protected data unrecoverable, including backups.

## Learn Envelope Encryption in lessons

6 short lessons on Envelope Encryption in 6 certification courses.

- SOA-C03: Envelope Encryption: the data-key lifecycle (Premium), https://app.blowstack.com/lessons/envelope-encryption-the-data-key-lifecycle-soa-c03
- SAP-C03: Envelope Encryption: Tenant-Bound Key Hierarchies (Premium), https://app.blowstack.com/lessons/envelope-encryption-tenant-bound-key-hierarchies-sap-c03
- DEA-C01: Envelope Encryption: the data key lifecycle (Premium), https://app.blowstack.com/lessons/envelope-encryption-the-data-key-lifecycle-dea-c01
- SCS-C03: Envelope Encryption: designing the DEK–KEK hierarchy (Premium), https://app.blowstack.com/lessons/envelope-encryption-designing-the-dek-kek-hierarchy-scs-c03
- DOP-C02: Envelope Encryption: data-key lifecycle for stored logs (Premium), https://app.blowstack.com/lessons/envelope-encryption-data-key-lifecycle-for-stored-logs-dop-c02
- SAA-C03: Envelope Encryption: data keys and key wrapping (Premium), https://app.blowstack.com/lessons/envelope-encryption-data-keys-and-key-wrapping-saa-c03
