开发者

Different output, same username and password

开发者 https://www.devze.com 2022-12-30 11:58 出处:网络
I was wondering why even for the same username and the same password, htpasswd outputs a new hash everytime? I tried finding an answer开发者_如何学JAVA to this question, but couldn\'t.The passwords ge

I was wondering why even for the same username and the same password, htpasswd outputs a new hash everytime? I tried finding an answer开发者_如何学JAVA to this question, but couldn't.


The passwords generated by "htpasswd" use a random salt, to make it harder to guess. It also means that pre-crypted dictionaries for attacks have to be much larger since they have to crypt every possible password with every possible salt.

htpasswd uses crypt(3) behind the scenes.


Here is a tip for you, when generating secret keys or strings, use a one_way_hash( salt + current time), these are, if not impossible, hard to crack. I normally employ this to create tokens or session keys.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号