003 · Domain 6: Encryption as a service · 5% of the exam
Task 6.1: Encrypt and decrypt secrets
transit encrypt and decrypt with base64 plaintext, ciphertext prefixed with the key version, derived keys and context, and the capabilities each call needs.
The transit key tenant-data was created with derived=true so that each tenant's records use their own derived key. A service now encrypts with only the plaintext and gets an error. What must its encrypt and decrypt calls include?
AThe same base64-encoded context value for the tenant on both calls
BA base64-encoded nonce on the encrypt call only
CThe key_version parameter on both calls
DA context for the tenant on the encrypt call, which decryption reads from the ciphertext
Show the answer and why
AThe same base64-encoded context value for the tenant on both calls
Correct
With derivation enabled, every encrypt and decrypt request must provide a context, and decryption needs the context used to encrypt.
BA base64-encoded nonce on the encrypt call only
Incorrect
A nonce was needed only for convergent keys created in Vault 0.6.1; derivation requires a context.
CThe key_version parameter on both calls
Incorrect
This does not satisfy the context requirement of a derived key.
DA context for the tenant on the encrypt call, which decryption reads from the ciphertext
Incorrect
Decrypt requests on a derived key must provide the context as well; Vault does not take it from the ciphertext.
Key derivation turns one named key into many by mixing in a caller-supplied context, so the caller must supply that context every time.
An engineer inherits dozens of transit keys of mixed types and must find out which of them can encrypt and decrypt data, without sending a test encrypt call to each key. What shows this?
AA LIST of transit/keys, which returns each key's type and abilities
BA read of transit/config/keys, the mount's key configuration
CAn attempt at transit/export/encryption-key/<name> for every key
DA read of each key; the response includes supports_encryption
Show the answer and why
AA LIST of transit/keys, which returns each key's type and abilities
Incorrect
Listing returns only the key names.
BA read of transit/config/keys, the mount's key configuration
Incorrect
It holds settings for the whole mount, not the abilities of each key.
CAn attempt at transit/export/encryption-key/<name> for every key
Incorrect
Export works only for keys marked exportable, so it says nothing about the others.
DA read of each key; the response includes supports_encryption
Correct
Reading a key returns its type and flags such as supports_encryption, supports_decryption and supports_signing.
A key read never returns key material: it shows the type, the versions with their creation times, and what the key supports, which makes it the safe way to audit existing keys.