>我正在构建一个用户需要先登录的php应用程序
这些登录凭据将与WordPress登录凭据相同
我正在尝试将应用程序与 wordpress 数据库表"用户"连接,其中我们有"user_login"和"user_pass",对我来说的问题是"user_pass"列使用前缀"$S$B"加密,我开始知道 wordpress 使用无法解密的单端 md5 加密方法......
现在我想验证外部应用程序的密码
我试过用这个
$password = clean($_POST['password']);
$pass = "$P$B" .md5($password);
但这没有用
谁能帮我
就我而言,我是一个软件wp使用wp_hash_password($passowrd(功能来加密密码。请检查功能:
/**
* Create a hash (encrypt) of a plain text password.
*
* For integration with other applications, this function can be overwritten to
* instead use the other package password checking algorithm.
*
* @since 2.5
* @global object $wp_hasher PHPass object
* @uses PasswordHash::HashPassword
*
* @param string $password Plain text user password to hash
* @return string The hash string of the password
*/
function wp_hash_password($password) {
global $wp_hasher;
if ( empty($wp_hasher) ) {
require_once( ABSPATH . 'wp-includes/class-phpass.php');
// By default, use the portable hash from phpass
$wp_hasher = new PasswordHash(8, TRUE);
}
return $wp_hasher->HashPassword($password);
}
关注函数哈希密码($password(;尝试在应用程序中使用WordPress的登录API。