F
F
FMars2014-06-19 16:45:25
Programming
FMars, 2014-06-19 16:45:25

How is it possible to hash any file if the number of combinations of the hash sum itself is limited?

It is clear that the number of hash sum combinations for each algorithm is huge, but there are even more files (or even simple strings).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2014-06-19
@FMars

the number of hash sum combinations for each algorithm is huge, but there are even more files (or even simple strings)

There are more possible files. Actually used - much less. Those. if we take 10 9 computers sorting through 10 9 files per second, then it will take 2 160 /10 18 = 10 30 seconds to sort through all possible values ​​of sha1 , i.e. 4 * 10 22 years, which is much more than the age of the Universe.

D
Dmitry Entelis, 2014-06-25
@DmitriyEntelis

In practice, on live data and playful users, collisions in hash functions are much more common than theoretically expected. Therefore, on a live project, it is important to remember that if the hash of the function matches, it does not mean "the source lines match", but " probably the source lines match"

A
Andrew, 2014-06-19
@OLS

In addition to @jcmvbkbc 's perfectly correct answer :
By the birthday paradox, the first collision is most likely to occur when sqrt(2^N) has been created, i.e. 2^(N/2) documents. So, in order to create such a mass of files for MD5, the entire population of the globe must create one document every second for 100 years.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question