Hashapass is a library that generates unique and secure passwords, which are a hashed combination of a master password and a variable parameter, using Base64 and HMAC-SHA1 encoding.
Hashapass is a library that generates unique and secure passwords, which are a hashed combination of a master password and a variable parameter.
The algorithm is based on a Base64 encode of the HMAC_SHA1 of the provided master password and parameter values.
use Aalaap\Hashapass\Hashapass; $hashapass = new Hashapass(); echo $hashapass->generate('master', 'parameter');
Install using Composer.
composer require aalaap/Hashapass
The package has one main method:
By default, it will return a Hashapass-compatible 8-character password. To get a more secure 16-character password (or longer), simply specify the length:
$hashapass->generate($master_password, $parameter, 16);
Note that the maximum possible length is 40, as the algoritm is limited to the length of the generated HMAC_SHA1.
Hashapass has been tested in PHP 5.4 through PHP 7 and HHVM. If you want to run the tests, run:
Fork it, work on it, send a PR.
Hashapass is licensed under WTFPL. Do whatever you want with it.