BCrypt - A library to help you hash passwords

BCrypt - A library to help you hash passwords

BCrypt - A library to help you hash passwords
BCrypt - A library to help you hash passwords


A library to help you hash passwords. You can read about bcrypt in Wikipedia as well as in the following article: How To Safely Store A Password

Via Boss
For ease I recommend using the Boss (Dependency Manager for Delphi) for installation, simply by running the command below on a terminal (Windows PowerShell for example):

boss install https://github.com/viniciussanchez/bcrypt


Manual
If you choose to install manually, simply add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path

../bcrypt/src


Generate hash

var
  LHash: string;
begin
  LHash := TBCrypt.GenerateHash(password, cost, type);
end;


Where

password is the password to be hashed
type is one of THashType.PHP, THashType.BSD, or THashType.Default, THashType.BSD is the default $2a$
cost is a number between 10 and 30, default is 10

https://github.com/viniciussanchez/bcrypt