MD5 有哪些漏洞以及如何修复?
可能的重复:
如果 MD5 被破坏,更好的解决方案是什么?
MD5 有哪些漏洞以及补救措施是什么?另外,在涉及 MD5 时,非技术人员应该关注哪些问题以及技术人员应该关注哪些问题?
Possible Duplicate:
If MD5 is broken, what is a better solution?
What are the vulnerabilities in MD5 and what are some of the remedies for it? Also, what ares some of the concerns that a non-technical person should have and what are some of the concerns that a technical person should have as it relates to MD5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要使用 MD5。请改用 SHA-2(或更高版本)。
来自此处:
美国国土安全部的 US-CERT 表示 MD5“应该是被认为在密码学上已被破坏且不适合进一步使用,...”,并且大多数美国政府应用程序将被要求在 2010 年之后迁移到 SHA-2 系列哈希函数。
MD5 今天被认为是有害的
Don't use MD5. Use SHA-2 (or higher) instead.
From here:
US-CERT of the U. S. Department of Homeland Security said MD5 "should be considered cryptographically broken and unsuitable for further use,..." and most U.S. government applications will be required to move to the SHA-2 family of hash functions after 2010.
MD5 considered harmful today
MD5 已被破坏,因为它无法成为加密散列。具体来说,它不再具有第二原像抵抗假设我们有
其中
d
是一个文档,h
是它的MD5哈希值。我现在可以找到d1
使得MD5(d1) = h
。这意味着我可以找到第二个声称具有相同哈希值的原像。更糟糕的是,我可以创建一个文档并更改它的隐藏部分,直到获得相同的哈希值。这意味着我可以向您提供虚假文件,而您的哈希检查将相信它是原始文件。
MD5 仍然是一个陷门,因为您无法仅从
h
重建d
。它已被用于密码加密但您绝不能这样做。对于密码的密钥派生,您应该使用 PBKDF2、bcrypt 或(最好)scrypt。SHA1 的石棺上也有凹痕。这就是为什么要选择 SHA-2 或更高哈希函数的原因。
MD5 is broken because it fails being a cryptographic hash. Specifically, it does not any longer have second preimage resistance Suppose we have
where
d
is a document andh
is the MD5-hash of it. I can now findd1
such thatMD5(d1) = h
. This means I can find a second preimage that claims to have the same hash. Worse, I can make a document and alter hidden parts of it until I get the same hash.The implications are that I can feed you a false document and your hash-check will believe it to be the original.
MD5 is still a trapdoor in the sense that you can't reconstruct
d
from justh
. It has been used as such for password encryption but you must never ever do that. For key derivation for passwords, you should either use PBKDF2, bcrypt, or (preferably) scrypt.SHA1 has dents in the sarcophagus as well. Which is why the SHA-2 or higher hash functions are to be chosen.