Lesson 23 of 30
Most AWS services don't ask you to write a single line of cryptography to encrypt data at rest — they ask you to point at a KMS key. Understanding what that key actually does is the difference between checking a box and actually reasoning about it.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
An S3 object with SSE-KMS enabled is uploaded. Does KMS encrypt the object's actual bytes directly with the KMS key itself?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
KMS (Key Management Service) manages the cryptographic keys most AWS services use to encrypt data at rest — S3, RDS, Secrets Manager, EBS, and others mostly just reference a KMS key and get encryption without the raw key material ever entering your own code. Two kinds of key cover almost every real case:
The mechanism underneath both is envelope encryption: KMS doesn't encrypt your (often large) actual data with the KMS key directly. Instead, a small, unique data key is generated, your data is encrypted locally with that data key, and only the small data key itself gets encrypted ("wrapped") by the KMS key. The wrapped data key is stored alongside the encrypted data. Decrypting later means sending the wrapped data key to KMS to unwrap it, then using the now-plaintext data key locally to decrypt the actual data — the raw KMS key material never has to leave KMS to encrypt or decrypt anything, no matter how much data is involved.
An S3 bucket with SSE-KMS (server-side encryption using a KMS key) enabled, referencing a customer-managed key, does roughly this on every upload: generate a fresh data key, encrypt the object with it, encrypt that data key with the referenced KMS key, and store the wrapped data key alongside the object. On download, S3 sends the wrapped data key to KMS to unwrap it, then decrypts the object locally with the now-plaintext data key.
kms:Decrypt permission and still be blocked if the key's own key policy doesn't grant that role access, and vice versa."How does S3 actually encrypt an object with SSE-KMS, and why doesn't it just encrypt the whole object directly with the KMS key?" tests whether a candidate understands envelope encryption as the real mechanism — a local data key doing the bulk work, only that small key ever touching KMS — rather than a vague "AWS encrypts it," which doesn't explain why raw key material can't leave KMS or how this scales to large objects.