Encryption turns readable data into ciphertext by applying an
algorithm with a secret called an encryption key.
Anyone who obtains that encryption key can normally reverse the
encryption, so protecting the key is as important as protecting the
ciphertext.
Protecting one key with another creates a hierarchy whose highest key
still needs a trusted home.
AWS Key Management Service is a managed AWS service that creates and
controls keys used to encrypt or sign data.
A KMS key is a logical AWS resource that combines an identifier, key
material, lifecycle state, and access policy.
AWS-generated KMS key material is protected in FIPS 140-3 Security
Level 3 validated hardware security modules.
A KMS key never leaves AWS KMS unencrypted, so software uses it
through authenticated KMS API calls.
Resting point
Encryption only moves the protection problem onto a key. AWS KMS
gives the top of that key hierarchy a managed boundary.
The envelope pattern
Applications usually encrypt bulk data locally with a short-lived
symmetric key called a data key.
Envelope encryption uses the data key for the payload and a KMS key
for the data key.
GenerateDataKey asks a symmetric encryption KMS key to
create a new data key.
The GenerateDataKey response contains a plaintext data
key for immediate use plus an encrypted copy of the same key for
storage.
The application uses the plaintext data key with a cryptographic
library to encrypt its plaintext locally.
The application should remove the plaintext data key from memory as
soon as that local encryption finishes.
Keeping the encrypted data key beside the ciphertext forms a portable
envelope that only an authorized KMS call can open.
KMS around the data key, local cryptography around the payload
To decrypt later, the application sends the encrypted data key to
Decrypt and receives plaintext key material only after
authorization succeeds.
The application uses that recovered data key to decrypt the
ciphertext locally.
Envelope encryption lets KMS handle a small data key instead of the
bulk payload.
Each request to recover a data key becomes a central checkpoint for
control and audit.
Resting point
The durable KMS key wraps disposable data keys. Applications keep
high-volume encryption local while KMS governs every unwrap.
Who may use the boundary
Every KMS request is made by an AWS identity such as an IAM role,
user, or AWS service.
Every KMS key has exactly one key policy that acts as its primary
resource policy.
An IAM allow becomes effective only when the key policy permits the
account to delegate access through IAM.
A grant supplies temporary or scoped KMS-key permissions without
rewriting the key policy.
Integrated AWS services commonly use grants to obtain narrowly scoped
permission to use a key on a customer's behalf.
An encryption context is an optional set of non-secret key-value
pairs that symmetric encryption operations bind to ciphertext as
additional authenticated data.
Decryption fails unless the caller supplies the same encryption
context that protected the ciphertext.
Policies and grants can require particular encryption-context values
to restrict a key to a defined workload.
Encryption context must never contain secrets because AWS KMS records
it in plaintext in AWS CloudTrail.
By default, CloudTrail records KMS management and cryptographic API
calls.
AWS KMS omits sensitive fields such as plaintext and cryptographic
responses from CloudTrail records.
An alias such as alias/orders is a movable friendly name
for a KMS key rather than the key material itself.
Resting point
KMS is a policy enforcement point as much as a cryptographic one. An
identity must be allowed to use a specific key in a specific context,
and the resulting API activity is auditable.
Choosing and operating keys
A KMS key's type determines the cryptographic job that AWS KMS can
perform with it.
A symmetric encryption KMS key performs encryption and decryption
with secret key material that never leaves KMS unencrypted.
An asymmetric KMS key keeps its private key protected inside KMS
while allowing its public key to be downloaded.
An HMAC KMS key generates and verifies message authentication
codes for integrity and authenticity.
GenerateDataKey specifically requires a symmetric
encryption KMS key.
The party that manages a key determines how much lifecycle control
and visibility the customer receives.
A customer managed key gives the customer control over its policy
and lifecycle.
An AWS managed key lives in the customer's account but can be
used only through its owning AWS service.
An AWS owned key stays in an AWS service account with no
customer-visible policy or usage audit trail.
A standard KMS key is a Regional resource whose ARN includes its AWS
Region and owning account.
Related multi-Region keys share interoperable key material across
selected Regions.
Rotating a KMS key creates new backing key material for future
protection operations.
Rotation leaves the logical KMS key's identifier unchanged.
For AWS-generated keys, AWS KMS retains older backing material so the
rotated key can decrypt ciphertext created before rotation.
KMS key rotation does not re-encrypt existing data or rotate the data
keys that already protect it.
AWS KMS is therefore a controlled cryptographic boundary where
durable top-level keys stay protected while authorized and logged
calls govern the keys that encrypt application data.
Resting point
KMS does not replace application encryption. It makes the hardest key
in the hierarchy durable, governable, and auditable.