Ranjita Paul
Ranjita Paul

Reputation: 185

How to convert text password to hashed password in 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

Upvotes: 5

Views: 1609

Answers (1)

exussum
exussum

Reputation: 18550

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.

Upvotes: 1

Related Questions