Which cryptographic practice is recommended for protecting sensitive data at rest in a relational database?
Trap 1: Using cleartext with database permissions
Cleartext leaves values readable to anyone with file or backup access, and database permissions only gate SQL access, not the storage layer, so they fail the at-rest requirement entirely. It is tempting because permissions are simple and genuinely appropriate for controlling query-level access, but they cannot substitute for encryption of stored data.
Trap 2: Using MD5 hashing
MD5 is a fast, unsalted one-way hash built for integrity checking, not confidentiality; it cannot be decrypted, so the stored data becomes unusable, and collisions are practical. It is tempting because hashing is genuinely correct for storing passwords, but that scenario differs from protecting recoverable data at rest.
Trap 3: Storing data in base64 encoding
Base64 is a reversible encoding, not encryption, so anyone with database access reads the plaintext directly; it provides no confidentiality key. It is tempting because it obscures values visually and is genuinely used to safely transport binary data through text-only channels, but it satisfies no encryption-at-rest requirement.
- A
Using cleartext with database permissions
Why it fails: Cleartext leaves values readable to anyone with file or backup access, and database permissions only gate SQL access, not the storage layer, so they fail the at-rest requirement entirely. It is tempting because permissions are simple and genuinely appropriate for controlling query-level access, but they cannot substitute for encryption of stored data.
- B
Using MD5 hashing
Why it fails: MD5 is a fast, unsalted one-way hash built for integrity checking, not confidentiality; it cannot be decrypted, so the stored data becomes unusable, and collisions are practical. It is tempting because hashing is genuinely correct for storing passwords, but that scenario differs from protecting recoverable data at rest.
- C
Using AES-256 encryption
AES-256 is a symmetric block cipher providing strong confidentiality for stored data, satisfying the at-rest protection requirement. Its 256-bit key resists brute-force attacks, and it is the standard algorithm for database and volume encryption, unlike hashing or asymmetric ciphers suited to other purposes.
- D
Storing data in base64 encoding
Why it fails: Base64 is a reversible encoding, not encryption, so anyone with database access reads the plaintext directly; it provides no confidentiality key. It is tempting because it obscures values visually and is genuinely used to safely transport binary data through text-only channels, but it satisfies no encryption-at-rest requirement.