哈希冲突的例子?
出于演示目的,有哪些字符串在散列时发生冲突的示例? MD5 是一个相对标准的散列选项,因此这就足够了。
For demonstration-purposes, what are a couple examples of strings that collide when hashed? MD5 is a relatively standard hashing-option, so this will be sufficient.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道的第二个最有趣的碰撞是:
与此碰撞(删除括号中的部分):
这是两个 X.509 证书,其中只有第一个证书实际上由证书颁发机构签名。 第一部分只是标头,但最后一部分(您会注意到这两个证书中的部分是相同的)是冲突消息的 MD5 哈希值的 RSA 签名。 这意味着第二个(假)证书将被验证为已由证书颁发机构的 RSA 私钥签名。
此次攻击涉及 200 多台 Playstation 3 来准备攻击,并且攻击者巧妙地选择了时机。 有关更多详细信息,请参阅:MD5 目前被认为有害。
我所知道的最有趣的碰撞是 Flame 间谍恶意软件中使用的碰撞。 使用不同但相似的技术,高级持续威胁(很可能是西方情报机构)创建了一个虚假的代码签名证书,声称是由 Microsoft 签名的。 例如,请参阅本文。 不幸的是,我无法访问实际的证书和实际的 MD5 冲突。
The second-most interesting collision I know of is this:
which collides with this (remove the parts in parentheses):
Those are two X.509 certificates of which only the first one was actually signed by the Certificate Authority. The first part is just a header, but the last part (which you will note is the same in the two certificates) is an RSA signature of the MD5 hash of the colliding messages. This means that the second (fake) certificate will validate as having been signed by the Certificate Authority's private RSA key.
This attack involved more than 200 Playstation 3 to prepare the attack and some clever timing on the part of the attackers. For more details see: MD5 considered harmful today.
The most interesting collision I know of is the one used in the Flame espionage malware. Using a different, but similar, technique, an advanced persistent threat (most probably a western intelligence agency) created a fake code signing certificate that claimed to have been signed by Microsoft. See for instance this article. Unfortunately, I don't have access to the actual certificates and the actual MD5-collision.
此页面提供了这些 128 字节值哈希为相同值的示例:
和
注意尽管您的问题要求碰撞的“字符串”,但 MD5 是在二进制数据上定义的,因此“字符串”的正常文本含义并不真正适用。 允许您获取文本数据的 MD5 哈希值的语言和库通常意味着“以指定的编码对字符串进行编码,然后对结果进行哈希处理”。
This page provides these examples of 128 byte values hashing to the same value:
and
Note that although your question asked for "strings" which collide, MD5 is defined over binary data, so the normal text meaning of "string" doesn't really apply. Languages and libraries which allow you to take the MD5 hash of text data usually mean "encode the string in a specified encoding, then hash the result."
Søren Steffen Thomsen 发布了一个用 C 语言编写的 md5 碰撞查找实用程序。可能玩起来很有趣。
Søren Steffen Thomsen released a md5 collision finder utility written in C. Might be fun to play with.
(对于未来的读者,我想添加此资源)
这里是 GitHub 上的最新集合,范围包括从图片到 poc 脚本。
*包括破碎
(For the future readers I want to add this resource)
Here is a pretty recent collection at GitHub, ranging from pictures to poc-scripts.
*Includes shattered