Hide Forgot
Description of problem: The current implementation of pbkdf2 in NSS is highly targeted at the encryption key use case, where given a secret, the key is derived. However, many sites use PBKDF2 for storing hashes of user passwords. This is due to the time factor in "repeating" the hash. This causes any potential attacker with bruteforce or rainbow table to have to expend a huge amount of work to attack the hashes. Right now, in FIPS mode, NSS cannot be used to create hashes of passwords. Additionally, even in non-FIPS mode, the process is complex, fiddly, and prone to mistake. If the user of the library cannot use it correctly, this adds a potential weakness in the calling application. By having NSS implement this function wrapper as a whole, it can be implemented correctly, it can be verified, and it makes strong password hashing more acceptable to users of the NSS api. I would like to request that the authors of NSS add an interface such as: SECStatus pbkdf2_hash(SECItem *salt, SECItem *pass, SECAlgorithmID *algid, PRUint32 rounds, SECItem *result); Where: salt is the salt to be combined with the password during hashing. pass is the password material. algid contains either SEC_OID_HMAC_SHA256, SEC_OID_HMAC_SHA1 or other relevant hash type. rounds is the number of iterations of hashing to perform. result is allocted by the function, containing a buffer of bytes that is the hash output. The function would return SECStatus to indicate success or failure. Thanks,