Key Management Practices
Strong algorithms are useless if keys are poorly managed. This lesson covers each stage of key management and the controls that protect keys.
Learning outcomes
After completing this lesson, you will be able to:
- Describe each stage of the key management life cycle.
- Explain split knowledge, dual control and key escrow.
The key management life cycle
Generation uses approved algorithms and a cryptographically secure random number generator, ideally inside an HSM. Distribution moves keys securely, using key exchange protocols, key wrapping (encrypting keys with other keys) or out-of-band methods. Storage keeps keys in HSMs, TPMs, key management services or encrypted key stores, separate from the data they protect and never hardcoded in source code.
Keys are used only for their designated purpose, rotated at the end of their cryptoperiod or immediately after suspected compromise, backed up and archived where data must remain decryptable, and finally destroyed so they cannot be recovered. Key management services often use envelope encryption: data keys encrypt data, and a master key held in the HSM encrypts the data keys.
Envelope encryption solves a practical problem. Encrypting terabytes of data directly with a master key held in an HSM would mean sending all that data to the HSM, which is slow and concentrates risk. Instead, the application asks the key service for a new data key, receives it in two forms, plaintext and encrypted under the master key, uses the plaintext copy to encrypt the data locally, discards it, and stores the encrypted copy alongside the data. To decrypt, the application sends only the small encrypted data key to the service, which decrypts it if the caller is authorised. The master key never leaves the HSM, every use of it is logged, and rotating the master key requires re-encrypting only the data keys, not the data.
The cryptoperiod, the time a key is authorised for use, balances two risks. The longer a key is used, the more data it protects and the more opportunity an attacker has to obtain or attack it. Very short cryptoperiods, however, increase the operational burden and the chance of errors during rotation. Cryptoperiods are therefore set by key type: a TLS session key lasts for one session, a data encryption key might be rotated annually, and a root CA key may be valid for many years because it is kept offline and used rarely. Keys must be backed up before they are needed, because a lost key makes the encrypted data permanently inaccessible, which is an availability failure caused by cryptography.
Envelope encryption
Controls over keys
Key management controls exist to stop a single person from misusing or losing a key. Split knowledge divides a key or the secret that protects it into parts held by different people, so that nobody knows the whole. Dual control requires two or more authorised people to act together, such as two officers both authenticating before an HSM will export a backup. The two are often combined: each of two custodians holds a smart card and a PIN, and both must be present to activate the root CA.
M of N control makes this practical when people are unavailable. A root key backup might be split among five custodians so that any three can restore it. The organisation can lose two custodians to illness or departure without losing the key, while two colluding custodians still cannot use it. Key escrow places a copy of a key with a trusted third party so that data can be recovered under defined conditions, such as a court order, and key recovery is the broader process of regaining access when a key is lost. Escrow and recovery improve availability but create a copy that must itself be protected. The following key terms summarise these controls.
- Split knowledge
- No single person knows or holds the whole key; each holds a part.
- Dual control
- Two or more authorised people must act together to perform a key operation.
- Key escrow
- A copy of a key is held by a trusted third party so that data can be recovered, for example under legal order.
- Key recovery
- A process to regain access to encrypted data when a key is lost, often using escrowed or backed-up keys.
- M of N control
- Any M of N key custodians must cooperate to recover or use a key.
All access to keys is logged and audited, and key custodians are trained and subject to segregation of duties.
The following diagram shows the response to an exposed key.

Choosing a key control
A key in source code
A developer discovers that an API encryption key has been committed to a public code repository for three months. The commit has now been deleted. Is the issue resolved?
No. The key must be treated as compromised, because anyone could have copied it, and deleting the commit does not remove copies or history. The key must be revoked and rotated immediately, data protected by it re-encrypted if necessary, and the application changed to retrieve keys from a key management service or secrets vault. Secret scanning in the pipeline would prevent recurrence.
What is the difference between split knowledge and dual control?
Show answer
Split knowledge means nobody knows the whole key; dual control means two people must act together to perform an operation.
Exam Tips
Remember for the exam
- Store keys separately from data, in HSMs or key management services.
- Rotate keys after their cryptoperiod or any suspected compromise.
- Split knowledge and dual control prevent one person misusing a key.