The original use for a KDF is key derivation, the generation of keys from secret passwords or passphrases. Variations on this theme include: • In conjunction with non-secret parameters to derive one or more keys from a common secret value (which is sometimes also referred to as "
key diversification"). Such use may prevent an attacker who obtains a derived key from learning useful information about either the input secret value or any of the other derived keys. A KDF may also be used to ensure that derived keys have other desirable properties, such as avoiding "weak keys" in some specific encryption systems. • As components of multiparty
key-agreement protocols. Examples of such key derivation functions include KDF1, defined in
IEEE Std 1363-2000, and similar functions in ANSI X9.42. • To derive keys from secret passwords or passphrases (a
password-based KDF). • To derive keys of different length from the ones provided. KDFs designed for this purpose include
HKDF and SSKDF. These take an 'info' bit string as an additional optional 'info' parameter, which may be crucial to bind the derived key material to application- and context-specific information. •
Key stretching and key strengthening.
Key stretching and key strengthening Key derivation functions are also used in applications to derive keys from secret passwords or passphrases, which typically do not have the desired properties to be used directly as cryptographic keys. In such applications, it is generally recommended that the key derivation function be made deliberately slow so as to frustrate
brute-force attack or
dictionary attack on the password or passphrase input value. Such use may be expressed as , where is the derived key, is the key derivation
function, is the original key or password, is a random number which acts as
cryptographic salt, and refers to the number of
iterations of a sub-function. The derived key is used instead of the original key or password as the key to the system. The values of the salt and the number of iterations (if it is not fixed) are stored with the hashed password or sent as
cleartext (unencrypted) with an encrypted message. The difficulty of a brute force attack is increased with the number of iterations. A practical limit on the iteration count is the unwillingness of users to tolerate a perceptible delay in logging into a computer or seeing a decrypted message. The use of
salt prevents the attackers from precomputing a dictionary of derived keys. This forces both the attacker and legitimate users to perform a brute-force search for the salt value. Although the paper that introduced key stretching referred to this earlier technique and intentionally chose a different name, the term "key strengthening" is now often (arguably incorrectly) used to refer to key stretching. == Password hashing ==