512位散列与4个128位散列 [英] 512 bit hash vs 4 128bit hash

查看:160
本文介绍了512位散列与4个128位散列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有趣的是,我没有找到足够的信息关于任何测试或实验的碰撞机会的单个512bit哈希像漩涡,而串联的4 128位哈希像md5,sha1等。

Interestingly I haven't found enough information regarding any test or experiment of collision chances of single 512bit hash like whirlpool versus concatenation of 4 128bit hashes like md5, sha1 etc.

4 128位哈希出现相同的可能性似乎不如单个512位哈希,当执行哈希的数据相当小,只是平均100个字符。

Possibility of 4 128bit hashes to appear same seems less probable than single 512bit hash when the data on which hashing is performed is considerably of small size merely on average 100 characters.

但它只是一个明显的猜测,没有根据,因为我没有进行任何测试。您对此有何看法?

But its just an apparent guess with no basis because I haven't performed any test. What you think about it?

编辑类似
512位元散列与128位元散列。 128位散列。 128位散列。 128位散列(4 128位散列连接)

Edit its like 512bit hash vs 128bit hash . 128bit hash . 128bit hash . 128bit hash (4 128bit hash concatenated)

Edit2
我想对此关于url或哈希的索引考虑RAM
,目的是最小化冲突的可能性,因为I

Edit2 I want to use hash for this index on url or hashing considering RAM and purpose is to minimize the possibility of collision because I want to set hash column as unique instead of url column.

Edit3
请注意,此问题的目的是找到以最小化碰撞的可能性。话虽如此,为什么我需要更多地关注最小化碰撞的可能性?这里有我的Edit2描述,这导致找到解决方案使用更少的RAM。因此,兴趣是在最小化冲突和降低RAM使用。但这个问题的主要焦点是降低碰撞的可能性。

Edit3 Please note that purpose of this question is to find the way to minimize the possibility of collision. Having said that, Why I need to focus more on minimizing the possibility of collision? Here comes my Edit2 description which leads to finding the solution to use less RAM. So, interests are both in minimizing the collision and lower RAM usage. But prime focus of this question is lowering the possibility of collision.

推荐答案

听起来你想比较碰撞行为:

It sounds like you want to compare the collision behaviour of:

hash512(x)

碰撞行为:

hash128_a(x) . hash128_b(x) . hash128_c(x) . hash128_d(x)

其中表示连接, hash128_a hash128_b 等是四种不同的128位散列算法。

where "." denotes concatenation, and hash128_a, hash128_b, etc. are four different 128-bit hash algorithms.

答案是:它完全取决于所涉及的各个散列的属性。

The answer is: it depends entirely on the properties of the individual hashes involved.

例如,考虑128位散列函数可以实现为:

Consider, for instance that the 128-bit hash functions could be implemented as:

uint128_t hash128_a(T x)   { return hash512(x)[  0:127]; }
uint128_t hash128_b(T x)   { return hash512(x)[128:255]; }
uint128_t hash128_c(T x)   { return hash512(x)[256:383]; }
uint128_t hash128_d(T x)   { return hash512(x)[384:511]; }

在这种情况下,性能将是相同的。

In which case, the performance would be identical.

这篇关于512位散列与4个128位散列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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