What is Hash Cryptography?

Hash Cryptography is one of the main pillars of blockchains. SHA256, the cryptographic hash function in the Bitcoin blockchain makes it what it is, a securely linked chain of blocks. And in this two part series, we’re going to learn why. But before that.

What is the easiest way for us to uniquely identify humans?

“Just by looking at them” is not the answer. There are too many people with the same hairstyle, similar facial structure, skin tone and almost all other visual factors.

I’m going to save your time, and tell you the answer.

Fingerprint.

hash-cryptography-fingerprint
Human Fingerprint: Equivalent to a document’s hash

 

The easiest way to uniquely identify humans is by their fingerprints. Almost every human has a unique fingerprint. And this can (and is) used to uniquely identify us.

Fingerprints of Digital Documents?

What about digital documents? Or a text string. Or an Operating System? How to identify these uniquely?

The answer is same. Digital fingerprint.

Hash Cryptography helps us to find these digital fingerprints. You take a piece of information (could be a pdf, a text, or a movie), pass it through a cryptographic hash function and the output you will receive is the hash (or digital fingerprint) of that document.

working of hash cryptography
Hash Cryptography analogy

In our previous post, we studied how the chain of blocks is linked using the Previous Hash field in the Bitcoin Blockchain. The Previous Hash and the Hash field are computed using a cryptographic hash function.

SHA256

The cryptographic hash function used in this case is SHA256. SHA stands for Secure Hash Family, a family of many cryptographic hash functions like SHA256, SHA512, SHA1, etc.

SHA256 was developed by the NSA (National Security Agency) and the code was later made open source. The 256 in the name denotes the number of bits it takes in memory. It is a 64 character long hexadecimal hash where 4 bits represent each hexadecimal number.

In the Bitcoin Blockchain, the current hash is computed by giving the Data Field and the Previous Hash field as input to the SHA256 function, and the function returns the output i.e. the hash or fingerprint of the given data.

You can use the SHA256 or any modern cryptographic hash functions to find the hash (fingerprint) of any piece of information. You can find the hash of documents, strings, executables, binaries, movies, entire Operating Systems, etc. Play around with SHA256 hash function here.

An important property of cryptographic hash functions is that they are one way. That means, you can go from a document to a hash, but not recover a document from the hash. This is what makes hashes secure and protects the immutability of blockchains.

A good cryptographic hash function should have five important properties. We will cover these five properties in detail in Part 2, but you can watch a brief introduction to these properties in the video below.

 

If you liked this article, join our community on Instagram, Telegram and Twitter.
For free Udemy Course coupon codes, check our Free Courses page.
569 thoughts on “Hash Cryptography Part 1: Understanding SHA256 Usage”
  1. […] In Part One, we understood what a cryptographic hash function is and how it works. If you missed that post, we suggest please go back and go through it before going any further. Today, we will understand the Five Requirements of a good Cryptographic Hash Function. Before we start, we suggest you watch this one minute summary video of today’s post. […]

  2. Hey, I think your website might be having browser compatibility issues. When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, superb blog!

  3. I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. Personally, if all web owners and bloggers made good content as you did, the net will be much more useful than ever before.

  4. I’m really enjoying the theme/design of your web site. Do you ever run into any internet browser compatibility problems? A handful of my blog audience have complained about my site not operating correctly in Explorer but looks great in Chrome. Do you have any tips to help fix this problem?

  5. I am very happy to read this. This is the type of manual that needs to be given and not the random misinformation that is at the other blogs. Appreciate your sharing this best doc.

  6. Hello There. I found your blog using msn. This is a very well written article. I抣l be sure to bookmark it and return to read more of your useful information. Thanks for the post. I抣l definitely return.

  7. The quatern oral examination PDE5 inhibitors commercially uncommitted in the
    U.S. are sildenafil citrate (Viagra, Pfizer), vardenafil (Levitra
    and Staxyn, Bayer/GlaxoSmithKline), tadalafil (Cialis, Eli Lilly), and a Sir Thomas More
    latterly sanctioned drug, avanafil (Stendra, Vivus). The expansion of this grade has
    allowed for greater flexibleness in prescribing based on single reaction. http://lm360.us/

  8. I believe what you wrote was actually very logical. But,
    what about this? what if you added a little content? I am not suggesting your content is not solid., but what
    if you added a headline that grabbed folk’s attention? I mean Hash Cryptography Part 1: Understanding SHA256 Usage – The Blockchain Blog is a
    little boring. You could peek at Yahoo’s front page and note how they write post headlines to grab people to open the links.
    You might add a video or a pic or two to grab readers excited about what you’ve written. Just my opinion, it could make
    your website a little bit more interesting.

Leave a Reply

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