我可以在摘要式身份验证中使用已 MD5 编码的密码吗
我在数据库中有密码的 MD5 哈希值,我想将其用于 HTTP AUTH DIGEST。但在阅读文档时,摘要哈希看起来包含用户名、领域和明文密码的哈希。在这种情况下有什么办法可以使用密码的 MD5 哈希吗?
I have MD5 hashes of passwords in a database that I want to use against HTTP AUTH DIGEST. But in reading the docs, it looks like the digest hash contains a hash of the username,realm and plaintext password. Is there any way to use the MD5 hash of the password in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不。如果他们需要的散列是这样生成的:
MD5(用户名+领域+密码)
你就不走运了。
如果他们像这样对密码进行哈希处理:
MD5(MD5(密码) + 用户名 + 领域)
您只需使用哈希密码即可做到这一点。但听起来情况并非如此。
No. If the hash they need is generated like so:
MD5(username + realm + password)
You are out of luck.
If they are hashing the password like so:
MD5(MD5(password) + username + realm)
You'd be able to do that with just the hashed password. But it doesn't sound like that's what's going on.
不,您必须在表中存储 Digest 的 HA1 哈希值,并将其用于其他类型的身份验证(表单和基本)。请参阅此处:将密码存储在表和摘要式身份验证中
No, you have to store in the tables the HA1 hash of Digest and use that for other types of auth (forms and Basic). See here: Storing password in tables and Digest authentication
不,这是不可能的。摘要身份验证的全部目的是避免重放攻击,即某人仅拥有(某些身份验证数据)的散列版本而不是真实数据。
它不仅是用户名、真实密码和明文密码的哈希值,而且还是一个随机数,每次都会改变。所以你确实需要明文密码。
No, this is not possible. The whole point of digest authentication is to avoid replay attacks, i.e. were somebody has only a hashed version (of some authentication data) rather than the real data.
Not only is it a hash of username, real, and plaintext password, but also a nonce, which will change every time. So you really need the plaintext password.
不可以。在摘要式身份验证中,密码通过质询进行哈希处理,无法使其与另一个哈希一起使用。
通过 HTTPS 的基本身份验证更安全,并且它应该与您的散列密码一起使用。
No. In digest authentication, the password is hashed with a challenge, there is no way to make it work with another hash.
Basic auth over HTTPS is more secure and it should work with your hashed password.