← Cryptography learning path
Cryptography · Module 9 of 10

Key management

Protect, rotate and control cryptographic keys.

📖 Key ideas

  1. Keys must be generated securely with strong randomness.
  2. Store keys in KMS, HSMs or secret managers, not in code.
  3. Rotate keys regularly and on suspected compromise.
  4. Limit who and what can use keys.
  5. Back up keys securely; losing a key can lose data.
💡 Real-life example: Key management is a bank locker policy: who holds keys, how they're stored, and when locks are changed.
KMSKey Management Service
HSMHardware Security Module
Key rotationReplacing keys periodically
Envelope encryptionData key encrypted by a master key