Scramble stored data, so a stolen disk or backup is useless without the key.
Encryption at rest means the data is scrambled while it is stored on disks, in databases and in backups. Without the key, what is stored looks like random noise.
Data lives in three states. In transit it moves over the network (protected by TLS). In use it is in memory while a program works on it. At rest it sits on a disk, in a database file, in object storage or in a backup. Encryption at rest covers that last state.
The idea is simple: use an encryption key to turn readable data (plaintext) into unreadable data (ciphertext). Only someone with the key can turn it back. If a disk is stolen, a backup bucket is made public by mistake, or a decommissioned drive is sold, the attacker gets only ciphertext.
Doing this well is mostly a key management problem. A strong lock is no use if the key is taped to the door. So large systems use envelope encryption: a unique data encryption key (DEK) encrypts the data, and a key encryption key (KEK), the master key, encrypts the DEK. The master key stays inside a Key Management Service (KMS) or a hardware security module (HSM) and is never handed out. The app asks the KMS to unwrap a DEK when it needs it.
| Level | What it protects against | What it does not protect against |
|---|---|---|
| Full-disk / volume | A stolen or lost disk, a discarded server | Anyone who can log in to the running machine, and a database admin |
| Database (TDE) or storage service | Stolen database files and backups | Anyone who can run queries as an allowed user |
| Application / field-level | Database admins, leaked backups, SQL injection that reads raw rows | A hacked app that holds the key (and you lose easy search and sorting on those fields) |
| Client-side (end-to-end) | Even the service provider cannot read the data | A lost user key means lost data, and search and server features are limited |
| Option | Who manages the key | Good and bad |
|---|---|---|
| Provider-managed keys | The cloud provider, automatically | Easiest and on by default. You have less control and a weaker story for strict rules. |
| Customer-managed keys (KMS) | You, in the provider's KMS | You set who can use the key, can rotate or disable it, and get an audit log. A bit more work. |
| Bring or hold your own key | You, in your own HSM or outside the cloud | Maximum control. Highest cost and the most ways to lose the key by mistake. |
Toy cipher for teaching only. It is not real cryptography.
Speeds are made-up illustrative numbers (2 TB of re-encryption per hour, 100 key re-wraps per second). The point is the shape: re-wrapping small keys is cheap, re-encrypting data is not.
| Term | Meaning in easy words |
|---|---|
| Plaintext / ciphertext | Readable data, and the scrambled version of it |
| Encryption at rest | Encrypting data while it is stored on disk, in a database or in a backup |
| Encryption in transit | Protecting data while it moves over a network, usually with TLS |
| DEK (data encryption key) | The key that directly encrypts the data |
| KEK / master key | A key that encrypts other keys, such as DEKs |
| Envelope encryption | Encrypting data with a DEK and encrypting the DEK with a master key |
| KMS | A Key Management Service that creates, stores, rotates and audits keys |
| HSM | A hardware security module: a tamper-resistant device that holds keys and does crypto inside it |
| Key rotation | Replacing a key with a new one on a schedule or after a leak |
| TDE | Transparent data encryption: the database encrypts its own files for you |
| Field-level encryption | The application encrypts chosen fields before they reach the database |
| Choice | We gain | We lose |
|---|---|---|
| Provider-managed keys | No effort, on by default | Less control and weaker proof for strict rules |
| Customer-managed keys | Control, rotation and audit | More set-up, and a key mistake can lock you out |
| Field-level encryption | The database and its admins never see plaintext | No easy search, sort or join on those fields, and the app must manage keys |
| Full-disk only | Simple and covers everything on the device | Protects only against theft of the device |
| One key for everything | Easy to manage | One leak exposes everything |
| Many keys (per customer or table) | Small blast radius, easy per-customer deletion | More keys to track and rotate |