Hash does not result in a unique number. The goal of a hash is to demonstrate that the original file has not changed, not to identify or recreate that unique file.
Consider these different ways of adding up to 10.
1 + 4 + 2 + 3
2 + 2 + 1 + 3 + 2
5 + 2 + 1 + 2
3 + 6 + 1
Okay, all of those strings add up to 10. If you change any number in a string, that string no longer adds up to 10. The purpose of the hash is to alert you to any kind of corruption or replacement to the file you think you are getting. You are provided with a hash and a file. If they still match when you add up the numbers again, you can be confident the file has not been altered.
But, if all you have is a hash, you have no way of know which of the ways of adding up to 10 the file represents.
Expand this to the scale actually used in practice, you’re not wondering “which way of adding up to 10 did the original file use”. It’s “which way of adding up to some number on the order of trillions (actually, even much bigger than that) produced this result? It can’t be reversed engineered. There are billions of possible “right” answers.
Hashes are one way. All you are doing is checking that you’re still getting the same answer so you know nothing was changed. You’re not determining what the contents of the source file are.
Latest Answers