Java - PBKDF2 with HMACSHA256 as the PRF

后端 未结 2 1910
-上瘾入骨i
-上瘾入骨i 2020-12-13 22:00

I\'ve been given the task of creating a Login API for our project and I\'m supposed to use PBKDF2 with HMACSHA256 as the PRF. The plain text password is hashed using MD5 an

相关标签:
2条回答
  • 2020-12-13 22:03

    The iterations count was supposed to 4096, not 1000.

    0 讨论(0)
  • 2020-12-13 22:11

    The generation of int l seems wrong. You have specified the maximum between dkLen and hLen but the spec says l = CEIL (dkLen / hLen) with

    CEIL (x) is the "ceiling" function, i.e. the smallest integer greater than, or equal to, x.

    I think l would be more accurately defined as l = (int)Math.ceil( (double)dkLen / (double)hLen )

    0 讨论(0)
提交回复
热议问题