Digital Envelopes: How an Encrypted Message Carries Its Own Key
A digital envelope packages an encrypted message with a protected copy of the key needed to read it. The message can travel openly because both its contents and the opening key have been scrambled.
The term describes a way of arranging encrypted data, rather than a particular email attachment or visible envelope icon. Encryption scrambles information using a key, a data value that controls the calculation.
Two encryption jobs, two kinds of key
One common approach starts with a freshly generated symmetric key. The same secret key encrypts and decrypts the message, turning readable information into scrambled data and back again.
The sender then encrypts that key using the recipient's public key, a value the recipient can share. Recovering it requires the matching private key, which the recipient keeps secret.
The resulting package contains the encrypted message and the encrypted message key. The recipient first recovers the message key, then uses it to read the contents.
The Cryptographic Message Syntax standard, or CMS, defines this arrangement and other ways to protect the message key. CMS is a format for packaging protected messages, not a particular email service.
Two Keys: One You Share, One You Guard
Using symmetric encryption for the larger message is efficient; public-key encryption handles the much smaller key. This combination is called hybrid encryption, and Amazon's encryption documentation explains why the two methods work well together.
One report, several recipients
Suppose a laboratory needs to send the same private report to three researchers. Its software can encrypt the report once and protect a separate copy of the message key for each researcher.
Each person uses their own private key to recover the same message key. The package doesn't need three separately encrypted copies of the entire report.
The small recipient-specific parts are the different ways into the same protected contents. Adding another recipient means creating another permitted way to recover the message key, so choosing the right recipient keys matters.
A public key also needs a trustworthy connection to its owner. If the sender accepts an impostor's key, it can carefully encrypt the report for the wrong person.
- Understand what AES, RSA and hashing actually do before you rely on them.
- Learn to spot the mistakes that break real-world encryption.
- Get a practical introduction to modern encryption in one book.
A closed envelope doesn't identify its sender
Anyone who has your public key can use it to prepare a message for you. Successfully opening that message therefore doesn't, by itself, prove who sent it.
A digital signature supplies separate evidence that a message was signed using a particular private key. Its value as identity evidence depends on trusting the connection between the matching public key and the claimed sender.
There's a separate question about changes to the contents. Authenticated encryption combines secrecy with a check that detects tampering; simply calling a package a “digital envelope” doesn't tell you whether that check is included.
The authenticated-envelope extension to CMS includes that protection and requires checking it before releasing the recovered contents.
The same idea appears in stored data
Cloud systems also use envelope encryption: one key encrypts the data, and another protects that key. The second is often called a wrapping key because it wraps the first in encryption.
It doesn't have to be a person's public key. Google's envelope-encryption guide describes keeping the wrapping key in a key-management service while storing encrypted data alongside its wrapped data key.
The useful question is who can make that service release or use the key. A safely stored encrypted file can still be exposed through an account that has permission to open it.
Hybrid Encryption: Two Kinds of Keys, One Protected Message

A Symmetric Key Has a Life Beyond the Encrypted File

Public-Key Encryption: A File for the Intended Reader

QUOTE:
"Amateurs hack systems, professionals hack people."
