我应该使用哪种密码哈希方法?
这个问题让我再次开始思考密码哈希。我目前使用 bcrypt (特别是 py-bcrypt)。我听说过很多关于 PBKDF2 和 scrypt 的事情。
我想知道是否有任何我可能不知道的“更现代”的密码哈希方法(因为它们是新的,所以人们不会过多谈论它们),或者可能是我不知道的其他方法了解。
然后从那里开始,我应该使用哪一个?大多数人似乎推荐 bcrypt,但我想知道这是否只是因为它很旧(阅读:众所周知)。 scrypt 似乎更好(内存使用量可变)。我对PBKDF2了解不多。
那么,如果我制定一个用户管理方案,我应该使用其中哪一个?或者我应该使用完全不同的东西?
This question made me start thinking about password hashing again. I currently use bcrypt (specifically py-bcrypt). I've heard a lot about PBKDF2, and scrypt.
What I'm wondering is if there are any "more modern" password hashing methods that I might not know about (because they're new, so people don't talk about them as much), or maybe other methods I don't know about.
And then going on from there, which one should I use? Most people seem to recommend bcrypt, but I wonder if that's just because it's old (read: well-known). scrypt seems better (variable amount of memory usage). I don't know much about PBKDF2.
So if I make a user-management scheme, which of these should I use? Or should I use something completely different?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PBKDF2 用于 WPA/WPA2 和域缓存凭据 2(AKA DCC2)。您可以更改 HMAC-SHA1 的迭代以提高安全性。这种减缓裂解过程的方法是不间断的。不过,由于它是基于 SHA1 的,因此您可以称其为 GPU 友好型攻击。
bcrypt 和 scrypt 都使用查找表。这种内存依赖性使其对 GPU 不友好。然而,最新的 28 nm GPU 架构重新启用了对内存的快速访问。
现在你应该选择 bcrypt 或 scrypt。使用依赖于内存的哈希是一个不错的选择,但将来这种情况可能会改变。密切关注破解者的 GPU 性能如何提高。它们可能会达到一个事件范围,此时最好切换回只进行 GPU 友好的哈希,但增加迭代次数。
PBKDF2 is used in WPA/WPA2 and Domain Cached Credentials 2 (AKA DCC2). You can change the iterations for the HMAC-SHA1 to increase security. This method of slowing down the cracking process is unbroken. However, since it is based on SHA1, you can call it GPU-friendly to attack.
Both, bcrypt and scrypt, use a lookup table. This memory dependence makes it GPU-unfriendly. The latest 28 nm GPU architectures however re-enable very fast access to memory.
For now you should favor bcrypt or scrypt. It is a good choice to use memory dependent hashes, but in the future this might change. Keep an eye on how GPU performance of the crackers increase. It is possible that they will reach an event horizon on which it will be better to switch back to just do GPU-friendly hashes but increase their iteration count.