我想制作一个链接到社交引擎数据库的其他注册页面,但是当我MD5密码并将其存储在se_users表中时,用户无法登录,我相信社交引擎有另一种加密方法,有人可以给我一个函数来加密社交引擎的方式吗?社交引擎密码加密帮助
这是他们的功能,但我不知道如何实现它在我的脚本:
function user_password_crypt($user_password)
{
global $setting;
if(!$this->user_exists)
{
$method = $setting['setting_password_method'];
$this->user_salt = randomcode($setting['setting_password_code_length']);
}
else
{
$method = $this->user_info['user_password_method'];
}
// For new methods
if($method>0)
{
if(!empty($this->user_salt))
{
list($salt1, $salt2) = str_split($this->user_salt, ceil(strlen($this->user_salt)/2));
$salty_password = $salt1.$user_password.$salt2;
}
else
{
$salty_password = $user_password;
}
}
$user_password_crypt = md5($salty_password);
return $user_password_crypt;
}
感谢
你的意思是哈希,而不是加密。 – igorw 2010-07-17 19:06:23