PBKDF2-HMAC-SHA-512 test vectors

后端 未结 3 661
耶瑟儿~
耶瑟儿~ 2020-12-16 16:53

I have not been able to find published test vectors for PBKDF2-HMAC-SHA-512. I\'ve built a function that (finally!) reproduces the 7 HMAC-SHA-512 test vectors in RFC 4231,

3条回答
  •  无人及你
    2020-12-16 17:44

    You're all mad!

    The supplied test data doesn't specify the PRF! If you look at the RFC2898 specification here: http://www.ietf.org/rfc/rfc2898.txt you will notice that it shows you how to implement PBKDF2 using a Pseudo Random Function (PRF) but it doesn't tell you what to use as your PRF!

    Now to simply say I will use HMACSHA512 as my PRF and therefore my output will be the same as everyone else who uses HMACSHA512 is wrong! If you look at how HMACSHA works, you will note it takes a key. Now the PBKDF2 spec DOES NOT tell you how you should use HMACSHA512. So, for example, I use the password as the key for the HMACSHA512 hashing object I create, and then I do all my hashing using that created object. However someone else might come along and do something different (yet completely legitimate) and say ok, well I will change the HMACSHA key after every hash pass, such that the HMACSHA key is now the value of the last hash.

    Also, you can do things like concat Salt + Password instead of Password + Salt and this will also vary your output. The PBKDF2 spec DOES NOT tell you what order you should concatenate your password and salt or when/how you should set the HMACSHA key and this is up to you to implement. So I don't know what standard you are all trying to match your output too.......but essentially all you are doing is making all your frameworks susceptible to attacks by a COMMON RAINBOW TABLE as having output all the same means I can make one table that can be used on everyone achieving the same output....

    This be mine https://github.com/Thashiznets/PWDTK.NET in case you wondering what my interest is in this :)

提交回复
热议问题