Bookmarks

Encryption at rest and in transit

encryption at rest, encryption in transit

Protection of data in two states: at rest — on disks, in databases and backups; in transit — in communication channels, most often over TLS.

Also: data at rest, data in transit, encryption of data at rest, encryption of data in transit

checked 9 Nov

All terms

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:

LevelExamplesProtects against
Disk or volumeLUKS on Linux, BitLocker on Windows, cloud disk encryptionseizure or loss of the entire storage medium
Databasetransparent data encryption (TDE) in SQL Server, Oracle, MySQLa copy of the database files taken without going through the DBMS
Applicationencryption of individual fields by the application itself, with the keys held in codereading 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

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • E2EEend-to-end encryption

    E2EE is the extreme case of encryption in transit: only the sender and the recipient can decrypt, not even the service provider.

  • KMSkey management service

    KMS is a service that stores keys and manages them; encryption at rest itself is carried out by disks, databases and applications, using those keys.

  • TLSTLS protocol

    TLS is a specific protocol; encryption in transit is the task usually solved with it, but VPNs solve it with other protocols as well.

In depth in the references

where the topic is covered in detail