The simplest way to explain a hash function is that it maps data from any size to a specific size. So what it does is use a specific hash value to represent the exact data, no matter how long that data is.The graphic below shows what the hash value for the word input looks like,

The hash value of input is 324118a6721dd6b8a9b9f4e327df2bf5

 Hash values are thought to be impossible to parse or reverse, which is why they’re so important. You can’t take a hash value and figure out what the text contains. It’s an encrypted value that simply represents the text. So looking at the hash value on the right, there is no way to know that it represents the word input. And it could just as easily represent the entire collected works of Shakespeare, and you wouldn’t know it.

Hash values are commonly used as a checksum value, meaning that you can download a file and compare the hash value of the downloaded file with the hash value provided by the site you downloaded it from and tell if they’re the same. If the hash values are the same, then you’ve downloaded the file correctly. And keep in mind that hash value in its sort of main attention is not a checksum, but it’s used commonly as a checksum. And the practical purpose for this is in verifying data integrity[An example of the mentioned situation is downloading a file.] If the hash values are the same, then you’ve got an exact copy of the file. And I’ll demonstrate this in a moment, but even minor changes to a file will change the hash value.

Now for some terminology. MD5 hashes use 128-bit encryption, and SHA-1 hashes use 160-bit encryption. They always produce the same result.

So if you create a hash value from a file today and then go back and create a hash value a month from now, the resulting hash will be exactly the same as long as the file hasn’t changed. Now if you look at the below graphic, You can see the MD5 hash value for the text, “the quick brown fox jumped over the lazy dogs.” is 8c1788205b6abffb0c6a4a1f4b10395a.

But look at the hash value for the second example.

The MD5 hash value of “the quick brown fox jumped over the lazy dogs” is 5307233d118e1205882425872a094a68. The sentence starts with a lowercase t. It’s completely different. Notice what’s different about the text each hash represents? Well, in the top example, a capital T is used at the beginning of the sentence. In the bottom example, I use a lowercase t. And that’s the only difference between these two pieces of text. So this should give you an idea of how very specific hash values are, because they change so dramatically for the sake of a single character.

Hash functions are easy to produce. If you want to try it out, you can search for any number of sites that will generate hash values. Enter some text and press a button, then you’ll have your hash value. It’s extremely unlikely that two different files will produce the same hash value, mathematically speaking. It’s practically impossible. And hashes are useful in all sorts of ways. In data management, they’re used to quickly identify duplicate tables and/or records.

This is far more practical than doing a one-to-one comparison of the data in databases because that can be very processor intensive. But hashes are quickly generated and quickly compared. And in cryptography, hash functions are used to validate encrypted data for integrity and anti-tampering. So what are some of the practical uses of hash values? Well, they protect and validate the integrity of data. I’ve already discussed that. And as I said, hash tables are used to identify duplicates in databases. They can identify similar data, and they’re even used in DNA analysis. They’re used with digital signatures and they can be used for detecting and correcting errors. They’re used for digital fingerprinting. And in Bitcoin, hashes are used to verify transactions.

Leave a Reply

Your email address will not be published. Required fields are marked *