Module passwords::hasher

source ·
Expand description

Hash passwords.

Functions

  • Use bcrypt to hash a password (the null-terminated byte will not be added automatically) whose length is not bigger than 72 bytes to 24 bytes data. If the salt is not 16 bytes, it will be MD5 hashed first.
  • Use bcrypt to hash a password (the null-terminated byte will not be added automatically) whose length is not bigger than 72 bytes to 24 bytes data. The result will be in Modular Crypt Format. If the salt is not 16 bytes, it will be MD5 hashed first.
  • Generate a random 16-byte salt.
  • Check the password and make it terminated with a null byte, 0u8.
  • Identify a password (the null-terminated byte will not be added automatically) by using the bcrypt-hashed data we’ve stored before.
  • Identify a password (the null-terminated byte will not be added automatically) by using the bcrypt-hashed data in Modular Crypt Format we’ve stored before.