2

Does anyone know of a SQL implementation of PBKDF2 with SHA1?

There is already a good answer for PBKDF2 with SHA512 on stackoverflow. The author anti-weakpasswords also gives a short explanation for rewriting the code to SHA1, but I did not succeed.

If you must use SHA1 (i.e. SQL 2008 R2 and below), change all instances of digest size to 20 bytes, BLOCKSIZE to 64 bytes, LEN(@Password) check to 64 bytes (it's BLOCKSIZE as well), obviously change the HASHBYTES calls, cut the XOR unrolled loops down to a total of 64 bytes, and cut the @Working = ... XOR unrolled loop down to 20 bytes (i.e. two BIGINT and one INT)

Sorry for posting a new question here, but as a new subscriber (with no reputation point) I was not able to comment the original answer and post my question there.

ganchito55
  • 3,559
  • 4
  • 25
  • 46

0 Answers0