Joomla password are stored in database in the form of hash and salt such as {hash}:{salt} where salt is a random string which contains 32 characters in length. Joomla password are salted before making password hashed.So we can create password in joomla like this.
md5($password.$salt)
So if any user wants to check his password first we need to fetch the password field from that user row. lets say the password of any user which is stored in database is
4f9e4ksd5752d5t639aedb42408fd3aa:0vURRbyY8Ea0tlvnTFn7xcKpjTFyn89u
we can split up the password hash and salt.
$hash1 = preg_split (':' , $dbpassword);
echo $hash1[0]; //this is the hash
echo $hash1[1]; //this is the salt
Now we need to calculate the hash using this salt and password which is entered
$hash2 = md5($userpassword.$hash1[1]);
Now if this $hash2 and $hash1[0] are identical the user has entered the correct password.
0 Comment(s)