DynamoDB Encryption
Server-side encryption at rest versus client-side attribute encryption with the AWS Database Encryption SDK.
The decision: is table-wide server-side encryption enough, or must chosen attributes stay unreadable even to AWS?
DynamoDB has two separate encryption layers. Server-side encryption is always on and covers the whole table. Client-side encryption is optional, runs in your application, and keeps chosen attributes unreadable even to AWS.
Comparison
| Item | Server-side encryption at rest | Client-side (Database Encryption SDK) |
|---|---|---|
| Where | Inside DynamoDB | In your application, before the write |
| Scope | All table data, indexes, streams, global tables, backups and DAX | Only the attributes you mark. Table name, partition key and sort key stay plaintext |
| Can be turned off | No. Always on | It is optional |
| Who can read plaintext | DynamoDB decrypts transparently for authorized callers | Only holders of the key. AWS and third parties cannot |
| Keys | KMS. AWS owned key (default, free), AWS managed key, or customer managed key | KMS, CloudHSM, or any key source through keyrings |
| Integrity | Not applicable | Records are signed, so tampering such as adding fields or swapping encrypted values is detected |
| Switching keys | You can switch between the three key types at any time | Update the cryptographic actions in your configuration |
Key points about the SDK.
- Each field is marked encrypt-and-sign, sign-only, or do nothing. Keys must stay readable because DynamoDB needs them to find items.
- Supports searchable encryption for exact match queries on encrypted data, and a hierarchical keyring that caches key material to cut KMS calls.
- Data in transit uses HTTPS. Server-side keys cost nothing when AWS owned. AWS managed and customer managed keys incur KMS charges.
Legacy
The DynamoDB Encryption Client was renamed the AWS Database Encryption SDK. Older exam text still uses the old name.
Exam signal
"AWS must never be able to read the value of a specific attribute" means client-side encryption. "Audit every use of the table key and control who can use it" means a customer managed KMS key for server-side encryption.
Exam trap
You cannot disable DynamoDB encryption at rest, and you cannot encrypt a primary key attribute with the client-side library. An answer that "enables encryption" on the table is already true by default.