-
Notifications
You must be signed in to change notification settings - Fork 22
Description
A major issue is that you are pulling 64 bytes from deriveBytes, which is very expensive for almost no additional gain. You should be pulling a maximum of 20 bytes. This is causing your routine to run ~4x slower (each 20 bytes doubles costs. and you eat an entire x to generate those last 4 bytes), for no additional security gain (as attackers can generate only the first 20 bytes, and once they get a match there, calculate the remaining bytes)
or
https://www.owasp.org/index.php/Using_Rfc2898DeriveBytes_for_PBKDF2
"Using PBKDF2 for password storage, one should never output more bits than the base hash function's size. With PBKDF2-SHA1 this is 160 bits or 20 bytes. Output more bits doesn't make the hash more secure, but it costs the defender a lot more time while not costing the attacker. An attacker will just compare the first hash function sized output saving them the time to generate the reset of the PBKDF2 output"