9.1 Data Encryption, Key Management & Confidential Computing

Key Takeaways

  • Cryptographic states safeguard information across Data at Rest (AES-256 block/object encryption), Data in Transit (TLS 1.3, IPsec, mTLS), and Data in Use (Confidential Computing via Intel SGX, AMD SEV, and AWS Nitro Enclaves).
  • Envelope encryption utilizes a two-tier key hierarchy where a high-level Key Encryption Key (KEK) / Customer Master Key (CMK) encrypts a transient Data Encryption Key (DEK), ensuring plaintext DEKs are never written to non-volatile storage.
  • Symmetric encryption (AES-256) delivers ultra-fast bulk data encryption using a single shared secret, whereas asymmetric cryptography (RSA, ECC) uses public-private key pairs for digital signing, identity attestation, and secure key exchanges.
  • Dedicated Cloud HSM solutions provide single-tenant physical cryptographic hardware meeting FIPS 140-2/3 Level 3 physical tamper-resistance requirements, while multi-tenant Cloud KMS services typically operate within FIPS 140-2 Level 2 multi-tenant boundaries.
  • Key origin architectures define control boundaries: Cloud-Generated keys (KMS managed), Bring Your Own Key (BYOK / Customer Managed Keys with customer-controlled lifecycle), and Hold Your Own Key (HYOK / External Key Store) where keys never leave the customer's on-premises HSM.
Last updated: August 2026

Data Encryption, Key Management & Confidential Computing

Data protection is the ultimate cornerstone of cloud security architecture. In a shared-infrastructure cloud model, perimeter defenses and network firewalls are necessary but insufficient on their own; data itself must be rendered cryptographically unintelligible to unauthorized actors. For the CompTIA Cloud+ (CV0-004) examination, cloud engineers must demonstrate comprehensive mastery across cryptographic primitives, key lifecycle management, envelope encryption workflows, and modern hardware-isolated Confidential Computing architectures.


1. The Three Cryptographic States of Data

Data in enterprise cloud environments moves continuously through three distinct operational states, each requiring dedicated cryptographic mechanisms:

+-----------------------------------------------------------------------------------------+
|                         THE THREE CRYPTOGRAPHIC STATES OF DATA                          |
|                                                                                         |
|   State              Primary Threat Vector             Cryptographic Defense            |
|   +----------------+---------------------------------+--------------------------------+ |
|   | Data at Rest   | Stolen media, physical breach,  | AES-256-GCM / AES-256-XTS,     | |
|   | (Storage)      | snapshot exposure, disk dumping | TDE, Full-Disk Encryption      | |
|   |                |                                 |                                | |
|   | Data in Transit| Man-in-the-Middle (MitM),       | TLS 1.3 (ECDHE PFS), IPsec VPN,| |
|   | (Network)      | packet sniffing, route hijack   | Mutual TLS (mTLS) Service Mesh | |
|   |                |                                 |                                | |
|   | Data in Use    | Hypervisor breakout, memory dump| Confidential Computing (TEEs), | |
|   | (CPU & RAM)    | cold boot attack, rogue root OS | Intel SGX, AMD SEV, Nitro Encl | |
|   +----------------+---------------------------------+--------------------------------+ |
+-----------------------------------------------------------------------------------------+

Data at Rest

Data at Rest refers to static digital information stored in non-volatile media, such as block storage volumes (e.g., AWS EBS, Azure Managed Disks, Google Persistent Disk), object storage buckets (Amazon S3, Azure Blob, Google Cloud Storage), file shares (NFS/SMB), and relational/NoSQL databases.

  • Symmetric Encryption Standard: The industry standard is AES-256 (Advanced Encryption Standard with 256-bit key length), frequently deployed in GCM (Galois/Counter Mode) for authenticated encryption or XTS mode for block-level storage.
  • Storage Volume Encryption: Protects boot and data volumes, disk snapshots, and subsequent volume restores at the hypervisor storage controller layer. Host-level CPU handles cryptographic throughput transparently without guest OS configuration.
  • Database Transparent Data Encryption (TDE): Encrypts database data files, log files, and automated backups at the database engine layer (e.g., Microsoft SQL Server, Oracle, PostgreSQL) before writing blocks to underlying disk storage.
  • Client-Side vs. Server-Side Encryption (SSE):
    • Server-Side Encryption (SSE): The cloud service provider receives plaintext over a secure connection, encrypts the data upon ingest using a managed key, and transparently decrypts it upon retrieval (e.g., SSE-S3, SSE-KMS).
    • Client-Side Encryption: The client application encrypts plaintext data locally before transmitting it across the network to the cloud repository. The CSP stores only ciphertext and possesses zero access to the cryptographic keys.

Data in Transit

Data in Transit (or Data in Motion) represents information traversing public internet routes, private cloud backbone interconnects, or virtual private cloud (VPC) subnets.

  • Transport Layer Security (TLS 1.3): Mandates strong cipher suites (e.g., TLS_AES_256_GCM_SHA384), eliminates legacy, insecure ciphers (RC4, DES, 3DES, static RSA key exchange), and enforces Perfect Forward Secrecy (PFS) using Elliptic Curve Diffie-Hellman Ephemeral (ECDHE). PFS guarantees that compromise of a server's long-term private key will not compromise past recorded session traffic.
  • IPsec VPN Tunnels: Network-layer encryption utilizing the Encapsulating Security Payload (ESP) protocol in tunnel mode with IKEv2 (Internet Key Exchange version 2) for secure hybrid site-to-site connectivity.
  • Mutual TLS (mTLS): Enforces bidirectional cryptographic authentication where both client and server exchange and validate X.509 digital certificates. In microservices and Kubernetes service meshes (e.g., Istio, Linkerd), mTLS establishes zero-trust, encrypted pod-to-pod channels.

Data in Use & Confidential Computing

Historically, data had to be decrypted into plaintext inside system memory (RAM) and CPU registers to be processed. This left an attack surface vulnerable to hypervisor-level exploits, memory bus sniffing, kernel dump extraction, and unauthorized inspection by rogue cloud operators.

Confidential Computing eliminates this vulnerability by securing Data in Use through hardware-enforced Trusted Execution Environments (TEEs), also known as secure enclaves. TEEs isolate data and computational logic within memory, encrypting memory contents with transient hardware-generated keys so that neither the host operating system, the hypervisor, nor external devices can inspect or alter execution state.

+-----------------------------------------------------------------------------------------+
|                        CONFIDENTIAL COMPUTING TEE ARCHITECTURE                          |
|                                                                                         |
|   Standard Cloud Virtual Machine            Confidential Computing VM (TEE / Enclave)   |
|   +------------------------------------+    +-----------------------------------------+ |
|   | Application (Plaintext in RAM)     |    | Application (Plaintext inside Enclave)  | |
|   | Guest OS (Plaintext in RAM)        |    | Hardware Memory Encryption (AES-128/256)| |
|   +------------------------------------+    +-----------------------------------------+ |
|   | Hypervisor (Has Full Memory Access)|    | Hypervisor (BLOCKED: Encrypted Memory)  | |
|   | Host OS & Cloud Admin (Full Access)|    | Host OS & Cloud Admin (BLOCKED: Inaccessible) |
|   +------------------------------------+    +-----------------------------------------+ |
|   | Physical Hardware (Shared Memory)  |    | CPU Root of Trust (Intel SGX/AMD SEV)   | |
|   +------------------------------------+    +-----------------------------------------+ |
+-----------------------------------------------------------------------------------------+
  • Intel SGX (Software Guard Extensions): Allows applications to allocate private memory partitions called Enclave Page Caches (EPC). Even if the host OS, BIOS, or hypervisor is fully compromised, CPU hardware blocks all external read/write access to EPC memory.
  • AMD SEV-SNP (Secure Encrypted Virtualization - Secure Nested Paging): Encrypts entire virtual machine memory spaces using dedicated per-VM cryptographic keys embedded in the AMD Secure Processor, preventing the hypervisor from reading guest memory or altering guest page tables.
  • AWS Nitro Enclaves: Isolated, hardened compute environments built on the AWS Nitro System. Nitro Enclaves have no persistent storage, no interactive operator access, and no external networking; communication is restricted strictly to a secure local virtual socket (vsock) connected to the parent EC2 instance.

2. Key Management Services (KMS) & Key Hierarchies

Cryptographic security depends entirely on the secrecy and lifecycle governance of cryptographic keys. Cloud Key Management Services (e.g., AWS KMS, Azure Key Vault, Google Cloud KMS) centralize key generation, storage, rotation, access control, and auditing.

Symmetric vs. Asymmetric Cryptography

AttributeSymmetric CryptographyAsymmetric Cryptography
Key ArchitectureSingle shared secret key for encryption & decryptionPublic key (encrypt/verify) + Private key (decrypt/sign)
AlgorithmsAES-128, AES-256, ChaCha20-Poly1305RSA-2048/4096, ECC (ECDSA, Ed25519)
Computational SpeedExtremely fast; optimized for multi-gigabit throughputSlower (100x to 1000x more CPU-intensive)
Primary Use CasesBulk data encryption (storage disks, databases, files)Key exchange, TLS handshakes, digital signatures, IAM tokens
Key DistributionDifficult; key must be securely shared beforehandEasy; public key can be freely distributed

Hierarchical Key Structure: CMKs vs. DEKs

To balance security and high-throughput operational performance, cloud cryptography establishes a two-tiered key hierarchy:

+-----------------------------------------------------------------------------------------+
|                           CRYPTOGRAPHIC KEY HIERARCHY                                   |
|                                                                                         |
|   Level 1: Key Encryption Key (KEK) / Customer Master Key (CMK)                         |
|   - Stored securely inside Cloud KMS / HSM; NEVER leaves the security boundary unencrypted|
|   - Used exclusively to encrypt and decrypt Data Encryption Keys (DEKs)                 |
|   - Managed by IAM policies, key rotation schedules, and CloudTrail auditing            |
|                                     |                                                   |
|                                     v (Encrypts / Decrypts)                             |
|   Level 2: Data Encryption Key (DEK)                                                    |
|   - Generated dynamically on-demand for specific data objects, files, or blocks         |
|   - Used directly by application/storage controller to perform bulk AES-256 encryption  |
|   - Ephemeral in memory; plaintext DEK is immediately destroyed after use               |
|   - Encrypted DEK (Ciphertext) is stored directly alongside the encrypted data          |
+-----------------------------------------------------------------------------------------+

3. Envelope Encryption Architecture & Mechanics

Envelope Encryption is the cryptographic design pattern of encrypting plaintext data with a unique Data Encryption Key (DEK), and then encrypting the DEK with a root Key Encryption Key (KEK) / Customer Master Key (CMK) managed in KMS.

Step-by-Step Encryption Flow

  1. The client application or cloud storage service sends a request to the Cloud KMS API: GenerateDataKey(KeyId=CMK-UUID, KeySpec=AES_256).
  2. Cloud KMS generates a new cryptographically secure 256-bit symmetric key.
  3. Cloud KMS encrypts a copy of this key using the specified CMK.
  4. Cloud KMS returns two objects to the client: the Plaintext DEK and the Encrypted DEK (Ciphertext DEK).
  5. The client application encrypts the plaintext data payload using the Plaintext DEK in memory.
  6. The client application immediately wipes the Plaintext DEK from RAM.
  7. The client stores the Encrypted DEK in the metadata header directly alongside the ciphertext payload.

Step-by-Step Decryption Flow

  1. The client reads the ciphertext payload and extracts the stored Encrypted DEK from the header.
  2. The client sends the Encrypted DEK to the Cloud KMS API: Decrypt(CiphertextBlob=EncryptedDEK).
  3. Cloud KMS verifies the caller's IAM permissions, decrypts the Encrypted DEK using the internal CMK, and returns the Plaintext DEK.
  4. The client uses the Plaintext DEK to decrypt the ciphertext data payload in memory.
  5. The client purges the Plaintext DEK from memory as soon as decryption is complete.
+-----------------------------------------------------------------------------------------+
|                         ENVELOPE ENCRYPTION WORKFLOW DIAGRAM                            |
|                                                                                         |
|   [ ENCRYPTION PHASE ]                                                                  |
|   Application ------------ Request Data Key -----------> Cloud KMS (Contains CMK/KEK)   |
|               <--- Plaintext DEK + Encrypted DEK <-------                               |
|        |                                                                                |
|        +--> [Plaintext Data] + [Plaintext DEK] ===> [Ciphertext Data]                   |
|        +--> Erase [Plaintext DEK] from RAM                                              |
|        +--> Store Package: [Encrypted DEK Metadata] + [Ciphertext Data]                 |
|                                                                                         |
|   [ DECRYPTION PHASE ]                                                                  |
|   Package ====> Read [Encrypted DEK]                                                    |
|   Application ------------ Decrypt(Encrypted DEK) -------> Cloud KMS (CMK/KEK)          |
|               <---------- Plaintext DEK -----------------                               |
|        |                                                                                |
|        +--> [Ciphertext Data] + [Plaintext DEK] ===> [Plaintext Data]                   |
|        +--> Erase [Plaintext DEK] from RAM                                              |
+-----------------------------------------------------------------------------------------+

Why Envelope Encryption is Essential in Cloud Architectures:

  1. Performance & Scalability: Encrypting large datasets (e.g., a 10 TB database or 50 GB object) directly via KMS API calls would create severe network latency, saturate KMS service API limits, and incur massive API request costs. Envelope encryption performs bulk encryption locally at wire speed.
  2. Security & Blast Radius Isolation: Every individual object or volume can use a unique DEK. If a single DEK is somehow compromised, only that individual file is exposed, not the entire storage bucket or database.
  3. Key Rotation Efficiency: When an organization rotates a CMK/KEK (annually or on-demand), it does not need to re-encrypt petabytes of underlying data. Only the small (32-byte) encrypted DEKs stored in metadata need re-wrapping, or the new CMK simply decrypts older DEKs via historical key versions.

4. Cloud HSM vs. Multi-Tenant KMS (FIPS 140-2 / FIPS 140-3)

Enterprises operating under stringent regulatory mandates (such as PCI DSS, FedRAMP High, or national defense frameworks) must distinguish between multi-tenant software/hardware KMS and dedicated Hardware Security Modules (Cloud HSM).

NIST FIPS 140-2 / 140-3 Validation Levels

The Federal Information Processing Standard (FIPS) 140-2/3 defines four progressive security levels for cryptographic modules:

  • Level 1: Basic software cryptographic implementation; no physical security requirements.
  • Level 2: Role-based authentication; physical requirements include tamper-evident coatings or seals that show visible evidence of physical access attempts.
  • Level 3: Identity-based authentication; physical tamper-detection and response circuitry that zeroizes (destroys) all plaintext cryptographic keys upon detection of physical enclosure breach, temperature anomalies, or voltage tampering.
  • Level 4: Complete physical envelope protection against environmental penetration (e.g., laser probing, cryogenic attacks).
+-----------------------------------------------------------------------------------------+
|                        CLOUD HSM VS. MULTI-TENANT KMS COMPARISON                        |
|                                                                                         |
|   Feature / Dimension        Multi-Tenant Cloud KMS       Dedicated Cloud HSM           |
|   +------------------------+----------------------------+-----------------------------+ |
|   | Tenancy Architecture   | Multi-tenant shared infra  | Single-tenant dedicated     |
|   |                        | with logical isolation     | physical hardware appliance |
|   |                        |                            |                             |
|   | FIPS Validation Level  | FIPS 140-2 Level 2         | FIPS 140-2 / 140-3 Level 3  |
|   |                        | (or Level 3 shared HSMs)   | (Physical tamper zeroize)   |
|   |                        |                            |                             |
|   | API / Interface        | Native Cloud REST APIs     | Industry Standards: PKCS#11,|
|   |                        | (AWS KMS, Azure REST, GCP) | JCE, Microsoft CNG/KSP      |
|   |                        |                            |                             |
|   | Administrative Control | CSP manages infrastructure;| Customer holds exclusive    |
|   |                        | Tenant manages IAM access  | Crypto Officer/User roles   |
|   |                        |                            |                             |
|   | Cost Profile           | Low; pay-per-key / per-API | High; dedicated hourly      |
|   |                        | request consumption        | appliance cluster fee       |
|   +------------------------+----------------------------+-----------------------------+ |
+-----------------------------------------------------------------------------------------+

5. Key Origin & Ownership Models: BYOK vs. HYOK

Cloud providers offer three primary models governing where key material is generated and who controls the cryptographic boundary:

+-----------------------------------------------------------------------------------------+
|                         KEY ORIGIN & PROVENANCE COMPARISON                              |
|                                                                                         |
|   1. Cloud-Generated (KMS Default)                                                      |
|      CSP KMS generates and stores key material inside the cloud platform.               |
|      - Operational overhead: Lowest. Automated rotation and high availability.         |
|                                                                                         |
|   2. Customer Managed Keys (BYOK - Bring Your Own Key)                                  |
|      Customer generates key in an on-premises HSM, wraps it with the CSP's public key,  |
|      and imports the key material into Cloud KMS.                                       |
|      - Operational overhead: Moderate. Customer controls key expiration and revocation. |
|                                                                                         |
|   3. Hold Your Own Key (HYOK / External Key Store - XKS)                                |
|      Root cryptographic keys NEVER enter the cloud. The Cloud KMS acts as a proxy,      |
|      forwarding cryptographic requests to an on-premises HSM over Direct Connect/VPN.   |
|      - Operational overhead: Highest. Network latency on every crypto call; single      |
|        point of failure if hybrid interconnect drops.                                   |
+-----------------------------------------------------------------------------------------+

CompTIA Cloud+ Exam Traps & Real-World Gotchas

  1. KMS Throttling During Auto-Scaling: When hundreds of container pods or virtual machines boot simultaneously in an auto-scaling event, each requesting DEK generation directly from KMS, the account may exceed regional KMS API request limits (ThrottlingException). The architectural fix is data key caching using local client-side memory caches with defined TTLs.
  2. HYOK Latency Penalty: While HYOK provides maximum data sovereignty, every database query or block decryption requiring root key intervention traverses hybrid network links. HYOK should only be selected when legally mandated by sovereign regulations.
  3. Key Deletion Waiting Periods: Cloud KMS enforces a mandatory minimum deletion waiting period (e.g., 7 to 30 days in AWS KMS/Azure Key Vault) to prevent catastrophic accidental data loss resulting from rogue or mistaken key destruction.
Loading diagram...
Envelope Encryption Cryptographic Lifecycle
Test Your Knowledge

An enterprise cloud application performs envelope encryption on sensitive customer documents before storing them in an object storage repository. Why does the application immediately erase the plaintext Data Encryption Key (DEK) from volatile memory after encrypting the document payload?

A
B
C
D
Test Your Knowledge

A financial institution must deploy a sensitive risk calculation workload on public cloud virtual machines. The chief information security officer requires guarantees that neither the cloud service provider's hypervisor operators nor privileged root accounts on the host can inspect customer calculations or access plaintext data in RAM during processing. Which technology directly fulfills this requirement?

A
B
C
D
Test Your Knowledge

A defense analytics organization is mandated by federal compliance standards to ensure all cryptographic keys are generated and stored in a dedicated, single-tenant physical hardware device certified to FIPS 140-2/3 Level 3 with physical tamper-detection and automatic key zeroization. Which cloud cryptographic solution must the team provision?

A
B
C
D