Encryption, privacy, and sovereignty
Professional Data Engineer · Lesson 2 of 23 · 9:41
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 Professional Data Engineer exam, on the official exam guide. In this lesson: encryption at rest and in transit, customer-managed keys (CMEK) and Cloud External Key Manager, personal data with Sensitive Data Protection and de-identification, data sovereignty with location policies, and compliance with Assured Workloads. Includes three original practice questions, with Cymbal Mobility, a fictional ride-hailing and scooter company, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Rider data in Europe
Cymbal Mobility stores the names, emails, and card details of millions of riders, and its European riders' data must stay in Europe. The security team wants to control the encryption keys, and the analysts still need to study trips. So this lesson protects the data itself: who holds the keys, what analysts may see, and where the data is stored.
Encryption by default
Google Cloud encrypts all data at rest by default, with AES-256, and it encrypts data in transit between its data centers. With the default setting, Google manages the keys for you, and nothing is needed. With customer-managed encryption keys, or CMEK, you create the key in Cloud Key Management Service, and services like BigQuery, Cloud Storage, Pub/Sub, and Dataflow use it. With Cloud External Key Manager, the key stays in a key manager outside Google, so Google cannot use it without your system's approval. Each step gives you more control, and more work.
Managing keys
With CMEK, you decide when the key rotates, who may use it, and when it is disabled or destroyed. If you disable or destroy the key, the data it protects can no longer be read, which is sometimes called crypto-shredding. Keep the key in the same location as the data it protects, and separate the people who manage keys from the people who manage data. And when a regulation asks for hardware security modules, Cloud HSM keeps the keys in certified hardware.
Personal data
Personal data needs more than encryption. Sensitive Data Protection, which includes the service once called Cloud DLP, discovers and profiles BigQuery tables and storage buckets, to find columns that hold emails, card numbers, or other kinds of personal data. Then it can de-identify them. Masking or redaction hides values, bucketing replaces exact values with ranges, like an age band, and date shifting moves dates while keeping the gaps between them. Pseudonymization replaces a value with a token: with deterministic encryption, or format-preserving encryption, the same email always gives the same token, so tables still join, and someone with the key can reverse it. And the best protection is data you never collect: keep only what the business needs.
Sovereignty and compliance
Sovereignty starts with location. Choose the region or multi-region of every dataset and bucket, remember that a dataset's location is fixed at creation, and enforce it with an organization policy on resource locations. For regulated workloads, Assured Workloads applies a package of controls to a folder, covering data residency, key management, and which Google personnel may access the data. VPC Service Controls draws a perimeter around projects, so that data in BigQuery or Cloud Storage cannot be copied to a project outside it, even with a valid credential. Compliance is shared: Google certifies its platform, and you configure your own resources. And audit logs show who accessed which data.
Recap
Let's recap. Google encrypts all data at rest and in transit by default, with keys it manages. CMEK puts the key in your Cloud Key Management Service, so you control its rotation, and disabling it makes the data unreadable. Sensitive Data Protection finds personal data, and de-identifies it by masking, bucketing, date shifting, or tokens that still join. Location is set per dataset and enforced by organization policy, and Assured Workloads adds controls for regulated workloads. And VPC Service Controls perimeters stop data from leaving, even with valid credentials.
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 when the key rotates, and be able to make trip data unreadable at once, by switching the key off. What should the data engineer set up?
- Default encryption with Google-managed keys
- Narrower BigQuery roles for every analyst
- A customer-managed key in Cloud KMS
- Dynamic data masking on the card columns
Show the answer
A customer-managed key in Cloud KMS
A customer-managed key in Cloud Key Management Service lets the team rotate it, and disable it to make the data unreadable. “Default encryption with Google-managed keys” is the default, where Google controls the keys and their rotation. “Narrower BigQuery roles for every analyst” is only an access control, and the data stays readable to anyone who still has a role. And “Dynamic data masking on the card columns” would mask a few columns, while the rest of the data stays readable.
Analysts must count trips per rider across several tables, but must never see a rider’s real email address. Which technique fits best?
- Deterministic encryption of the email
- Masking every email with the same symbols
- Date shifting on the email column
- Customer-managed keys on the tables
Show the answer
Deterministic encryption of the email
Deterministic encryption gives the same token for the same email, so analysts can still join and count, without seeing the address. “Masking every email with the same symbols” would hide the emails, but every value looks the same, so the joins break. “Date shifting on the email column” only applies to dates, not to email addresses. And “Customer-managed keys on the tables” would protect the stored file, while analysts still read the real emails.
The security team fears that a stolen credential, with valid roles, could be used to copy BigQuery tables into a project outside the company. What reduces this risk?
- An organization policy on resource locations
- Customer-managed encryption keys
- Sensitive Data Protection discovery scans
- A VPC Service Controls perimeter
Show the answer
A VPC Service Controls perimeter
A VPC Service Controls perimeter blocks copies of data to projects outside it, even with valid roles. “An organization policy on resource locations” is useful, but it only controls where new resources are created, not where data is copied. “Customer-managed encryption keys” would protect the data at rest, while a valid credential still reads it. And “Sensitive Data Protection discovery scans” only finds personal data, without stopping any copy.