Collision Probability SHA1

Given a set of 100 different strings of the same length, how can you quantify the likelihood that a SHA1 collision for strings is unlikely to be ...?

+63
probability hash sha1
Dec 08 '09 at 14:07
source share
3 answers

alt text

Are 160-bit hash values ​​received from SHA-1 large enough to ensure that the print of each block is unique? Assuming random hash values ​​with a uniform distribution, a collection of n different data blocks and a hash function that generates b bits, the probability p that there will be one or more collisions is limited by the number of pairs of blocks, the probability that this pair will collide is multiplied.

(source: http://bitcache.org/faq/hash-collision-probabilities )

+139
Dec 08 '09 at 14:17
source share

Probably the probability of a collision will be:

1 - ((2^160 - 1)/2^160) * ((2^160 - 2)/2^160) *... * ((2^160 - 99)/2^160)

Think about the probability of a collision of 2 objects in space 10. The first element is unique with a probability of 100%. The second is unique with a probability of 9/10. Thus, the probability that they are unique is 100% * 90% , and the probability of a collision:

1 - (100% * 90%), or 1 - ((10 - 0)/10) * ((10 - 1)/10), or 1 - ((10 - 1)/10)

This is rather unlikely. You must have many lines in order for this to be a distant opportunity.

Take a look at the table on this page on Wikipedia ; just interpolate between lines for 128 bits and 256 bits.

+4
Dec 08 '09 at 14:14
source share

What is a Happy Birthday Problem - the article gives nice approximations that make it easy to estimate the probability. The actual probability will be very very low - see this question for an example.

+3
Dec 08 '09 at 14:13
source share



All Articles