What's the basis behind SHA-1 or SHA-2 or other Checksum algorithms?I read about it here http://en.wikipedia.org/wiki/SHA-1#Data_IntegrityBut I am still wondering about an answer in a layman's language. Can I understand it as a very, very compressed code that can be translated back into original data? Let's say, I have a letter written in notepad. Then the whole of my 1 A4 page size data can be converted into something like this 9b90417b6a186b6f314f0b679f439c89a3b0cdf5. So whenever I want my original data back, I can convert this back into original data?I am very sure that I am wrong here, because it is weird how data that itself contains combination of letters and numbers can be represented by smaller set of letters and numbers. Illogical! Then, what's the basic?
Concept behind SHA-1 Checksum
hashing
A hash is a one-way function to digest an arbitrary amount of data into a result. The function shall have the property that for a particular input, it generates the same output.You could consider addition or multiplication a very horrible hashing function. Given a sum or product, you cannot uniquely determine the numbers that were added or multiplied to produce that result, but you can always given a set of numbers re-add or re-multiply them to test that your set is either probably right, or definitely wrong.A good hash function scrambles the structure of the source data such that the resulting hash bears very little resemblance to the original data, and has properties that small changes in the input causes large changes in the result.