The wordpress user password is saved in the User_pass field of the Wp_users data table, and the password is generated by portable the PHP password hashing framework class.
The form of the password is random and irreversible, the same plaintext password at different times, the resulting ciphertext is not the same, relatively safe.
WordPress User Password generation process is: when the need to generate a user password, randomly generated a salt, and then add the salt and password, and count the number of times MD5, the last and encode64 the hash of the value of the cumulative, you get a $p$ The beginning of the password, this password every time the result is different, the following is the code that generates the WordPress password, put it in the WordPress root directory, you can generate an encrypted password, with this password to replace the Wp_users data table User_ Pass field to change the password.
<?php
Require_once ('./wp-includes/class-phpass.php '); $password = ' AAA '; $WP _hasher = new PasswordHash (8, TRUE); echo $wp _hasher->hashpassword ($password);
This library can be used in its own program, check whether the password is successful with another function Checkpassword ($password, $stored _hash), the first is clear, the 2nd parameter is the password previously encrypted
require_once ('./wp-includes/class-phpass.php ');
//Original Password$passwordValue= "123456";//Generate password$WP _hasher=NewPasswordHash (8,TRUE);$sigPassword=$WP _hasher->hashpassword ($passwordValue);Echo"The generated password is:".$sigPassword;Echo"\ n";//Verify Password$data=$WP _hasher->checkpassword ($passwordValue,$sigPassword);if($data){Echo' Password correct ';}Else{Echo' Password error ';}
Using wordpress user password algorithm rules to modify user passwords