-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pbkdf2 seems to generate a wrong hash #12
Comments
What is the status of this? RFC6070 contains authorative test vectors. |
Hi there, I'm the implementor of the pbkdf2 function. I tested the algorithm myself against the rfc vectors, and used the library to generate legacy hashes for a Django app I had, and it all worked fine, so this issue is coming as a surprise. http://hackage.haskell.org/package/pbkdf-1.1.1.1 Alfredo |
Yes, it is. |
Ok, I will take a look over the weekend if I have time. http://hackage.haskell.org/package/pwstore-fast-2.4.4/docs/src/Crypto-PasswordStore.html#pbkdf2 |
@adinapoli do you have any update on this? |
The problem apparently is that the salt is base64-encoded before it is used to hash. Indeed, if one bypasses it, > Crypto.PasswordStore.pbkdf2 "password" (Crypto.PasswordStore.importSalt "salt") 1000
"c,(\DC2\228mF\EOT\DLE+\167a\142\157m}/\129(\246&kJ\ETX&M*\EOT`\183\220\179" This is pretty irregular. Normally the encoding is just for outputting the string, and the salt is used directly as bytes during hashing. However, I suppose it's not any less secure, and for the sake of those already using this package it shouldn't be changed now. Still, I'd be reluctant to use this package for new projects, given this inconsistency with other PBKDF implementations. |
I tested pbkdf2 function from pwstore-fast and pbkdf packages, and found that these two libraries generated different results.
As a reference, I also generated a hash with pbkdf2-ruby and it generated the same result as pbkdf library.
Did I miss something?
The text was updated successfully, but these errors were encountered: