#1: I'm using Codeigniter, and php 5.5.x
#2: I'm still on phpbb 3.0.8
#3: I load the helper and have the following set: $data['hasher'] = new PasswordHash(8, false);
From what I understand, phpBB uses http://www.openwall.com/phpass/ which generates a unique hash, gets salted by something unique (not sure what though, is it hardware?), and so on... I followed this tutorial: http://sunnyis.me/blog/secure-passwords/ and the guide on the phpass website.
Here's the issue what I'm having...
The passwords listed in the database aren't at all the same size as they are when generating using phpass. They're like 34 characters or so but the hash is almost twice as long when generating. Now, I get that the hash will be different every time but I merely want to compare the value input to the database for login and insert a new hash when registering.
Checking to see if the hash is the same (not sure exactly what this does but I'm guessing it's phpass magic that checks to see if plain_password was converted and then can be understood?)
Code: Select all
$plain_password = "test";
$password_hashed = $hasher->HashPassword($plain_password);
if($hasher->CheckPassword($plain_password, $password_hashed)) {
echo "YES, Matched";
} else {
echo "No, Wrong Password";
}
$plain_password should be what the user input, let's pretend it's "test"
$password_hashed = $database_password_value; (the 32 character password from earlier)
then We run through the validation again right? if($hasher->CheckPassword etc....
The issue I'm having is that it keeps saying "No, Wrong Password". The database password is static, so it's not really pulling from the db but the db value is entered as plain text for test purposes.
Then, my next issue would be how do I convert $plain_password to a new password? Thanks a million in advance
