Need help for hashing/encrypting my password not the MD5 way…

[ad_1]

I’ve created my own custom hashing plugin file with php code:

\`\`\`

<?php
/\*
Plugin Name: Custom Password Hash
Description: Custom password hashing implementation.
\*/
function custom\_wp\_hash\_password($password) {
// Hash the password using SHA-256 algorithm
$hashed\_password = hash(‘sha512’, trim($password));
return $hashed\_password;
}
add\_filter(‘wp\_hash\_password’, ‘custom\_wp\_hash\_password’, 10, 1);
?>

\`\`\`

&#x200B;

However, when I go to my phpmyadmin local database I see the passwords being hashed at the beggining the same way they all start like: “$P$B”. How can I ensure that my SHA512 hashing method works? I tried directly adjusting the functions.php and it hashed my password like: “4f6641c5d834b765dd6687921de51ed6a210a8bf87c61767d7e1196c89ba832b” but then, I couldn’t log in at all to the website as user. It said the password was incorrect.

&#x200B;

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer