0

I am planning to use bcrypt library for hashing the password with a max length of 16 bytes, the standard bcrypt library is generating the hash of 31 bytes as per the below example:

$2a$12$SBdXpoExjoJBtyVS3GBbh.VR4TlNWSrM0XRRDJjAw0fnw8TLhuDj6

Is it possible to generate the shorter hash of 16 bytes by changing some configuration or macro?

I tried changing the macro BCRYPT_HASHSIZE to 16 and 32 but it is not working as expected.

Thank you, Regards, Shreyas.

shreyas_patel21
  • 317
  • 1
  • 4
  • 14

1 Answers1

0

No, there is no way to shorten the resulting hash.

You need to increase the size of your varchar(50) to varchar(200) to hold everything required.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219