Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert text password to hashed password in wordpress

Tags:

wordpress

I have tried to convert a text password to hashed password by wp_hash_password() function.But the result password is not same as the password saved in wp_users table

$password = wp_hash_password($password); I have also tried it by md5($password); But generated password the not same as the password saved in wp_users table

like image 243
Ranjita Paul Avatar asked Nov 12 '22 01:11

Ranjita Paul


1 Answers

The resuling hash is not supposed to be the same. Thats how the hashing was designed, Each stored password has a salt built in.

Wordpress uses Openwalls phpass (http://www.openwall.com/phpass/)

This makes it much more secure if there is a leak of the database as each row has its own salt so attacks are on a per password basis rather than a per database basis increasing the time taken for brute force and dictionary attacks etc.

Wordpress provide a function wp_check_password for checking a password agaist a hash.

like image 103
exussum Avatar answered Nov 15 '22 04:11

exussum