我想製作一個鏈接到社交引擎數據庫的其他註冊頁面,但是當我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