Courseiva
PCSEChapter 7 of 16Objective 3.2

Encryption and Key Management (CMEK and CSEK)

Who actually controls the keys to your cloud data — you, your cloud provider, or both? Encryption and key management solve the question of who holds the power to lock and unlock your most sensitive information, and that choice is the difference between passing the PCSE exam or missing a critical security control. For a security engineer, deciding whether to use Google-managed keys, customer-managed keys, or customer-supplied keys is one of the first architecture decisions you will face.

12 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Encryption and Key Management (CMEK and CSEK)

The Fancy Lockbox and Your Two Keys Analogy

A bank safety deposit box has two separate keys: the bank's master key and your personal key. The bank is the cloud provider, and the box itself is your encrypted data. Without both keys, the box cannot be opened.

When you rent a safety deposit box, you can choose who holds your personal key. You might hand it to the bank teller to keep in their drawer (this is Customer-Managed Encryption Key, or CMEK — the cloud provider stores the key but you control it). Or you might keep your personal key on your own keychain and never let the bank touch it (this is Customer-Supplied Encryption Key, or CSEK — you supply the key yourself and the provider uses it temporarily, then forgets it). The bank's master key always stays with the bank, representing the infrastructure-level encryption that Google Cloud manages by default.

Now think about what happens when you lose your personal key. With CMEK, the bank can still unlock the box using their copy of your key, so you can get your stuff back. With CSEK, if you lose your key, the box can never be opened again — your data is gone forever. That is the trade-off between control and risk. The bank's master key alone cannot open your specific box; they need either your CMEK copy or your CSEK original. This maps directly to how Cloud KMS works with CMEK and CSEK in Google Cloud.

How It Actually Works

Encryption is the process of scrambling data so that only someone with the correct key can read it. Think of it as a digital padlock. When you encrypt a file, it becomes unreadable gibberish to anyone except the person who has the key to unlock it. Google Cloud encrypts all customer data at rest (data stored on disk) and in transit (data moving across networks) by default, using keys that Google manages for you. These are called Google-managed encryption keys, and they are always active. You do not need to do anything — it is automatic.

But the PCSE exam focuses on the two situations where you, the customer, want more control over those keys. Those are Customer-Managed Encryption Keys (CMEK) and Customer-Supplied Encryption Keys (CSEK). Both live inside a Google Cloud service called Cloud Key Management Service (Cloud KMS). Cloud KMS is a centralised service to create, rotate, destroy, and audit cryptographic keys.

With CMEK, you create and manage the key material inside Cloud KMS, but the key is still stored in Google's infrastructure. You control when the key is enabled, disabled, or destroyed. You can also set permissions on who can use the key using Identity and Access Management (IAM) roles. The key never leaves Google Cloud. This is the most common choice for enterprises that need to meet compliance requirements such as showing auditors that they control the key lifecycle.

With CSEK, you supply the key yourself. You generate and manage the key outside of Google Cloud — for example, on your own hardware or on-premises key management system. You pass the key to Google Cloud at the time of data operation (like creating an encrypted disk or uploading an object to Cloud Storage). Google uses your key to encrypt or decrypt your data, but it does not store the key. After the operation, Google discards the key from memory. The risk is that if you lose your key, your data is permanently unrecoverable. The benefit is maximum control: Google never has persistent access to your key.

There is also a third option called Cloud External Key Manager (Cloud EKM), where you manage keys in an external key management partner that you control, and Google accesses them on the fly through a secure connection. Cloud EKM is important for the exam because it is sometimes tested as a hybrid between CMEK and CSEK.

Here is the key distinction tested on the exam:

Google-managed keys: Google creates, stores, and rotates the key. You have no visibility or control. This is the default.

CMEK: You create and manage the key in Cloud KMS, stored within Google's infrastructure. You control lifecycle and permissions.

CSEK: You supply the key each time. Google does not store the key. Maximum control, maximum risk if lost.

Cloud EKM: Keys are stored and managed in an external partner system outside Google Cloud, but Google can access them via a secure API.

Each of these options changes who is responsible for protecting the key. That responsibility is called the 'key management burden'. With Google-managed keys, the burden is entirely on Google. With CMEK, you share the burden because you manage the key's lifecycle but Google stores it. With CSEK, the full burden is on you — Google holds no copy.

When should you choose each? The PCSE exam tests this exact decision tree. If you need to meet a compliance standard like SOC 2 or PCI DSS that requires customer control over key material, choose CMEK. If you have a strict regulatory requirement that keys must never be stored by the cloud provider (for example, certain government or financial regulations), choose CSEK or Cloud EKM. If you have no special compliance need, Google-managed keys are fine and require no effort.

A common misunderstanding is that CSEK is always more secure. It is not necessarily more secure overall — it simply shifts the security risk from the provider to you. If your key management practices are weak, CSEK can be less secure than CMEK because you might store the key insecurely or lose it. Google's infrastructure for storing keys (CMEK) is already hardened and audited. The trade-off is control versus operational risk.

Another important concept is key rotation. Rotating a key means creating a new version of the key and retiring the old one, so that if an old key is compromised, new data is encrypted with a fresh key. CMEK supports automatic and manual rotation. You set a rotation period (e.g., every 90 days) and Cloud KMS automatically generates a new key version. Old versions are retained so you can still decrypt old data. CSEK does not support rotation in the same way because Google never stores the key — you must rotate the key yourself by supplying a new key next time.

Key destruction is equally important. With CMEK, you can schedule destruction of a key version with a 24-hour waiting period, during which you can cancel the destruction. After destruction, any data encrypted with that key version becomes permanently inaccessible. With CSEK, there is no key to destroy at Google's side; you manage destruction yourself.

Finally, Cloud KMS integrates with many Google Cloud services: Compute Engine (for persistent disk encryption), Cloud Storage (for object-level encryption), BigQuery, Cloud SQL, and more. When you use CMEK or CSEK with these services, the service contacts Cloud KMS to perform the encryption or decryption using your key. The service never receives the plaintext key — only the encrypted operation result.

Flowchart showing how different encryption key types (Google-managed, CMEK, CSEK, Cloud EKM) interact with a cloud service and where the key material resides.

Walk-Through

1

Create a Key Ring

A key ring is a logical container for your keys, tied to a specific location such as 'us-central1'. You create one per environment (e.g., production, staging) because key rings cannot be moved across regions. This step defines where your keys live in the cloud.

2

Create a Symmetric Key Inside the Key Ring

Symmetric keys use the same key to encrypt and decrypt. This is the most common type for CMEK. You choose a name like 'data-key-1' and optionally set a rotation period (e.g., 90 days). Cloud KMS generates the initial key version automatically.

3

Assign IAM Permissions

You grant IAM roles to users or service accounts. 'Cloud KMS CryptoKey Encrypter/Decrypter' allows use of the key. 'Cloud KMS Admin' allows management. Principle of least privilege applies: give only the permissions needed.

4

Enable Automatic Rotation (Optional)

You set a rotation schedule. Every X days, Cloud KMS creates a new key version and marks it as primary. Old versions remain active for decryption. This limits the damage if a key version is compromised, because only data encrypted with that version is at risk.

5

Apply the Key to a Cloud Service

When you create a Cloud Storage bucket or a Compute Engine persistent disk, you select the CMEK key. The service automatically uses envelope encryption: it generates a DEK, encrypts data with it, then calls Cloud KMS to wrap the DEK with your key. The wrapped DEK is stored alongside the data.

6

Monitor Key Usage with Audit Logs

Enable Cloud Audit Logs for Cloud KMS. Every encryption and decryption operation is logged. Review these logs to detect unauthorised access. If you see suspicious activity, disable or destroy key versions as needed.

7

Schedule Key Version Destruction

When a key version is no longer needed, you schedule its destruction. Cloud KMS waits 24 hours before actually destroying it — during that window, you can cancel the destruction. After destruction, any data encrypted with that version is permanently unreadable.

What This Looks Like on the Job

Consider a healthcare technology startup that processes patient medical records in the United States. They are subject to HIPAA regulations, which require that they control who has access to the encryption keys that protect patient data. They have chosen Google Cloud to store their data. The IT security lead, Maria, must decide how to set up encryption.

Maria starts by mapping the data. Patient records will be stored in Cloud Storage buckets as encrypted objects. They will also use Compute Engine instances with encrypted persistent disks for processing. Each type of data must be protected by keys that the company controls. Maria chooses CMEK because it gives her the necessary compliance control without requiring her team to manage keys outside of Google Cloud.

Here is the step-by-step process Maria follows:

She navigates to the Cloud KMS console in Google Cloud and creates a key ring — a logical container for keys — with a name representing the environment, such as 'production-keyring'. Inside that key ring, she creates a symmetric encryption key called 'patient-data-key'.

She sets the rotation period to 90 days, automating the generation of a new key version every quarter. This ensures that if an old key is ever leaked, only data older than 90 days could be at risk. Old versions are kept for decryption of existing data.

She then applies IAM permissions: the development team gets the role 'Cloud KMS CryptoKey Encrypter/Decrypter' so they can use the key with Cloud Storage and Compute Engine. The operations team gets 'Cloud KMS Admin' to manage the key lifecycle. She ensures no one has both roles unnecessarily, following the principle of least privilege.

Maria starts to create a Cloud Storage bucket and selects 'Customer-managed key' as the encryption type. She picks 'patient-data-key' from the list. Now every object uploaded to that bucket is automatically encrypted with Maria's key using envelope encryption: Cloud KMS encrypts a data encryption key (DEK) using her key, and that DEK encrypts the actual data. The DEK is stored alongside the data.

For Compute Engine persistent disks, she creates a new disk and again selects her customer-managed key. When the VM instance attaches the disk, Google Cloud calls Cloud KMS to unwrap the DEK so the disk can be read.

Maria sets up Cloud Audit Logs to capture every call to Cloud KMS that uses her key. She reviews these logs weekly. If an unexpected call appears — for example, a key decryption attempt from an IP address she does not recognise — she can disable the key immediately. Disabling the key means no new operations can use it, but existing encrypted data can still be decrypted with the disabled key version. To fully stop access, she would destroy the key version.

Once a year, during a compliance audit, the auditor asks to see evidence that Maria controls the key lifecycle. She exports the Cloud KMS audit logs and the IAM policy showing who has access. The auditor is satisfied because the keys are customer-managed and Maria can prove that Google cannot use the keys without her permission.

Maria never chose CSEK because the operational risk of losing the key was too high for patient data. If she lost the key, patients' medical records would be permanently inaccessible, which would be a regulatory disaster. CMEK gave her the control she needed with the safety net of Google's managed storage.

If the healthcare startup had a stricter regulation requiring that keys not be stored by the cloud provider at all — for instance, certain government contracts — Maria would have used Cloud EKM with a partner like Thales or Fortanix, where keys reside in an external system but are accessible on-demand.

How PCSE Actually Tests This

The PCSE exam tests encryption and key management in several distinct question patterns. You must know the exact differences between Google-managed keys, CMEK, CSEK, and Cloud EKM, because the exam will deliberately present scenarios where only one is appropriate.

Question type 1: Scenario selection. The exam gives you a compliance requirement (e.g., 'The customer must maintain sole control over key material and keys must never be stored by the cloud provider'). The correct answer is CSEK or Cloud EKM. The trap is that many candidates pick CMEK because they associate 'customer-managed' with full control. But CMEK keys are still stored by Google. Always read whether the scenario prohibits provider storage.

Question type 2: Key lifecycle actions. You will be asked: 'What happens to encrypted data when a CMEK key version is destroyed?' The correct answer is that any data encrypted with that key version becomes permanently inaccessible. The trap answer says data is re-encrypted with a new version. It is not — re-encryption does not happen automatically. You must rotate and re-encrypt manually if needed.

Question type 3: Integration awareness. The exam asks which Google Cloud services support CSEK. The correct set includes Cloud Storage and Compute Engine persistent disks. The trap is that some services only support CMEK, not CSEK. For example, BigQuery supports CMEK but not CSEK. Memorise the distinction.

Question type 4: Permissions and IAM. The exam tests which IAM roles allow key use versus key management. 'Cloud KMS CryptoKey Encrypter/Decrypter' allows encryption and decryption. 'Cloud KMS Admin' allows management but not encryption/decryption. The trap is that a role like 'Editor' can also manage keys by default — examine the specific permissions.

Question type 5: Envelope encryption. The exam asks why Cloud KMS uses envelope encryption. The correct answer is performance: encrypting large amounts of data directly with a key stored in Cloud KMS would be slow because every encryption operation requires a remote API call. So Google generates a local data encryption key (DEK), encrypts the data with that DEK, then encrypts the DEK with the Cloud KMS key. Only the DEK operation goes to Cloud KMS.

Trap patterns to watch:

The exam loves to confuse 'Google-managed keys' (default, no customer action) with 'customer-managed encryption keys' (CMEK, customer controls lifecycle). They sound similar but are entirely different.

A question will present a scenario where the customer wants to 'use their own key file uploaded to Cloud KMS'. This is CMEK, not CSEK, because the key material is uploaded and stored in Cloud KMS. CSEK means you never upload the key; you supply it at the time of the operation.

The exam may ask about 'key material origin' — CMEK keys can be generated in Cloud KMS or imported from your own system. CSEK keys are always generated externally.

Key definitions to memorise:

Data Encryption Key (DEK): a symmetric key used to encrypt data. It is generated locally and encrypted by a key encryption key (KEK).

Key Encryption Key (KEK): the key that encrypts the DEK. In Cloud KMS, your CMEK key is the KEK.

Envelope encryption: the process of using a KEK to encrypt the DEK.

Key ring: a logical grouping of keys within Cloud KMS, tied to a location (e.g., 'us-central1').

Key version: each rotation creates a new version. Old versions are retained for decryption.

Scheduled destruction: a 24-hour delay before a key version is permanently deleted, allowing cancellation.

Key Takeaways

Google-managed encryption keys are the default and require no action from the customer.

Customer-Managed Encryption Keys (CMEK) give you control over key lifecycle, but the key material is stored by Google in Cloud KMS.

Customer-Supplied Encryption Keys (CSEK) let you supply your own key each time, and Google never stores the key persistently.

Cloud External Key Manager (Cloud EKM) stores keys in a third-party system outside Google Cloud but allows Google to access them via a secure API.

Envelope encryption is used automatically by Cloud KMS — a data encryption key (DEK) is encrypted by your key (KEK) to improve performance.

Destroying a CMEK key version is permanent after a 24-hour waiting period and makes all data encrypted with that version unreadable.

CSEK offers maximum control but maximum risk: if you lose your key, your data is unrecoverable with no backup.

The PCSE exam tests which services support CSEK vs CMEK — Cloud Storage and Compute Engine support both, but BigQuery only supports CMEK.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

CMEK (Customer-Managed Encryption Key)

Key is stored in Google Cloud KMS

Key lifecycle is managed through Cloud KMS

You can rotate and destroy keys via the console

CSEK (Customer-Supplied Encryption Key)

Key is not stored by Google at all

Key lifecycle is managed externally by you

No built-in rotation or destruction in Cloud KMS

Google-Managed Encryption Key

Google creates and manages the key entirely

No customer visibility into key material

No additional cost for key management

CMEK

Customer creates and manages key lifecycle

Customer has full control to enable/disable/destroy

There is a cost per key version and per operation

CMEK

Key stored in Google Cloud infrastructure

Key accessible via Cloud KMS API

Supported by more Google Cloud services

Cloud EKM (External Key Manager)

Key stored in partner's external system outside Google

Key accessible via a secure connection to partner

Supported by fewer services (e.g., Compute Engine, Cloud Storage)

Symmetric Encryption Key

One key used for both encryption and decryption

Faster and used for bulk data encryption

Most common for Cloud KMS CMEK scenarios

Asymmetric Encryption Key

Two keys: one public for encryption, one private for decryption

Slower, used for signing or key exchange

Available in Cloud KMS but less common for data at rest

Watch Out for These

Mistake

CSEK means you upload your key to Google Cloud and Google stores it for you.

Correct

CSEK means you supply the key each time you perform an operation, and Google does not store the key at all. It uses the key temporarily and discards it.

The term 'customer-supplied' sounds like 'supplied and stored', but in Google Cloud, 'supplied' means temporarily provided and not retained.

Mistake

CMEK keys are stored outside Google Cloud on customer hardware.

Correct

CMEK keys are stored inside Google Cloud's Cloud KMS infrastructure. The customer manages the key lifecycle (create, rotate, destroy) but Google stores the key material.

The word 'customer-managed' implies the customer has physical possession, but actually it is logical management, not physical custody.

Mistake

If I use CSEK, Google cannot decrypt my data even temporarily.

Correct

Google's infrastructure does use your CSEK key to perform encryption and decryption operations, but the key is held in memory only for the duration of the operation and then discarded. Google does not have persistent access.

Beginners think 'supply' means 'hand it over and it stays with them', but the key is actively used in Google's memory to process your data.

Mistake

Envelope encryption is a separate optional feature you must enable.

Correct

Envelope encryption is used by default by Cloud KMS whenever you use CMEK or CSEK for data services. It is not an optional feature — it is how the system works internally.

The term 'envelope' sounds like an add-on, but it is the core mechanism that makes key management scalable.

Mistake

If I destroy a CMEK key version, my data is automatically re-encrypted with a newer version.

Correct

Destroying a key version permanently makes any data encrypted with that version unreadable. There is no automatic re-encryption. You must manually decrypt and re-encrypt the data with a new key version.

People assume cloud services are 'smart' enough to fix broken encryption, but that would require reading plaintext data and rewriting it, which is a huge security and performance risk if done automatically.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

Can I use my own existing encryption key with Google Cloud KMS?

Yes, you can import your own key material into Cloud KMS for use as a CMEK key. This is called key import. You generate or bring your existing key, wrap it in a secure envelope, and upload it to Cloud KMS.

Does CSEK work with Cloud SQL?

No, Cloud SQL does not support CSEK. Cloud SQL supports Google-managed keys and CMEK keys. You must use CMEK if you want customer-controlled encryption for Cloud SQL databases.

What happens if I disable my CMEK key?

Disabling a key prevents any new encryption or decryption operations with that key. Existing encrypted data can still be decrypted with the latest version of the key. You can re-enable the key later. Disabling is reversible; destruction is not.

Is CSEK more secure than CMEK?

It depends entirely on your key management practices. CSEK is more secure if you have a highly secure on-premises key management system. CMEK is more secure if you trust Google's infrastructure and want to avoid the risk of losing your keys.

Can I rotate a CSEK key?

Not directly through Cloud KMS, because Cloud KMS does not store your CSEK key. You must rotate the key externally: generate a new key and supply it the next time you upload or create encrypted data. Old CSEK keys that you have lost cannot be restored.

Does Google charge extra for using CMEK or CSEK?

Yes, there is a cost for using Cloud KMS with CMEK and CSEK. You pay for key versions that exist, each key operation (encrypt/decrypt calls), and storage of key material. Google-managed keys are free.

Terms Worth Knowing

Keep going

You've finished Encryption and Key Management (CMEK and CSEK). Continue through the PCSE study guide to build a complete picture of the exam.

Done with this chapter?