I'm building a game with Unity and writing some PHP to pass login information to a database. When checking to confirm the hashed password in the database from registration is the same as the hashed password the user entered when logging in, the check always returns false, even if it is true
I've printed out the variables to the console to manually check their equality
//get login info from query
$existinginfo = mysqli_fetch_assoc($namecheck);
$salt = $existinginfo["salt"];
$hash = $existinginfo["hash"];
$loginhash = crypt($password, $salt);
if ($hash != $loginhash)
{
echo "6: Incorrect password. hash is " . $hash . " and login hash is " . $loginhash; //error code #6 password does not hash to match table
exit();
}
echo "0\t" . $existinginfo["score"];
the $hash and $loginhash variables are very long and look like this:
$5$rounds=5000$steamedhamsalway$ogasdfjasdflkASDQLO01sd4NBwZlWo81pqMclOkDm