Welcome Guest, Not a member yet? Register   Sign In
password hashing doesn't work for all special characters
#15

You need to base64_encode them first.

PHP Code:
$stored password_hash(
    base64_encode(
        hash('sha256'$_POST['password'], true)
    ),
    PASSWORD_DEFAULT
);
// ...
if (password_verify(
    base64_encode(
        hash('sha256'$_POST['password'], true)
    ),
    $stored
)) {
    // Success :D
} else {
    // Failure :(


SEEImplementing Secure User Authentication in PHP Applications with Long-Term Persistence (Login with "Remember Me" Cookies)
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: password hashing doesn't work for all special characters - by InsiteFX - 08-05-2020, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB