本文介绍了做密码散列提供真正独特的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否MD5,SHA1和anothers返回唯一值。

I was wondering whether md5, sha1 and anothers return unique values.

例如, SHA1()测试返回 a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 ,这是40个字符长。因此,SHA1比40个字符的字符串较大的必须是相同的(当然,这是炒的,因为给定的输入可能包含空格和特殊字符等)。

For example, sha1() for test returns a94a8fe5ccb19ba61c4c0873d391e987982fbbd3, which is 40 characters long. So, sha1 for strings larger than 40 chars must be the same (of course it's scrambled, because the given input may contain whitespaces and special chars etc.).

由于这个原因,当我们存储用户的密码,就可以输入原来的密码或一些超长的,没人知道。

Due to this, when we are storing users' passwords, they can enter either their original password or some super-long one, which nobody knows.

这是正确的,还是这些散列算法提供真正独特的结果 - 我敢肯定这是几乎不可能

Is this right, or do these hash algorithms provide really unique results - I'm quite sure it's hardly possible.

推荐答案

(注:你问散列功能,不加密)。

(Note: You're asking about hashing functions, not encryption).

这是他们不可能是唯一的,顾名思义。他们采取了大量的输入,并减少它的大小。它显然遵循的话,他们不能再present曾经拥有的COM pressed的信息。所以,不,他们不提供独一无二的结果。

It's impossible for them to be unique, by definition. They take a large input and reduce its size. It obviously follows, then, that they can't represent all the information they have compressed. So no, they don't provide "truly unique" results.

他们的做什么的规定,但是,是抗碰撞的结果。即他们试图表明,两个略有不同的DATAS产生显著不同的哈希值。

What they do provide, however, is "collision resistant" results. I.e. they try and show that two slightly different datas produce a significantly different hash.

这篇关于做密码散列提供真正独特的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 22:42