4 ms·
hmac-bcrypt solves that problem very well, and should replace plain bcrypt: https://github.com/epixoip/hmac-bcrypt https://github.com/epixoip/hmac-bcrypt
by jedisct1 2y ago
hmac-bcrypt solves that problem very well, and should replace plain bcrypt: https://github.com/epixoip/hmac-bcrypt https://github.com/epixoip/hmac-bcrypt
- tptacek 2y agoI don't think it's a good idea for people to adopt new bcrypt constructions so that they can use it to generate cache keys (or, worse, other keys). (I need that "man standing up in the town hall meeting" meme for this.) Just use a real KDF, if that's really what you want. I'm still confused what password-derived material is doing in a Redis key.
- petedoyle 2y agoMaybe they wanted some cached data to get invalidated if users change their passwords?
- duskwuff 2y agoThen use some other data which can act as a proxy for that, like the date of the last credential change. Using the password itself is a terrible security smell.
- GoblinSlayer 2y agoBy cache they mean cached credentials. >The user previously authenticated creating a cache of the authentication Maybe, it's a password encrypted secret token.
- GoblinSlayer 2y agoOn the other hand Redis on the server side makes more sense as an LDAP backup, but then mapping should be user id -> bcrypt hash.
- earnestinger 2y agoCould you give an example of real KDF?
- aaronmdjones 2y agoI'm not the person you're replying to, but HKDF and PBKDF2
- pclmulqdq 2y agoHMAC-bcrypt is a more complicated version of the first construction I proposed, and it would need a rigorous cryptanalysis if someone wanted to actually use it in production. It sounds like Okta actually wanted PBKDF2(stuff) here. An authentication company should have known this...
- tptacek 2y agoI feel like the "authentication company should have known" thing is unuseful; most developers at "security" companies are just ordinary generalist developers. Ironically, I think they boned themselves by trying to be too clever here, not too casual.
- smw 2y agoYou don't think a company whose entire reason for being is providing security services for other companies should have designs related to authentication reviewed by security experts?
- tptacek 2y agoI think it's good to want things.
- justin_oaks 2y agoI was an employee of a company providing security services. I can attest to that company being filled with generalist programmers. None were trained in security principles. None were security experts. And there was no security review.
- re-thc 2y ago> You don't think a company whose entire reason for being... That's the assumption everyone makes and it's dangerous. The fact that someone or some entity does something and only special doesn't make them the best at it (or even close). It's just what they do to survive (and earn).
- GoblinSlayer 2y ago