
Originally Posted by
Glaceon
You should as others suggested as well use password_hash. It will become like:
PHP Code:
$password = password_hash('password');
Where as 'password' is the password you want to hash.
You can verify using password_verify:
PHP Code:
if (password_verify('inputpassword', $hash))
Where as 'inputpassword' is the input password you want to check the user inserts (non-hashed) and $hash is the hashed password from the database.
Regarding, that by default password_hash() will use RANDOM Salts. Because that, recommend to use "PASSWORD_BCRYPT" flag.
becoming something like
PHP Code:
$hash = password_hash('password', PASSWORD_BCRYPT);
You also can provide a custom salt, becoming something like
PHP Code:
$hash = password_hash('password', PASSWORD_BCRYPT, 'my-hash');
For the signature verification just:
PHP Code:
$hash = RECOVER_HASH_FROM_DATABASE();
if(password_verify('password', $hash)) {
//SEEMS LEGIT
}