Re:Okta Bcrypt incident lessons for designing better APIs
by Lvl999Noob on Thursday February 06, 2025 @05:47AM
(#42961101)
Can someone explain, in clear layman terms, what the difference is between a password hash and a KDF? I have went through this whole thread and tried to look around online but I still don't understand.
[ Parent
| on HN ]
Re:Okta Bcrypt incident lessons for designing better APIs
by pjc50 on Thursday February 06, 2025 @05:55AM
(#42961153)
Password hash is designed for matching: take the salt, add it to the password, run it through the hash, compare it to the stored hash. The important properties are:
- MUST be non-reversible, including against tricks like "rainbow tables"
- should be somewhat expensive to discourage just trying all possible passwords against a (leaked) hash
KDF is a key derivation function. The value will be used as a key in, say, AES. The important properties are:
- should distribute entropy as well as possible, across the required width of output bits
- reversibility less important as the derived key shouldn't be stored anywhere
- may or may not want artificially inflated cost to discourage cracking
Re:Okta Bcrypt incident lessons for designing better APIs
by Lvl999Noob on Thursday February 06, 2025 @07:23AM
(#42961681)
I still have no idea now haha. Your answer and Fabbari's are total opposites. If I am understanding right, you are saying that Password Hash is how a password should be stored while a KDF is not meant for storing passwords.
Fabbari is saying the opposite of this, that KDF should be used for storing passwords while password hashes should not.
Re:Okta Bcrypt incident lessons for designing better APIs
by pjc50 on Thursday February 06, 2025 @08:15AM
(#42961999)
Further discussion upthread under https://news.ycombinator.com/item?id=42957300
Re:Okta Bcrypt incident lessons for designing better APIs
by fabbari on Thursday February 06, 2025 @05:56AM
(#42961155)
A password hash is a simple hash of a password. Hash algorithms are made to be fast. KDF - key deriving functions - are slow by design and are made to derive a key from a given string. They are designed to be slow to make password searching slower. This is a 2c tour of the topic.
Re:Okta Bcrypt incident lessons for designing better APIs
by johnisgood on Thursday February 06, 2025 @06:39AM
(#42961422)
There are 2 comments to OP, and now the person can wonder which one is supposed to be slow or not.