Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> was used to generate the cache key where we hash a combined string of userId + username + password.

Don't conceive your own cryptographic hacks. Use existing KDF designed by professionals.



Simply hashing your data (using an established hashing algorithm/library combo) to later compare two hashes in order to check whether the data has changed doesn’t usually feel like rolling your own crypto.


The use case was KDF and they decided to do simple password hash signature hack instead by combining strings. They fucked it up.


Of course they fucked it up, as evidenced by their bad security incident. The only question is whether you can really chalk this particular one up to a problem with "rolling your own crypto." That mantra exists for a reason, but it doesn’t feel like it really applies this time. It seems more like they used established crypto—just not the right one for this particular use case.


Concatenating strings before giving it to the hash function instead of using KFD is rolling your own.


I would bet that if you surveyed working programmers 9 out of 10 would say that they thought bcrypt() was a “KDF designed by professionals”. The treacherous API is not as well known as it should be.


Is the functions in libsodium enough? Provided they are used correctly?


Yes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: