Keys and operations

Rotate, version, and revoke keys

Attach key and format versions to protected data, support controlled migration, and prepare immediate revocation for suspected compromise.

8 minute lesson

~~~

Keys and algorithms have lifecycles. Design the data format so old records can be read while new writes use the current key.

Store a non-secret key identifier and format version with ciphertext or signatures. Keep old decrypt-only keys during migration, then retire them according to retention needs. A compromised signing key may require revoking trust and issuing a clean replacement.

Ciphertext records store no key identifier. After rotation, the application must try every historical key, creating slow failures and making retirement unsafe.

A versioned format supports new writes with the current key and controlled reads with older keys. Immediate revocation can still make old data unavailable, so compromise response and data recovery need an explicit tradeoff.

Write and save a migration plan from key version 1 to version 2 using new-write and old-read phases. Encrypt records under both versions and prove the key identifier selects the correct key without trial decryption. Then revoke version 1 in a test environment and record which reads fail and how the recovery decision is made.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →