Data needs protection in transit (TLS) and at rest (disk/database encryption)—keys managed separately from ciphertext.
At rest
Database TDE, encrypted EBS/RDS, S3 SSE—protects stolen drives/backups; does not replace access control.
Key management
Use KMS/HSM; rotate keys; never commit keys to git—see secrets lesson.
Hashing vs encryption
Hashing is one-way (passwords); encryption is reversible with the key (data storage).
Important interview questions and answers
- Q: Encryption at rest stops DB admin?
A: No—authorized DB users still read data; encryption helps physical theft scenarios. - Q: KMS?
A: Cloud key management service with audit and rotation.
Self-check
- Transit vs at rest?
- Hashing vs encryption use case?
Tip: Encryption at rest does not replace RBAC on the database.
Interview prep
- At rest vs transit?
Disk/DB encryption vs TLS on the wire.