I'm using phpass's bcrypt functionality to hash a password on my site.
Now, it wouldn't really work. Trying to compare with the CheckPassword function wouldn't work. I made a vast debugging of every string coming out through every function I used to decrypt the hashes and came to the conclusion that the hash generated by bcrypt is pretty random. So, the newly generated hash of the plaintext password would never match the one in my database. Is that true? If so, how the hell do I make it work? Source code is rather simple.
// when creating user
<db insert code>$hash->HashPassword($_POST['password']);
// when logging in
return $hash->CheckPassword($user->password, $_POST['password']);