Envelope encryption  |  Cloud KMS Documentation  |  Google Cloud (2024)

Introduction

Storing and encrypting data at Google's scale requires using a centralcryptographic key management service with multiple layers of keys for theencrypted data. An example of multiple layer of keys is envelope encryption,which is the process of encrypting a key with another key.

You can encrypt data at both the application layer, which is responsible fordisplaying data to users, and the storage layer, which provides the physicalstorage of data.

By default, at the storage layer, Google Cloud encryptscustomer content stored at rest using envelope encryption, with Google'sinternal key management service as the central keystore. If you're storing andencrypting data yourself, you can use Cloud Key Management Service as your centralkeystore at the application layer, which is the focus of this topic.

Cloud KMS stores keys in a key hierarchy designed for ease, withaccess to resources in the key hierarchy governed by Identity and Access Management.The following shows the main levels of a Cloud KMS key hierarchy:

Envelope encryption | Cloud KMS Documentation | Google Cloud (1)

Find out more about the key hierarchy at object hierarchy.

Data encryption keys

The key used to encrypt data itself is called a data encryption key (DEK).

Here are best practices for managing DEKs:

  • Generate DEKs locally.
  • When stored, always ensure DEKs are encrypted at rest.
  • For easy access, store the DEK near the data that it encrypts.
  • Generate a new DEK every time you write the data. This means you don't need torotate the DEKs.
  • Do not use the same DEK to encrypt data from two different users.
  • Use a strong algorithm such as 256-bit Advanced Encryption Standard (AES) inGalois Counter Mode (GCM).

Key encryption keys

The DEK is encrypted (also known as wrapped) by a key encryption key (KEK).The process of encrypting a key with another key is known as envelopeencryption.

Here are best practices for managing KEKs:

  • Store KEKs centrally.

  • Set the granularity of the DEKs they encrypt based on their use case. Forexample, consider a workload that requires multiple DEKs to encrypt theworkload's data chunks. You could use a single KEK to wrap all DEKs thatare responsible for that workload's encryption.

  • Rotate keys regularly, and also after a suspected incident. To learn more, seekey rotation.

Balancing DEKs and KEKs

Having a smaller number of KEKs than DEKs and using a central key managementservice makes storing and encrypting data at scale more manageable. A centralkey service also is a singular point to more easily audit and restrict dataaccess.

Depending on your situation, and the volume of data you are encrypting, you maychoose to use a similar model. A single KEK can be used to protect many DEKs;this model permits individual data objects to each have their own DEK withoutmassively increasing the volume of keys stored in a central key managementservice.

Cloud Key Management Service was designed to manage KEKs, and thus the maximum data inputsize for Encrypt and Decrypt functions is 64 KiB. However, for data that youknow will not approach that limit, you could use Cloud KMS toencrypt and decrypt data directly.

How to encrypt data using envelope encryption

The process of encrypting data is to generate a DEK locally, encrypt data withthe DEK, use a KEK to wrap the DEK, and then store the encrypted data and thewrapped DEK. The KEK never leaves Cloud KMS.

Envelope encryption | Cloud KMS Documentation | Google Cloud (2)

To encrypt data using envelope encryption:

  1. Generate a DEK locally. You could do this with an open source library such asOpenSSL, specifying a cipher type and a password from which to generate thekey. You can also specify a salt and digest to use, if desired.

  2. Use this DEK locally to encrypt your data.

    As an example, you could use OpenSSL as shown in the encrypting themessage example. For best practice, use 256-bit Advanced EncryptionStandard (AES-256) cipher in Galois Counter Mode (GCM).

  3. Generate a new key in Cloud KMS, or use an existing key, whichwill act as the KEK. Use this key to encrypt (wrap) the DEK.

  4. Store the encrypted data and the wrapped DEK.

How to decrypt data using envelope encryption

The process of decrypting data is to retrieve the encrypted data and the wrappedDEK, identify the KEK that wrapped the DEK, use the KEK to unwrap the DEK, andthen use the unwrapped DEK to decrypt the data. The KEK never leavesCloud KMS.

Envelope encryption | Cloud KMS Documentation | Google Cloud (3)

To decrypt data using envelope encryption:

  1. Retrieve the encrypted data and the wrapped DEK.

  2. Use the key stored in Cloud KMS to unwrap the encrypted DEK.

  3. Use the plaintext DEK to decrypt the encrypted data. If using OpenSSL asearlier, see the decrypting the message example.

For sample code that shows how to encrypt and decrypt with envelopeencryption, see Client-side encryption with Tink and Cloud KMS.

Integration with Google Cloud services

Several Google Cloud products are integrated with Cloud KMSto support Customer-Managed Encryption Key (CMEK) functionality. CMEK withCloud KMS adds an extra layer of protection for your data, providesyou with control of your encryption keys, and leverages the key managementbenefits of Cloud KMS. See Using Cloud KMS with otherservices to see a full list of products that support CMEK.

Other options for Google Cloud services

For data stored in Google Cloud products that do not support CMEK, youcan implement your own application-layer encryption. This requires implementingyour own envelope encryption as described above, so that you store dataencrypted locally in Google Cloud. This is also how you could useCloud KMS to encrypt data you store in other cloud serviceproviders or on premises.

In addition to supporting CMEK, the following products supportCustomer-Supplied Encryption Key (CSEK) functionality.

ProductCSEK topic
Cloud StorageCustomer-supplied encryption keys
Compute EngineEncrypt disks with customer-supplied encryption keys

With CSEK, you supply your own AES-256 key to serve as the KEK, and your keyprotects the DEKs that protect your data. Your CSEK key is protected by anadditional layer of protection, using a Cloud KMS key.

Now that you canimport keys into Cloud KMS, you canimport your keys and use them with CMEK-enabled services instead of relying onCSEK.

Envelope encryption  |  Cloud KMS Documentation  |  Google Cloud (2024)

FAQs

Does KMS use envelope encryption? ›

The process of encrypting data is to generate a DEK locally, encrypt data with the DEK, use a KEK to wrap the DEK, and then store the encrypted data and the wrapped DEK. The KEK never leaves Cloud KMS. To encrypt data using envelope encryption: Generate a DEK locally.

What is the encryption limit for KMS? ›

Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT . You can use this operation to encrypt small amounts of arbitrary data, such as a personal identifier or database password, or other sensitive information.

What is the best encryption method for cloud storage? ›

AES 128-, 192- and 256-bit are considered the most secure. Encryption solutions will use either use a symmetric encryption algorithm, in which the encryption and decryption keys are the same, or asymmetric encryption algorithm, in which the keys are linked, but different.

Is envelope encryption asymmetric? ›

The AWS Encryption SDK uses envelope encryption. It encrypts your data with a symmetric data key. It encrypts the symmetric data key with one or more symmetric or asymmetric wrapping keys. It returns an encrypted message that includes the encrypted data and at least one encrypted copy of the data key.

Why is envelope encryption better? ›

Protection under a combination of multiple algorithms Envelope encryption uses the best benefits from symmetric and public key algorithms to keep your keys secure. Symmetric key algorithms work faster, are more scalable, and more secure than public key algorithms.

What type of encryption does KMS use? ›

You set usage policies on these keys that determine which users can perform which actions under which conditions. AWS services and client-side toolkits that integrate with AWS KMS use a method known as envelope encryption to protect your data.

Is 10 GB the maximum size that can be encrypted in KMS? ›

There is an attached inline policy in the developers' IAM permissions that restricts them from uploading a file with a size of 10 GB or more. The IAM policy of the developer does not include the kms:Decrypt permission. 10 GB is the maximum size that can be encrypted in KMS.

Can KMS encrypt more than 4kb? ›

By design, AWS KMS provides low latency cryptographic operations on HSMs. Thus there is a limit of 4 KB on the amount of plaintext that can be encrypted in a direct call to the encrypt function. The AWS Encryption SDK can be used to encrypt larger messages.

Does KMS encrypt data at rest? ›

All AWS services offer the ability to encrypt data at rest and in transit. AWS KMS integrates with the majority of services to let customers control the lifecycle of and permissions on the keys used to encrypt data on the customer's behalf.

What is the best encryption tool for Google Drive? ›

Why GarbleCloud? GarbleCloud is the best encryption software for Google Drive, as it enhances existing security measures, for both personal and enterprise-level use.

What is the strongest encryption method? ›

AES 256-bit encryption is the strongest and most robust encryption standard that is commercially available today. While it is theoretically true that AES 256-bit encryption is harder to crack than AES 128-bit encryption, AES 128-bit encryption has never been cracked.

What is the most secure cloud storage in the world? ›

6 Most Secure Cloud Storage Solutions in 2024 Reviewed
  • IDrive: Best overall secure cloud storage solution.
  • pCloud: Best for extended storage functionalities.
  • OneDrive: Best for Microsoft systems integration.
  • Internxt: Best option for secure file sharing features.
  • Sync.com: Best for ease of use and administration.
Mar 21, 2024

How does KMS ensure data security through envelope encryption? ›

AWS KMS generates the data key. Then it encrypts a copy of the data key under a symmetric encryption KMS key that you specify. The operation returns a plaintext copy of the data key and the copy of the data key encrypted under the KMS key.

What is the envelope encryption technique? ›

Envelope encryption is the practice of encrypting data with a data encryption key (DEK)A cryptographic key used to encrypt data that is stored in an application. and then wrapping the DEK with a root keyA symmetric wrapping key that is used for encrypting and decrypting other keys that are stored in a data service.

How can you scale your cloud encryption? ›

How can you scale your cloud encryption?
  1. Choose the right encryption model.
  2. Implement encryption automation.
  3. Manage your encryption keys.
  4. Monitor and audit your encryption activities.
  5. Adopt encryption best practices.
  6. Here's what else to consider.
Jan 9, 2024

What protocol does KMS use? ›

By default, a KMS host is configured to use TCP on port 1688.

Does KMS use AES 256? ›

Symmetric KMS keys are 256-bit Advanced Encryption Standard (AES) keys that are not exportable. They spend their entire lifecycle entirely within AWS KMS.

What type of encryption does Windows EFS use? ›

To encrypt and decrypt files (or directories), EFS uses public key encryption technology. When a user requests to encrypt a file or folder, EFS generates an X. 509 certificate. This certificate has a private/public key pair that the RSA algorithm generates, with EFS as a key usage.

How does KMS know which key to use? ›

When you encrypt, KMS stores the CMK information in the ciphertextblob (CiphertextBlob: Ciphertext including metadata) as metadata. So while calling decrypt, KMS knows which CMK to use. in the encrypt document about the output: "CiphertextBlob -> (blob) The encrypted plaintext.

Top Articles
Understanding ROI: Return on Investment
CENTRE OF EXCELLENCE IN BLOCKCHAIN TECHNOLOGY
Cintas Pay Bill
Craftsman M230 Lawn Mower Oil Change
Baseball-Reference Com
Tcu Jaggaer
Https://Gw.mybeacon.its.state.nc.us/App
General Info for Parents
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
Mens Standard 7 Inch Printed Chappy Swim Trunks, Sardines Peachy
George The Animal Steele Gif
Think Up Elar Level 5 Answer Key Pdf
Nalley Tartar Sauce
ᐅ Bosch Aero Twin A 863 S Scheibenwischer
2016 Ford Fusion Belt Diagram
Michael Shaara Books In Order - Books In Order
Itziar Atienza Bikini
Bank Of America Financial Center Irvington Photos
No Hard Feelings - Stream: Jetzt Film online anschauen
Marine Forecast Sandy Hook To Manasquan Inlet
Free Personals Like Craigslist Nh
Pearson Correlation Coefficient
Dark Entreaty Ffxiv
Sessional Dates U Of T
Stubhub Elton John Dodger Stadium
Advance Auto Parts Stock Price | AAP Stock Quote, News, and History | Markets Insider
October 19 Sunset
Kltv Com Big Red Box
Cbs Trade Value Chart Week 10
Jambus - Definition, Beispiele, Merkmale, Wirkung
Shiftwizard Login Johnston
The Ride | Rotten Tomatoes
Craigslist Neworleans
Vip Lounge Odu
Boggle BrainBusters: Find 7 States | BOOMER Magazine
That1Iggirl Mega
877-292-0545
Leena Snoubar Net Worth
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Ds Cuts Saugus
Courtney Roberson Rob Dyrdek
Expendables 4 Showtimes Near Malco Tupelo Commons Cinema Grill
The Horn Of Plenty Figgerits
Swsnj Warehousing Inc
Doe mee met ons loyaliteitsprogramma | Victoria Club
Hughie Francis Foley – Marinermath
Fine Taladorian Cheese Platter
Identogo Manahawkin
Arre St Wv Srj
One Facing Life Maybe Crossword
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 6003

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.