Open the Envelope: How transform encryption works with envelope encryption.
Tags: encryption, cryptography, infographic, howitworks
Published: 2018-10-18 16:55:07

---
title: Open the Envelope: How transform encryption works with envelope encryption.
published: true
description: How transform encryption works with envelope encryption.
tags: encryption, cryptography, infographic, how it works
---

# Open the Envelope
## How transform encryption works with envelope encryption.

_This article was first published on Medium, take a look [here](https://blog.ironcorelabs.com/open-the-envelope-1c6e4feecf22). Enjoy!_

[Download Envelope encryption + Transform encryption infographic here.](https://docs.ironcorelabs.com/images/envelope-encryption/infographic-envelope-encryption.jpg)

### Envelope Encryption

Envelope encryption is a technique that combines symmetric and asymmetric encryption to improve performance.

![AES-Encrypts-Doc][AES-Encrypts-Doc]

A key value suitable for use with a symmetric encryption algorithm such as AES is chosen randomly, then it is used to encrypt plaintext. This plaintext is referred to as the document, and the key is called the document encryption key (DEK).

![EncryptDEK][EncryptDEK]

The DEK itself is then asymmetrically encrypted with a user’s public key. The resulting encrypted DEK can be stored with the data or elsewhere.

![DecryptDEK][DecryptDEK]

To recover the document the encrypted DEK is first decrypted using the user’s private key.

![DEKDecryptsDoc][DEKDecryptsDoc]

Once the DEK is recovered, it can be used to decrypt the underlying document data.

### Encrypting to Groups: Transform Encryption

The disadvantage of public key cryptography is that every user that a document will be shared with must be known before the document is encrypted to them. If data is encrypted to multiple users, it must be separately encrypted with each user’s public key. To revoke user access, we must possess and change the underlying data (and all its copies).

To address these disadvantages, combine transform encryption with public key cryptography when encrypting to multiple users. Transform encryption encrypts the DEK to an arbitrary entity called a group and later transforms the encrypted DEK from the group to the single user.

A transform service uses a transform key to perform the “Encrypted DEK — group” to “Encrypted DEK — user” mapping, the DEK is not decrypted in this process, it is a ciphertext-to-ciphertext transform.

![TransformKey][TransformKey]

After the encrypted DEK is transformed from group to user, the user’s private key can be used to decrypt the encrypted DEK. The DEK is then used to decrypt the document.

### Glossary terms:

#### Symmetric Encryption
Symmetric encryption uses one key for both encryption and decryption. It is fast and straightforward. The main drawback is that users must find a way to share the symmetric key securely.

#### Asymmetric Encryption
Asymmetric encryption uses two keys that are mathematically related (generally called a key pair). Plaintext or document data is encrypted with the public key and decrypted using the corresponding private key.

#### Public Key Encryption
Public key encryption is another name for asymmetric encryption. It is called public key cryptography because the encryption key can be shared publicly, while the decryption key must be kept private.

[AES-Encrypts-Doc]: https://thepracticaldev.s3.amazonaws.com/i/79axwo38khljznczhzgz.jpg "Random AES Key Encrypts Document"

[EncryptDEK]: https://thepracticaldev.s3.amazonaws.com/i/0uocl3sl76g1zmzr4d47.jpg "User public key encrypts document encryption key"

[DecryptDEK]: https://thepracticaldev.s3.amazonaws.com/i/uisq63z5c1j4hlg5nvl7.jpg "User private key decrypts the document encryption key"

[DEKDecryptsDoc]: https://thepracticaldev.s3.amazonaws.com/i/9ptlrcvh47pug877kln4.jpg "Document encryption key decrypts document"

[TransformKey]: https://thepracticaldev.s3.amazonaws.com/i/m4eih1bal09uawhctixw.jpg "Key transformed from group to user"