Course contentsShow
← Cloud and Infrastructure
Lesson 2304 of 2,98949. KMS and EncryptionFree lesson

Encryption Key Rotation Strategies

Learn automatic and manual key rotation patterns to limit exposure from compromised keys without re-encrypting data.

Encryption Key Rotation Strategies

What you'll learn: How to rotate encryption keys automatically and manually to minimize risk from key compromise without having to re-encrypt all your data.

Why Key Rotation Matters

Even if keys are never compromised, rotating them regularly limits the window of exposure. Think of it like changing your passwords—if a key is stolen, rotating it ensures the thief can't decrypt new data, even if old data remains vulnerable.

Automatic vs. Manual Rotation

Automatic rotation is handled by the KMS (Key Management System). The service generates a new key version on a schedule (commonly 90 days or 1 year). The beauty: your encrypted data doesn't need re-encryption. How? The KMS tracks which key version encrypted which data and uses the right one for decryption.

When you encrypt new data, the KMS uses the latest active key version. Old data encrypted with previous versions stays encrypted with those versions—the KMS automatically looks up the correct one during decryption.

Manual rotation gives you control over timing—useful when you suspect compromise or need to meet specific compliance requirements. You create a new key version on-demand and disable older ones after ensuring all systems use the new version.

The Envelope Encryption Advantage

Because you're using envelope encryption (KEK encrypting DEKs), rotating the KEK is lightweight. You only rotate the master key in the KMS—your data encryption keys (DEKs) remain the same. This is far faster than decrypting and re-encrypting terabytes of data.

Rotation Without Re-Encryption

The KMS maintains key versioning metadata, mapping each encrypted object to its key version. On read, it transparently selects the correct version. This "decrypt-with-old, encrypt-with-new" pattern means rotation happens gradually as data is naturally accessed and updated.

Key Takeaway: Key rotation limits blast radius from compromises; automatic rotation leverages versioning to avoid mass re-encryption, while manual rotation provides control for incident response—both rely on your KMS tracking which key version encrypted what.