How to create wordpress password hash generator using php?

I want to create WordPress password hash using PHP like www.passwordtool.hu. An example:

Wordpress Password: admin321

Wordpress Password Hash: $1$8HmCMIeg$qv9z585yftJa2Hxqo7/RB/

Online Password Generator Tool: http://www.passwordtool.hu/wordpress-password-hash-generator-v3-v4

How to create this WordPress password hash generator using PHP?

1 answer

  • answered 2018-07-12 07:24 Sudharshan Nair

    Wordpress provides a default function wp_hash_password();

    Example:

    $password = 'admin';
    $hash_password = wp_hash_password($password);
    echo $hash_password;
    

    To work this in PHP just load wp-load.php, So that you can use default wordpress functions.

    Wordpress actually use Portable PHP password hashing framework. WP has this included in /wp-includes/class-phpass.php