Key rotation
Key rotation means retiring a key and switching to a new one on a schedule, or straight away if it might have leaked. Data protected by the old key may be re-encrypted with the new one.
Changing the locks every year, and immediately if a key goes missing.
- 1Generate Created from a strong random source, ideally inside secure hardware. Common failure: Predictable random numbers The Debian bug left only about 32,768 possible keys.
- 2Store Kept where it cannot be copied out, separate from the data it protects. Common failure: Keys left in code or config files HSMs and cloud key services exist for this.
- 3Rotate Replaced on a schedule, and at once if it may have leaked. Common failure: Nobody knows where the key is used Shorter certificate lifetimes push towards automation, though a renewed certificate can keep the old key.
- 4Destroy Retired keys are securely deleted, along with every backup copy. Common failure: Old copies in backups Destroying a key can erase data instantly.
Why it matters
It limits how much data any single stolen key can unlock and how long an attacker can use it.
Where you meet it
Inside companies' cloud key services, and in the shrinking lifetimes of website certificates.
Go deeper history and technical detail
Rotation is hard when keys are hard-coded or nobody knows where they are used, which is why it goes hand in hand with crypto-agility and inventories. Payment systems use schemes such as DUKPT that derive a new key for every transaction.
Read or watch next
- Developing Secure Software (LFD121)Linux Foundation with OpenSSF, course
Related terms
Cite this page Encryption Observer, “Key rotation”, encryption.observer/terms/key-rotation/, checked December 2026.