# US 11,310,035 B2 · Securing data at rest utilizing cloud provider service agnostic encrypted data transportability

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,310,035 B2
- Document ID: US11310035B2
- Status: Granted
- Kind: B2
- Application number: 16/223,622
- Filed: 2018-12-18
- Published: 2020-06-18
- Granted: 2022-04-19
- Earliest claimed: 2018-12-18
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Shaunak Mistry
- Web page: https://patentgrep.com/patent/US11310035B2

## CPC

- H04L 9/0822: {using key encryption key}
- H04L 9/083: {involving central third party, e.g. key distribution center [KDC] or trusted third party [TTP]}
- H04L 9/0869: {involving random numbers or seeds}
- H04L 9/0894: {Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage}
- H04L 9/14: using a plurality of keys or algorithms
- H04L 9/3242: {involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC}
- H04L 63/0428: {wherein the data content is protected, e.g. by encrypting or encapsulating the payload}
- H04L 63/0478: {applying multiple layers of encryption, e.g. nested tunnels or encrypting the content with a first key and then with at least a second key (cryptographic mechanisms or cryptographic arrangements using a plurality of keys or algorithms H04L9/14)}
- H04L 63/06: {for supporting key management in a packet data network (cryptographic mechanisms or cryptographic arrangements for key management H04L9/08)}
- H04L 63/123: {received data contents, e.g. message integrity}
- H04L 2463/062: applying encryption of the keys
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Securing at rest data on a cloud hosted server includes, for each cloud hosted instance of a computer program, creating a key encrypted key (KEK) using a unique customer master key (CMK) corresponding to the instance, but only an encrypted form of the KEK is persisted in a database for the corresponding instance whereas the unencrypted KEK is retained in memory of the encryption process only. Thereafter, in response to a request to persist data by a corresponding instance of the computer program, a data key (DK) is randomly generated and encrypted with the KEK in memory for the corresponding instance. The data itself also is encrypted with the DK and an envelope with the encrypted DK and the encrypted data returned to the requestor, thus ensuring that the data and the encryption keys are never moved or persisted in an un-encrypted form.

## Claims

### Claim 1

A method for persisting data at rest in encrypted form, the method comprising:
receiving, in memory of a computer from over a computer communications network, by an encryption process, a customer master key for a corresponding instance of a computer program executing remotely over the computer communications network;
transmitting, over the computer communications network by the encryption process to a key management service that is separate from the encryption process, the customer master key as part of a request for a key encryption key associated with the customer master key;
receiving, from the key management service, in the memory of the computer, both an unencrypted form of the key encryption key and an encrypted form of the key encryption key, wherein the unencrypted form of the key encryption key is recoverable by decrypting the encrypted form of the key encryption key using the customer master key;
storing the encrypted form of the key encryption key in a database for the computer program;
storing the unencrypted form of the key encryption key in the memory of the computer;
subsequently receiving from the instance of the computer program in the encryption process, unencrypted data to be stored in the database for the computer program; and
responding to the receipt of the unencrypted data by the encryption process by:
generating a data key using a randomly generated key;
encrypting the data key with the unencrypted form of the key encryption key;
encrypting the received unencrypted data with the data key;
generating a first hash message authentication code using the unencrypted form of the key encryption key and the customer master key;
creating an encrypted data envelope with the encrypted data key, the first hash message authentication code, and the encrypted data; and
returning to the instance of the computer program, only the encrypted data envelope without returning the data key.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
receiving from the instance of the computer program in the encryption process, a decryption request in respect to the encrypted data envelope; and
responding to the receipt of the encrypted data envelope by the encryption process by:
splitting the encrypted data envelope into the encrypted data key and the encrypted data;
retrieving the unencrypted form of the key encryption key;
decrypting the encrypted data key with the retrieved key encryption key to produce the data key;
decrypting the encrypted data with the data key to produce the unencrypted data; and
returning to the instance of the computer program, the unencrypted data.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
generating a transportable backup of the database by:
receiving from a requestor of the transportable backup, an encrypted form of a database master key;
requesting the key management service to decrypt the encrypted form of the database master key and receiving in return, the database master key;
encrypting the key encryption key with the database master key;
storing the database master key encrypted form of the key encryption key in the database; and
returning to the requestor an indication of success, the requestor creating a backup of the database including the database master key encrypted form of the key encryption key.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
restoring the backup by:
receiving from a restored form of the database the database master key encrypted form of the key encryption key;
decrypting the database master key encrypted form of the key encryption key with the database master key to produce the key encryption key; and
transmitting over the computer communications network by the encryption process to the key management service the customer master key as part of the request for the key encryption key and receiving in the memory of the computer in response, both the key encryption key and the encrypted form of the key encryption key by:
storing the encrypted form of the key encryption key in the database; and
deleting the database master key from the memory.

### Claim 5 (depends on 1)

The method of claim 1, wherein the encrypted data envelope comprises the encrypted form of the key encryption key and the first hash message authentication code generated by the key encryption key and the customer master key, so that the encrypted data envelope is validated by:
a subsequent opening of the encrypted data envelope;
decrypting the encrypted form of the key encryption key with the customer master key to produce the unencrypted form of the key encryption key;
the generation of a second hash message authentication code with the key encryption key and the customer master key; and
a comparison of the first and second hash message authentication codes.

### Claim 6

A data processing system adapted for persisting data at rest in encrypted form comprising:
a computer with memory and at least one processor; and
an encryption process comprising computer program instructions executing in the memory performing:
receiving, from over a computer communications network, a customer master key for a corresponding instance of a computer program executing remotely over the computer communications network;
transmitting, over the computer communications network to a key management service that is separate from the encryption process, the customer master key as part of a request for a key encryption key associated with the customer master key;
receiving, from the key management service, in the memory, both an unencrypted form of the key encryption key and an encrypted form of the key encryption key, wherein the unencrypted form of the key encryption key is recoverable by decrypting the encrypted form of the key encryption key using the customer master key;
storing the encrypted form of the key encryption key in a database for the computer program;
storing the unencrypted form of the key encryption key in the memory;
subsequently receiving from the instance of the computer program in the encryption process, unencrypted data to be stored in the database for the computer program; and
responding to the receipt of the unencrypted data by the encryption process by:
generating a data key using a randomly generated key;
encrypting the data key with the unencrypted form of the key encryption key;
encrypting the received unencrypted data with the data key;
generating a first hash message authentication code using the unencrypted form of the key encryption key and the customer master key;
creating an encrypted data envelope with the encrypted data key, the first hash message authentication code, and the encrypted data; and
returning to the instance of the computer program, only the encrypted data envelope without returning the data key.

### Claim 7 (depends on 6)

The system of claim 6, wherein the encryption process further performs:
receiving from the instance of the computer program a decryption request in respect to the encrypted data envelope; and
responding to the receipt of the encrypted data envelope by:
splitting the encrypted data envelope into the encrypted data key and the encrypted data;
retrieving the unencrypted form of the key encryption key;
decrypting the encrypted data key with the retrieved key encryption key to produce the data key;
decrypting the encrypted data with the data key to produce the unencrypted data; and
returning to the instance of the computer program, the unencrypted data.

### Claim 8 (depends on 6)

The system of claim 6, wherein the encryption process further performs:
generating a transportable backup of the database by:
receiving from a requestor of the transportable backup, an encrypted form of a database master key;
requesting the key management service to decrypt the encrypted form of the database master key and receiving in return, the database master key;
encrypting the key encryption key with the database master key;
storing the database master key encrypted form of the key encryption key in the database; and
returning to the requestor an indication of success, the requestor creating a backup of the database including the database master key encrypted form of the key encryption key.

### Claim 9 (depends on 8)

The system of claim 8, wherein the encryption process further performs:
restoring the backup by:
receiving from a restored form of the database the database master key encrypted form of the key encryption key;
decrypting the database master key encrypted form of the key encryption key with the database master key to produce the key encryption key; and
transmitting over the computer communications network by the encryption process to the key management service the customer master key as part of the request for the key encryption key and receiving in the memory of the computer in response, both the key encryption key and the encrypted form of the key encryption key by:
storing the encrypted form of the key encryption key in the database; and
deleting the database master key from the memory.

### Claim 10 (depends on 6)

The system of claim 6, wherein the encrypted data envelope comprises the encrypted form of the key encryption key and the first hash message authentication code generated by the key encryption key and the customer master key, so that the encrypted data envelope is validated by:
a subsequent opening of the encrypted data envelope;
decrypting the encrypted form of the key encryption key with the customer master key to produce the unencrypted form of the key encryption key;
the generation of a second hash message authentication code with the unencrypted form of the key encryption key and the customer master key; and
a comparison of the first and second hash message authentication codes.

### Claim 11

A computer program product for persisting data at rest in encrypted form, the computer program product including a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a device to cause the device to perform a method including:
receiving in memory of a computer from over a computer communications network, by an encryption process, a customer master key for a corresponding instance of a computer program executing remotely over the computer communications network;
transmitting over the computer communications network by the encryption process to a key management service that is separate from the encryption process, the customer master key as part of a request for a key encryption key associated with the customer master key;
receiving, from the key management service, in the memory of the computer, both an unencrypted form of the key encryption key and an encrypted form of the key encryption key, wherein the unencrypted form of the key encryption key is recoverable by decrypting the encrypted form of the key encryption key using the customer master key;
storing the encrypted form of the key encryption key in a database for the computer program;
storing the unencrypted form of the key encryption key in the memory;
subsequently receiving from the instance of the computer program in the encryption process, unencrypted data to be stored in the database for the computer program; and
responding to the receipt of the unencrypted data by the encryption process by:
generating a data key using a randomly generated key;
encrypting the data key with the unencrypted form of the key encryption key;
encrypting the received unencrypted data with the data key;
generating a first hash message authentication code using the unencrypted form of the key encryption key and the customer master key;
creating an encrypted data envelope with the encrypted data key, the first hash message authentication code, and the encrypted data; and
returning to the instance of the computer program, only the encrypted data envelope without returning the data key.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein the device further performs:
receiving from the instance of the computer program in the encryption process, a decryption request in respect to the encrypted data envelope; and
responding to the receipt of the encrypted data envelope by the encryption process by:
splitting the encrypted data envelope into the encrypted data key and the encrypted data;
retrieving the unencrypted form of the key encryption key;
decrypting the encrypted data key with the retrieved key encryption key to produce the data key;
decrypting the encrypted data with the data key to produce the unencrypted data; and
returning to the instance of the computer program, the unencrypted data.

### Claim 13 (depends on 11)

The computer program product of claim 11, wherein the device further performs:
generating a transportable backup of the database by:
receiving from a requestor of the transportable backup, an encrypted form of a database master key;
requesting the key management service to decrypt the encrypted form of the database master key and receiving in return, the database master key;
encrypting the key encryption key with the database master key;
storing the database master key encrypted form of the key encryption key in the database; and
returning to the requestor an indication of success, the requestor creating a backup of the database including the database master key encrypted form of the key encryption key.

### Claim 14 (depends on 13)

The computer program product of claim 13, wherein the device further performs:
restoring the backup by:
receiving from a restored form of the database the database master key encrypted form of the key encryption key;
decrypting the database master key encrypted form of the key encryption key with the database master key to produce the key encryption key; and
transmitting over the computer communications network by the encryption process to the key management service the customer master key as part of the request for the key encryption key and receiving in the memory of the computer in response, both the key encryption key and the encrypted form of the key encryption key by:
storing the encrypted form of the key encryption key in the database; and
deleting the database master key from the memory.

### Claim 15 (depends on 11)

The computer program product of claim 11, wherein the encrypted data envelope comprises the encrypted form of the key encryption key and the first hash message authentication code generated by the key encryption key and the customer master key, so that the encrypted data envelope is validated by:
a subsequent opening of the encrypted data envelope;
decrypting the encrypted form of the key encryption key with the customer master key to produce the unencrypted form of the key encryption key;
the generation of a second hash message authentication code with the unencrypted form of the key encryption key and the customer master key; and
a comparison of the first and second hash message authentication codes.
