I am referencing this answer: https://stackoverflow.com/a/4766811/1114105
We re-hash the password, but then we don't really do anything with the hash (we use the POST-submitted plaintext password in the CheckPassword function to authenticate). Can't a hacker bypass the re-hashing part?
Here's my pseudocode underneath.
if a password/username is submitted by POST and $row['password'] is the hashed pword in sql.
$t_hasher = new PasswordHash(13, FALSE);
$hash = $t_hasher->HashPassword($_POST['password']);
$check = $t_hasher->CheckPassword($_POST['password'], $row['password']);
if($check) Great success else Wrong credentials`
Note: I found that the work factor does not make a difference in the time it takes CheckPassword to run. It only increases the time for HashPassword.