Encryption and keys
Associate Data Practitioner · Lesson 16 of 16 · 1:53:04
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Google Cloud Associate Data Practitioner exam, on the official exam guide. In this lesson: encryption at rest and in transit, who controls the keys (Google-owned and Google-managed keys, customer-managed keys), Cloud Key Management Service, and customer-supplied keys and client-side encryption. Includes three original practice questions, with Cymbal Energy, a fictional electricity and gas supplier, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Three questions from the regulator
The energy regulator sends Cymbal Energy three questions about customer data. Is it encrypted on disk, and on the network? Who controls the keys? And can the company make the data unreadable, on demand?
At rest and in transit
Encryption at rest protects stored data, in Cloud Storage, BigQuery, Cloud SQL, and other services, so that a stolen disk or backup cannot be read. Google Cloud encrypts all customer data at rest by default, with AES-256, with nothing for you to set up. Encryption in transit protects data moving across a network, between a user and Google, or between services, and it relies on TLS, like any HTTPS connection. The two are complementary: at rest covers stored data, in transit covers moving data, and a compliance review usually asks for both.
Who controls the keys
The real question is who manages the key that protects the data. By default, Google-owned and Google-managed encryption keys do everything for you: creation, storage, and rotation, with nothing to configure. Customer-managed encryption keys, or CMEK, live in your own Cloud Key Management Service, so you control their rotation and who can use them, and you can disable or destroy them, which makes the data unreadable. Customer-supplied encryption keys, or CSEK, go one step further: you keep the key outside Google Cloud, and send it with each request, for Cloud Storage and Compute Engine.
Cloud Key Management Service
Cloud Key Management Service, or Cloud KMS, creates and manages keys, grouped in key rings, and each key has versions. With an automatic rotation schedule, new data is encrypted with a new version, while older versions still decrypt older data. Keys can be protected in software, in hardware security modules with Cloud HSM, or kept outside Google with Cloud External Key Manager, and access to each key is controlled with IAM: a service that uses a key, like BigQuery, needs the CryptoKey Encrypter Decrypter role on it. And Cloud KMS Autokey can create keys for you as resources are created, which makes CMEK easier to apply everywhere.
Customer-supplied keys and client-side encryption
With customer-supplied encryption keys, you send your own AES-256 key with each Cloud Storage request: Cloud Storage uses it, purges it, and keeps only a hash, to check later requests. So Google never stores the key, but if you lose it, nobody can recover the data. Choose it only when the key must never be stored in Google Cloud, and when you can manage keys reliably yourself. And for maximum secrecy, client-side encryption encrypts the data before it is sent, so Google never sees it unencrypted.
Recap
Let's recap. Encryption at rest protects stored data, and Google Cloud applies AES-256 to all of it by default, while encryption in transit, with TLS, protects data on the move. Google-owned and Google-managed keys need nothing from you. Customer-managed keys in Cloud KMS let you control rotation, access, and destruction, and the service that uses them needs the Encrypter Decrypter role. Customer-supplied keys are sent with each Cloud Storage request and never stored, so losing one means losing the data. And client-side encryption keeps the data unreadable to Google, before it is even sent.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
The security team must control the rotation schedule of the key that protects the billing dataset in BigQuery, and be able to disable that key at any time. What fits?
- Google-owned and Google-managed keys
- Customer-supplied keys, sent with each query
- TLS on every connection
- A customer-managed key in Cloud KMS
Show the answer
A customer-managed key in Cloud KMS
A customer-managed key in Cloud KMS lets the team set its rotation, control who uses it, and disable it. “Google-owned and Google-managed keys” leaves the key entirely to Google, with nothing for the team to control. “Customer-supplied keys, sent with each query” is not offered by BigQuery, since customer-supplied keys work with Cloud Storage and Compute Engine. And “TLS on every connection” only protects data in transit, not the stored dataset.
A BigQuery dataset is set to use a customer-managed key from Cloud KMS, but creating a table fails with a permission error on the key. What is missing?
- Encrypter/Decrypter on the key for BigQuery
- BigQuery Admin for the analyst
- An immediate rotation of the key
- Turning off default encryption
Show the answer
Encrypter/Decrypter on the key for BigQuery
BigQuery's service account needs the CryptoKey Encrypter Decrypter role on the key, to encrypt and decrypt the table. “BigQuery Admin for the analyst” would give the analyst far more access, while BigQuery's service account would still be denied. “An immediate rotation of the key” would only create a new key version, with the same missing permission. And “Turning off default encryption” is not possible, since data at rest is always encrypted.
A partner uploads files to Cloud Storage, and insists that Google must never store its key, not even in Cloud KMS, while the files are still encrypted on Google’s servers. Which option fits?
- Google-owned and Google-managed keys
- A customer-managed key in Cloud KMS
- Customer-supplied encryption keys
- Encryption in transit with TLS
Show the answer
Customer-supplied encryption keys
With customer-supplied keys, the partner sends its key with each request, and Cloud Storage only keeps a hash of it. “Google-owned and Google-managed keys” would leave the keys with Google. “A customer-managed key in Cloud KMS” would store the key in Cloud KMS, which the partner refuses. And “Encryption in transit with TLS” only protects the files while they travel, not where they are stored.