Cryptographic Hash Functions

Blockchain Simplified

What? Why? How?- We uncover all the ways this process takes in any digital input and throws out an undecipherable output

Photo by Jonathan Farber on Unsplash

What are Hash Functions?

Cryptographic Hash Functions take any kind of input, say letters, numbers, images, documents, videos, movies, paintings, your dog’s tether (you name it!) and convert it into a string of random characters consisting of numbers and letters. It can look something like this:

9D847A83BFCEABFE34A98D38 (Just entered that with my eyes closed!)

Photo by Ilya Pavlov on Unsplash

Why are Hash Functions?

The basic foremost purpose of Hash Functions on the Blockchain network, you could say, would be password protection. Your password is hashed first and then stored in the system. Now you would ask how does that make my password protected. To which I would answer — Lo and behold; irreversibility!

Since your password is hashed first, if any hacker wants to guess your password, they would have to do it through the hash function which would look something like the above-mentioned figure. Unless they are a sorcerer, going back from random letters and numbers to an actual password, that makes sense, is practically impossible.

Another use of Hash Functions would be ease of document review. Say that you form a contract with someone over the newly launched NFTs of a big brand, you lay out all terms and conditions and send it to the other party for review. They send it back with a green light to proceed. But since you are a naturally paranoid individual, (paranoid high-five!) you want to verify whether it was altered in any way.

The most obvious way you could do this is by reading and comparing both documents line by line. The less obvious, in fact, the secret way is that you can take a hash of the document and compare it with the hash of the old document. You see one thing that I conveniently skipped was that even if two inputs are 99.999% similar, their hashes would be completely different. It’s like a signature of your input — unique, just like you. So both the hashes of your document should be exactly the same and if they aren’t, time for a serious talk with the other party.

How are Hash Functions

Disclaimer: This section would be strictly technical, discussing the formation of Hash Functions. So if you are someone who stays away from such talk, skip away.

Hash functions differ in length and hence have different names for their length. E.g. SHA-128 is 128 bits long. SHA stands for Secure Hash Algorithm and bits are binary 1s and 0s that make up the digital world.

SHA-128 is a pretty strong hash function. Let me explain. A 2-bit hash function would be comparatively easy to hack as it would have a total of 4 possible outputs (2²). A 128 bits long hash function, hence, would encompass many more possible outputs.

Even though hash functions comprise letters, they are numbers— hexadecimal numbers. These are numbering systems with a base of 16. So your regular decimal system starts from 0, goes on till 9 and starts from 10 again. But a hexadecimal number starts from 0 goes till 9 then A, B, C all the way till F. Why F? Because that’s the 16th digit in the system thus completing your hexadecimal number.

It would be safe to end it here as to not cause an information overload. Would be glad to answer any queries in the comments. You can also connect with me on LinkedIn for a casual chat on the wonder that is Blockchain. I will see you next time where we discuss Electronic Fingerprints. Can’t wait!

Schedule a DDIChat Session in Blockchain and Cryptocurrency:

Experts – Blockchain and Cryptocurrency – DDIChat

Apply to be a DDIChat Expert here.
Work with DDI:
Subscribe to DDIntel here.

Cryptographic Hash Functions was originally published in DataDrivenInvestor on Medium, where people are continuing the conversation by highlighting and responding to this story.