23 ms·
> 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
by nabla9 2y ago
> 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.
- edoceo 2y agoIs the functions in libsodium enough? Provided they are used correctly?
- nabla9 2y agoYes.
- ludwik 2y agoSimply 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.
- nabla9 2y agoThe use case was KDF and they decided to do simple password hash signature hack instead by combining strings. They fucked it up.
- ludwik 2y agoOf 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.
- nabla9 2y agoConcatenating strings before giving it to the hash function instead of using KFD is rolling your own.
- acdha 2y agoI 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.