cryptographic-key-management-pattern
Cryptographic Key Management Security Pattern
When integrating cryptographic primitives into a system, correctly managing cryptographic keys is a crucial aspect. This pattern encapsulates common issues when applying solutions involving cryptography.
Importance
Proper key management is one of the most crucial aspects when applying cryptography.
Any security guarantees provided by a cryptosystem can be nullified if an attacker can obtain or tamper with the used cryptographic key(s).
Example: An attacker that obtains a supposedly secret session key will be able to decrypt all messages encrypted with that key.
Key Security Requirements
In most circumstances, cryptographic keys should be:
- Kept confidential throughout their lifecycle
- Have their integrity protected throughout their lifecycle
Exception: For some types of keys, such as the public key in an asymmetric key pair, the confidentiality requirement can be relaxed (but integrity must still be protected).