Data in a system lives in two states: it rests on disks or moves between services and users. Each state needs protection of its own: encryption at rest covers a stolen disk or a copy of a database, encryption in transit — intercepted traffic. Both measures appear in most security requirements, from PCI DSS to corporate policies.
Encryption at rest
Data at rest is data that does not move: files, databases, backups, snapshots, logs. It can be encrypted at different levels, and each level protects against something different:
| Level | Examples | Protects against |
|---|---|---|
| Disk or volume | LUKS on Linux, BitLocker on Windows, cloud disk encryption | seizure or loss of the entire storage medium |
| Database | transparent data encryption (TDE) in SQL Server, Oracle, MySQL | a copy of the database files taken without going through the DBMS |
| Application | encryption of individual fields by the application itself, with the keys held in code | reading the data even by those with access to the database |
The disk level is the simplest: it is transparent to applications and covers the “stolen server” scenario. But once the file system is mounted, the operating system sees the data decrypted — disk encryption does not protect against unauthorised access to a running system. Nor does it protect against ransomware: an attacker who gets into the system reads the data just like the application does — which is why backups are kept separately and offline.
Encryption in transit
Data in transit is data that travels over the network: between user and server, between services, between data centres. The main tool is TLS: the task of the protocol defined in RFC 8446 is a secure channel between two parties. On the internet almost all traffic is protected with it, and inside the infrastructure mutual authentication with mTLS is often added on top. Between sites and offices data usually travels inside VPN tunnels, for example over IPsec. One nuance: if TLS terminates at the load balancer and the traffic then travels in plaintext to the service, the data inside the perimeter is unprotected.
Who holds the keys
Encryption helps exactly as long as the keys do not leak together with the data. That is why keys are stored separately — in a key management service (KMS) or a hardware security module (HSM) — and in the cloud you choose between provider-managed and customer-managed keys. Your own keys give full control over the lifecycle: the provider physically stores the data but can no longer read it without the key.
Sources
the term is written from these pages- NIST SP 800-111 — Guide to Storage Encryption Technologies for End User Devicescsrc.nist.gov/pubs/sp/800/111/final(opens in a new tab)
- PostgreSQL — Encryption Optionspostgresql.org/docs/current/encryption-options.html(opens in a new tab)
- AWS Well-Architected — Protecting data at restdocs.aws.amazon.com/wellarchitected/latest/security-pillar/protecting-data-at-rest.html(opens in a new tab)
Verified 9 Nov