3 ms·
This is a sadly prevalent misconception. When hashing a password, you want it to be as slow as possible (and salted), so that given the hash, it's harder for an
by cesarb 6y ago
This is a sadly prevalent misconception. When hashing a password, you want it to be as slow as possible (and salted), so that given the hash, it's harder for an attacker to brute force the password; but when using hashing on other security contexts (for instance, message authentication), you do want it to be as fast as possible.
That is: for key derivation from an user-entered password (which might have poor entropy), use algorithms specialized for that like PBKDF2 or Argon2. For everything else, you can use a modern fast cryptographic hash algorithm like BLAKE2 or BLAKE3.