为什么 MD5 哈希值不可逆? [英] How come MD5 hash values are not reversible?

查看:19
本文介绍了为什么 MD5 哈希值不可逆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想知道的一个概念是加密哈希函数和值的使用.我知道这些函数可以生成一个独一无二且几乎不可能逆转的哈希值,但这是我一直想知道的:

One concept I've always wondered about is the use of cryptographic hash functions and values. I understand that these functions can generate a hash value that is unique and virtually impossible to reverse, but here's what I've always wondered:

如果在我的服务器上,我用 PHP 生成:

If on my server, in PHP I produce:

md5("stackoverflow.com") = "d0cc85b26f2ceb8714b978e07def4f6e"

当您通过 MD5 函数运行相同的字符串时,您会在 PHP 安装中获得相同的结果.一个过程被用来从某个起始值产生一些值.

When you run that same string through an MD5 function, you get the same result on your PHP installation. A process is being used to produce some value, from some starting value.

这是否意味着有某种方法可以解构正在发生的事情并反转哈希值?

Doesn't this mean that there is some way to deconstruct what is happening and reverse the hash value?

这些函数是什么让结果字符串无法回溯?

What is it about these functions that makes the resulting strings impossible to retrace?

推荐答案

输入材料可以是无限长,其中输出总是 128 位长.这意味着无限数量的输入字符串将生成相同的输出.

The input material can be an infinite length, where the output is always 128 bits long. This means that an infinite number of input strings will generate the same output.

如果您选择一个随机数并将其除以 2,但只记下余数,您将分别得到 0 或 1 - 偶数或奇数.是否有可能取 0 或 1 并获得原始数字?

If you pick a random number and divide it by 2 but only write down the remainder, you'll get either a 0 or 1 -- even or odd, respectively. Is it possible to take that 0 or 1 and get the original number?

这篇关于为什么 MD5 哈希值不可逆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆