是否可以解密md5哈希值? [英] Is it possible to decrypt md5 hashes?

查看:190
本文介绍了是否可以解密md5哈希值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我,他已经看到软件系统将接受MD5加密的密码(通过与其他系统的各种集成),解密它们,并使用自己的算法将它们存储在系统自己的数据库中。



这是可能吗?我认为不可能(可行)解密MD5哈希值。



我知道有MD5字典,但有真正的解密算法吗?

解决方案

否。 MD5不是加密(虽然它可以用作某些加密算法的一部分),但它是一种单向散列函数。许多原始数据实际上作为转换的一部分丢失。



想想:MD5总是128位长。这意味着有2 128 个可能的MD5哈希值。这是一个相当大的数,但它是最明确的有限。然而,对于给定的散列函数存在无限数量的可能输入(并且大多数输入包含大于128位,或者大约16个字节)。因此,对于将散列到相同值的数据,实际上存在无限数量的可能性。使哈希值有趣的事情是,发现两个数据散列到相同的值是非常困难的,它偶然发生的几率几乎为0。



一个简单的例子(非常不安全的)散列函数(这说明了它是单向的一般想法)将是取一个数据的所有位,并将其视为一个大数。接下来,使用一些大的(可能是素数)数字 n 执行整数除法,并取余数(参见:模数)。您将在0和 n之间留下一些数字。如果你要再次执行相同的计算(任何时候,在任何计算机,任何地方),使用完全相同的字符串,它会得到相同的值。然而,没有办法找出原始值是什么,因为有无穷多的数字具有精确的余数除以 n



也就是说,MD5被发现有一些弱点,使用一些复杂的数学,可能会发现碰撞,而不尝试2 128 可能的输入字符串。而且大多数密码很短,而且人们经常使用通用值(例如密码或秘密),这意味着在某些情况下,您可以通过Googling为散列或使用< a href =http://en.wikipedia.org/wiki/Rainbow_table =nofollow noreferrer>彩虹表。这是为什么您应该始终 salt 哈希密码的一个原因,以便两个相同的值,当被哈希时,将不会哈希到相同的值。



一旦一个数据已经运行通过哈希函数, / p>

Someone told me that he has seen software systems that would accept MD5 encrypted passwords (through various integrations with other systems), decrypt them, and store them in the systems own database using its own algorithm.

Is that possible? I thought that it wasn't possible (feasible) to decrypt MD5 hashes.

I know there are MD5 dictionaries, but is there an actual decryption algorithm?

解决方案

No. MD5 is not encryption (though it may be used as part of some encryption algorithms), it is a one way hash function. Much of the original data is actually "lost" as part of the transformation.

Think about this: An MD5 is always 128 bits long. That means that there are 2128 possible MD5 hashes. That is a reasonably large number, and yet it is most definitely finite. And yet, there are an infinite number of possible inputs to a given hash function (and most of them contain more than 128 bits, or a measly 16 bytes). So there are actually an infinite number of possibilities for data that would hash to the same value. The thing that makes hashes interesting is that it is incredibly difficult to find two pieces of data that hash to the same value, and the chances of it happening by accident are almost 0.

A simple example for a (very insecure) hash function (and this illustrates the general idea of it being one-way) would be to take all of the bits of a piece of data, and treat it as a large number. Next, perform integer division using some large (probably prime) number n and take the remainder (see: Modulus). You will be left with some number between 0 and n. If you were to perform the same calculation again (any time, on any computer, anywhere), using the exact same string, it will come up with the same value. And yet, there is no way to find out what the original value was, since there are an infinite number of numbers that have that exact remainder, when divided by n.

That said, MD5 has been found to have some weaknesses, such that with some complex mathematics, it may be possible to find a collision without trying out 2128 possible input strings. And the fact that most passwords are short, and people often use common values (like "password" or "secret") means that in some cases, you can make a reasonably good guess at someone's password by Googling for the hash or using a Rainbow table. That is one reason why you should always "salt" hashed passwords, so that two identical values, when hashed, will not hash to the same value.

Once a piece of data has been run through a hash function, there is no going back.

这篇关于是否可以解密md5哈希值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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