是否可以从(部分)MD5 哈希值检索密码?

发布于 2024-10-19 19:34:45 字数 137 浏览 5 评论 0原文

假设我只有 MD5 哈希值的前 16 个字符。如果我使用暴力攻击或彩虹表或任何其他方法来检索原始密码,我期望有多少个兼容候选者? 1? (我不认为)10、100、1000、10^12?即使是一个粗略的答案也是受欢迎的(对于数字,但请与哈希理论和方法保持一致)。

Suppose I have only the first 16 characters of a MD5 hash. If I use brute force attack or rainbow tables or any other method to retrieve the original password, how many compatible candidates have I to expect? 1? (I do not think) 10, 100, 1000, 10^12? Even a rough answer is welcome (for the number, but please be coherent with hash theory and methodology).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

野心澎湃 2024-10-26 19:34:45

MD5 的输出为 16字节(128 位)。我想您正在谈论十六进制表示形式,因此为 32 个字符。因此,“16 个字符”意味着“64 位”。您正在考虑将 MD5 的输出截断为 64 位。

MD5 接受长度最多为 264 位的输入;假设 MD5 表现为随机函数,这意味着 218446744073709551616 可能的输入字符串将或多或少均匀地映射到 264 输出,因此给定输出的候选平均数量约为 218446744073709551552,接近 105553023288523357112.95< /sup>

但是,如果您认为可以找到至少一个候选密码,那么这意味着您考虑的可能密码的空间会大大减少。 rainbow 表 是一种特殊的预计算表,它接受紧凑的表示(以牺牲相对昂贵的查找过程),但如果它涵盖 N 个密码,那么这意味着,在某些时候,有人可以应用哈希函数 N 次。实际上,这严重限制了大小N。假设 N=260(这意味着表构建者拥有大约 100 个 NVidia GTX 580 GPU,可以运行它们六个月;此外,表将使用相当多的很多硬盘),那么平均而言,只有 1/16 的 64 位输出在表中具有匹配的密码。对于表中的那些密码,有 93.75% 的概率表中不存在其他密码导致相同的输出;如果您愿意,如果您找到匹配的密码,那么您平均会找到 0.0625 个其他候选者(即大多数情况下,没有其他候选者)。

简而言之,您问题的答案取决于您考虑的可能密码空间的大小(在彩虹表构建期间涵盖的密码);但是,在使用基于地球的技术的实践中,如果您可以找到 64 位输出的一个匹配密码,那么您很可能无法找到另一个(尽管确实有很多其他密码) )。

The output of MD5 is 16 bytes (128 bits). I suppose that you are talking about an hexadecimal representation, hence as 32 characters. Thus, "16 characters" means "64 bits". You are considering MD5 with its output truncated to 64 bits.

MD5 accepts inputs up to 264 bits in length; assuming that MD5 behaves as a random function, this means that the 218446744073709551616 possible input strings will map more or less uniformly among the 264 outputs, hence the average number of candidates for a given output is about 218446744073709551552, which is close to 105553023288523357112.95.

However, if you consider that you can find at least one candidate, then this means that the space of possible passwords that you consider is much reduced. A rainbow table is a special kind of precomputed table which accepts a compact representation (at the expense of a relatively expensive lookup procedure), but if it covers N passwords, then this means that, at some point, someone could apply the hash function N times. In practice, this severely limits the size N. Assuming N=260 (which means that the table builder had about one hundred NVidia GTX 580 GPU and could run them for six months; also, the table will use quite a lot of hard disks), then, on average, only 1/16th of 64-bit outputs have a matching password in the table. For those passwords which are in the table, there is a 93.75% probability that there is no other password in the table which leads to the same output; if you prefer, if you find a matching password, then you will find, on average, 0.0625 other candidates (i.e. most of the time, no other candidate).

In brief, the answer to your question depends on the size N of the space of possible passwords that you consider (those which were covered during rainbow table construction); but, in practice with Earth-based technology, if you can find one matching password for a 64-bit output, chances are that you will not be able to find another (although there are are really many others).

笑忘罢 2024-10-26 19:34:45

您应该永远无法从部分哈希中获取密码。

You should never ever be able to get a password from a partial hash.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文