我試圖放在一起的PHP登錄腳本,並已注意到以純文本格式存儲我的數據庫paswords是不安全的。我的connect.php文件是否安全?我如何在下面的connect.php文件中使用salt加密?初學PHP學習者嘗試使用Salt加密
感謝和抱歉的一個基本問題,我對PHP仍然很陌生。
<?php
if(!defined('INCLUDE_CHECK')) die('You are not allowed to execute this file directly');
/* Database config */
$db_host = 'localhost';
$db_user = 'randomuser';
$db_pass = '123456';
$db_database = 'randomdatabase';
/* End config */
$link = mysql_connect($db_host,$db_user,$db_pass) or die('Unable to establish a DB connection');
mysql_select_db($db_database,$link);
mysql_query("SET names UTF8");
?>
你沒有,也不會如果「鹽加密」你的意思是「使用鹽散列源代碼:) – 2012-02-13 06:33:36
同時對密碼進行哈希處理「,這是指任何用戶密碼,而不是數據庫連接 – 2012-02-13 06:50:04