Platform

Platform overview How it works Authorization testing Evidence & reports Private scanning Integrations

Solutions

Security agencies Product teams Regulated industries Partner programme

Learn

Blog Knowledge hub Compare

Resources

Pricing Documentation Help centre FAQ Security & data What we haven’t proved

Company

About Contact Careers Sign in to the platform Start a $199 pilot →

Home / Knowledge hub / Envelope encryption

Knowledge hub

Envelope encryption

Encrypting data with a data key, then encrypting that key with a master key.

Illustration explaining Envelope encryption

What it means

Envelope encryption uses two layers of keys. A data key encrypts the actual data. A second, more closely guarded key, often called a master key or key-encryption key, encrypts the data key. The encrypted data key is stored next to the data it protects.

The idea is to keep the powerful key in one controlled place. Large amounts of data are encrypted locally with a fast key, while only the small data key ever travels to the key service to be wrapped or unwrapped.

Why it matters

Changing the master key becomes cheap. You re-wrap the small data keys instead of re-encrypting terabytes of data. It also limits damage, because a leaked data key exposes one object or one customer, not everything you store.

Auditors and enterprise buyers ask how keys are protected and who can use them. A design where the master key never leaves a managed service, and every use of it is logged, is a far easier answer than a key sitting in a config file.

How it shows up

You meet it inside cloud storage, databases and key management services, where it is usually on by default. In your own code it appears when you encrypt fields or files and keep the wrapped key beside the record. The master key stays in a managed service or a hardware module.

The mistakes repeat. The plain data key is written to a log or left in memory dumps. One data key protects every record, which removes the benefit. The master key can be used by far too many roles. Check who may call decrypt, and whether that use is logged.

Questions people ask

Envelope encryption, answered

Is envelope encryption the same as double encryption?

No. The data is encrypted once, with the data key. What gets encrypted a second time is the key, not the data.

The second layer exists to protect and manage the key, not to make the data harder to break.

Why not just use one key for everything?

One key means one leak exposes everything, and changing it means re-encrypting all the data. It also means that key has to be handed to every system that needs to read anything.

Separate data keys and a protected master key limit both the damage and the work.

Where is the master key kept?

Usually in a key management service or a hardware security module, so it is used there and never exported. Applications ask the service to wrap or unwrap a data key.

This is how the major cloud key services describe the pattern.

Does envelope encryption protect us if the application is breached?

Not by itself. If an attacker takes over the app, they can ask the key service to decrypt as the app would. The protection is against stolen disks, backups and database copies.

Who is allowed to call decrypt matters as much as the encryption.

How does this relate to key rotation?

Key rotation of the master key only requires re-wrapping the data keys. The data itself stays as it is.

Rotating data keys is a separate, heavier job, done when a data key is suspected to be exposed.

Cyberlop mark

Who is allowed to decrypt?

Keys are only as safe as the code and permissions around them. We find vulnerabilities in your web app and its APIs and prove each by exploiting it. Ask us to run it on one of your applications.

Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.