None
EN
Best practices for key derivation
['Marc Ilunga']
The Trail of Bits Blog
This construction is bad: since the salt is used as an HMAC “key” for extraction, it is first preprocessed by a PAD-or-HASH scheme (key padding, key hashing) to handle variable-length keys. Prefer creating key hierarchies (such as key encryption keys), using the password hash to encrypt a randomly generated key from which further keys can be derived as needed. In short, a safe dual PRF usage of HMAC requires that the key argument (i.e., what is passed as key to HMAC) is a fixed length bitstring (i.e., all keys must have the same length) or a variable length bitstring as long as all keys have length at least the block length of the underlying hash function.