Cryptographic keys are the input parameters to many cryptographic operations, namely en-/decryption and signatures. This HOWTO will show you how to create keys from passwords, and how to derive multiple keys from one master key.
Cryptographic keys can be obtained by two methods:
SecureRandom
)Cryptographic keys can be generated by using a random number generator (RNG). Cryptographic keys should always be generated by using a key derivation function.
The words password and cryptographic key are often used interchangeably, although they are technically quite different.
A password is a sequence of characters of often arbitrary length. A cryptographic key is a binary object that has an algorithm specific structure to it.
For many use cases it is desirable to derive multiple keys from one master key. This not only increases security, it also greatly simplifies key management.
The process of deriving a cryptographic key from a password is called password based key derivation. Because passwords are often to short/predictable this derivation often also implements some kind of key strengthening or key stretching.