is SHA-512 collision resistant?

Viewed 13202

According to the books that i have read, it says that S.H.A(Secure Hash Algorithm) is collision resistant.But if the input space is a 1024 bit number and the output space is a 512 bit message digest then shouldn't it be colliding for (2^1024)/(2^512) times? As the range is lesser than the domain being mapped there should have been collisions. please explain where i am going wrong.

3 Answers

As you describe: Since the input space (arbitrary size) is larger than the output space (e.g. 512bit for sha512), there always exist collisions.

"Collision resistant" means, it is adequately unlikely for a collision to be found.

Your confusion is answered when considering how large the output space "512 bits" really is:

2^512 (the number of possible configurations of a 512 bit array) is of the order 10^154.

For comparison: The number of atoms in the visible universe is somewhere in the range of 10^80. A million is 10^6. So a million of our 'visible universes' has 10^86 atoms. A million times a million universes has 10^92 atoms.

If you could store a single 512 bit value on a single atom, how many universes would you need to have all possible 512 bit has values stored?

Starting with a specific 512bit number (and assuming the has function is not broken), the probability p to obtain a collision is assuming you can produce new hashes with a rate R and have the total time of t to do this is:

p = R*t/(2^(512/2))

(The exponent is halved, see "birthday attach". The expected search space for a success is to find a collision in n bits is n/2.) Let's plugin in some example numbers:

The has rate of the bitcoin network is currently about R = 200*10^15 / s (200 million terrahashes per second).

Consider the situation that since the beginning of the universe the bitcoin network's current hashing capacity would have been available for the sole purpose of finding a collision for a specific hash value, i.e. for an available time of t=13.787*10^9 years,

then the probability that a collision would have been found by now is about 7 × 10^-41 %

Again, it is hard to appreciate how small this number is.

Edit: A similar question with a good answer is found here: https://crypto.stackexchange.com/questions/89558/are-sha-256-and-sha-512-collision-resistant

Related