【发布时间】:2013-11-29 20:10:05
【问题描述】:
是否可以通过任何方法从以下函数产生的哈希中获取密码?
$salt 是随机的 128 个字符的字母数字字符串。
function Get_Hash($pwd, $salt)
{
if ( CRYPT_BLOWFISH == 1)
{
$pwd = hash("sha512",$pwd);
$cost = "07";
$hash = crypt($pwd, '$2a$' . $cost . '$' . $salt);
return $hash;
}
else
{
$pwd = hash("sha512",$pwd);
$hash = crypt($pwd, '$1$' . $salt . '$');
return $hash;
}
}
已经有基本级别的暴力保护,3次尝试失败后系统锁定3-5分钟。
对于小型应用程序来说,这是一个好的散列函数吗?
感谢您的帮助。
【问题讨论】: