I had something like this (copied from http://www.gregboggs.com/php-blowfish-random-salted-passwords/)
$Blowfish_Pre = '$2a$05$';
$Blowfish_End = '$';
$bcrypt_salt = $Blowfish_Pre . $salt . $Blowfish_End;
$hashed_password = crypt($password, $bcrypt_salt);
echo $salt . '<br>';
echo $password . '<br>';
echo $bcrypt_salt . '<br>';
echo $hashed_password . '<br>';
echo "end";
When I test run it, it turns out that the value of $hashed_password
is exactly the same as $bcrypt_salt
, while $salt
, $password
, and $bcrypt_salt
all return values as expected. How do I fix this?