Merge pull request #463 from eeeeLeeee/patch-2

增加argon2i加密
master
CGDF 8 years ago committed by GitHub
commit 46c36d761a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,9 @@ class Hash
case 'sha256':
return self::sha256WithSalt($str);
break;
case 'argon2i':
return self::argon2iWithSalt($str);
break;
default:
return self::md5WithSalt($str);
}
@ -38,7 +41,11 @@ class Hash
$salt = Config::get('salt');
return hash('sha256', $pwd.$salt);
}
public static function argon2iWithSalt($pwd)
{
$salt = Config::get('salt');
return password_hash($pwd.$salt, PASSWORD_ARGON2I);
}
// @TODO
public static function checkPassword($hashedPassword, $password)
{

@ -254,7 +254,7 @@ $System_Config['pacpp_offset']='-20000';
$System_Config['Speedtest_duration']='6'; //显示多长时间的测速记录
$System_Config['login_warn']='false'; //异地登陆提示
$System_Config['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$System_Config['pwdMethod'] = 'sha256'; //密码加密 可选 md5,sha256
$System_Config['pwdMethod'] = 'sha256'; //密码加密 可选 md5,sha256,argon2i(argon2i需要至少php7.2)
$System_Config['db_charset'] = 'utf8';
$System_Config['db_collation'] = 'utf8_general_ci';
$System_Config['db_prefix'] = '';

Loading…
Cancel
Save