← Concepts
Security·3 min read

Encryption in Transit & at Rest

Encrypt data on the wire (TLS) and on disk (at-rest) so neither a network eavesdropper nor a stolen drive yields plaintext.

First time reading this? Start here

Plain English: encryption in transit (TLS/HTTPS) scrambles data while it travels the network so eavesdroppers can't read it. Encryption at rest scrambles data sitting on disk so a stolen drive or leaked backup is useless. You need both, since they protect against different attackers.

Used in:Payment GatewayWhatsAppAmazon S3 (Object Storage)
What it is

Two complementary protections. Encryption in transit secures data moving over a network (TLS for HTTP, mTLS between services) so anyone sniffing the wire sees ciphertext. Encryption at rest secures stored data (disk/volume encryption, database/field-level encryption, encrypted backups) so anyone who obtains the physical media or files can't read them. Symmetric crypto (AES) does the bulk work; asymmetric crypto and key management handle key exchange and rotation.

The problem it solves

Data is exposed in two places: while moving and while sitting still. A network attacker can intercept unencrypted traffic; a thief, insider, or misconfigured bucket can expose unencrypted storage. In-transit encryption defeats eavesdropping and tampering on the wire; at-rest encryption defeats stolen-disk, leaked-backup, and snapshot-exposure scenarios. Compliance regimes (PCI-DSS, HIPAA, GDPR) generally mandate both.

How it works

In transit: TLS does an asymmetric handshake to authenticate the server (via certificates) and agree a symmetric session key, then encrypts the stream with AES; mTLS adds client-cert authentication for service-to-service. At rest: data is encrypted with a symmetric data key before hitting disk; that data key is itself encrypted by a master key held in a KMS/HSM (envelope encryption), enabling rotation without re-encrypting everything. Sensitive fields can be encrypted at the application layer so even the database never sees plaintext.

Why use it
What it costs you
Where it shows up in our architectures
Gotchas

Your notes

Private to you