我有一些关于PHP的 我注意到如果 p>
所以 我的问题是 p>
1) 2)我可以在 3)为什么使用 password_hash code>函数的问题。 p>
\ n
echo password_hash(“12345”,PASSWORD_DEFAULT);
code> pre>
< p>然后我得到一些像 p>
$ 2y $ 10 $ PgMmle9Ue4o3m7ITJcGa0ucmWXSZgqbJBF9I4qd / aqzn / vQIwbi / O
code> pre>
$ 2y $ 10 $ code>的部分不会暗示使用了什么algorythm并让攻击者更容易知道 原始字符串是什么? p>
$ 2y $ 10 $ code>之后存储字符串,并在我必须使用密码时连接它吗? / p>
$ 2y $ 10 $ code>? 这会改变未来吗? 所以在我的数据库中,我有
$ 2y $ 10 $ code>的密码和一些
$ 2y $ 25 $ code>的密码? 并且所有内容都可以使用
password_verify code>? p>
div>顺利运行
I have a few question regarding PHP's password_hash
function.
I've noticed that if do
echo password_hash("12345", PASSWORD_DEFAULT);
then I get somethng like
$2y$10$PgMmle9Ue4o3m7ITJcGa0ucmWXSZgqbJBF9I4qd/aqzn/vQIwbi/O
So my questions are
1) Wouldn't the part of $2y$10$
give a hint of what algorythm was used and make it easier for an attacker to know what the original string was?
2) Can I just store the string after $2y$10$
and concatenate it anytime I have to work with the password?
3) Why $2y$10$
is used? Could that change in the future? So in my DB I have passwords with $2y$10$
and some with $2y$25$
? and everything would run smoothly using password_verify
?