Cryptography and Data Protection
Cryptography and Data Protection
This domain tests whether you can select the right primitive for a purpose, manage keys properly, and protect data across all three states.
Core rules
- Symmetric encryption (AES-256-GCM) is fast and provides confidentiality plus integrity via AEAD. Asymmetric (RSA, ECC) solves key distribution and enables signatures.
- Hashing (SHA-256/384) is one-way and detects change. HMAC adds a shared key for authenticity. A digital signature is a hash signed with a private key, verified with the public key.
- PKI binds keys to identities through certificates, a chain of trust, and revocation via CRL or OCSP.
- TLS 1.3 with ephemeral key exchange gives forward secrecy; static RSA key transport does not.
- Key management covers generation, distribution, rotation, escrow, revocation and destruction. Use KMS or an HSM; never hardcode keys.
- Envelope encryption wraps a per-object data key with a key-encryption key held in the HSM, limiting blast radius.
- Data states: at rest, in transit, in use. TLS protects transit only.
- Tokenization and masking reduce exposure without the operational cost of reversible encryption.
Worked example
A SaaS application stores customer PII. Each record gets a random data key encrypting the PII with AES-256-GCM; that data key is wrapped by a KEK in the cloud HSM. Database access uses TLS 1.3. Search fields use format-preserving tokenization so the application never holds plaintext. Key rotation rotates the KEK without re-encrypting every record.
Traps that cost marks
- Treating hashing as encryption, or claiming a hash can be decrypted.
- Using ECB mode, MD5 or SHA-1, or unauthenticated CBC without a MAC.
- Encrypting then signing when the requirement was sign then encrypt.
- Assuming TLS protects data at rest in the database.