echsop的users表password加密模式

來源:互聯網
上載者:User
echsop的users表password加密方式
我自己做了一個網站,但是要訪問是ecshop的users表來實現登入,但是ecshop的users密碼加密了,查看了ecshop的compile_password方法,還是不明白該怎麼使用加密這個方法。
function compile_password ($cfg)
{
//var_dump($cfg);
if (isset($cfg['password']))
{
$cfg['md5password'] = md5($cfg['password']);
}
if (empty($cfg['type']))
{
$cfg['type'] = PWD_MD5;
}

switch ($cfg['type'])
{
case PWD_MD5 :
if(!empty($cfg['ec_salt']))
{
return md5($cfg['md5password'].$cfg['ec_salt']);
}
else
{
return $cfg['md5password'];
}

case PWD_PRE_SALT :
if (empty($cfg['salt']))
{
$cfg['salt'] = '';
}

return md5($cfg['salt'] . $cfg['md5password']);

case PWD_SUF_SALT :
if (empty($cfg['salt']))
{
$cfg['salt'] = '';
}

return md5($cfg['md5password'] . $cfg['salt']);

default:
return '';
}
}






$con=mysql_connect("localhost","admin","");

if (!$con){
die('Could not connect: ' . mysql_error());

}
$command=mysql_select_db("yihaichao",$con);
mysql_query('SET NAMES gbk');
if(!$command){
exit('串連資料庫失敗');
}
if(!isset($_POST['submit'])){
exit('傳值失敗');
}
$passowrd=$_POST['password'];
$username=$_POST['username'];
$passowrd=md5($password);
echo $passowrd;
if($username && $passowrd){
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.