SHA256 Hash & Five requirement of Hash Algoriithms


In a way you can say that a fingerprint is an identifier of a person and that's a very powerful concept which is used by forensics departments in the police where they can identify criminals just by their fingerprints and take that as evidence to court.Now what if we could take the same principle and apply it to digital documents. But if we could come up with a sort of fingerprint that would identify these documents for us and such a fingerprint exists it's called Shower 256 hash.
The algorithm behind Shutt 256 was developed by the NSA.And a lot of places in the World War applications use to store passwords.
Check digital documents too.And in fact in blotching it is used like one of the core things core principles building blocks of block chain as we will see further down in this section and the code for the algorithm for Shudra and 56 is open source.Anybody can learn it.
Understand how it works out.The hash is called Chateau-Renaud 56 because Shas stands for secure hash algorithm and 256 is the number of bits it takes up in memory. The hash is always 64 characters long and it consists as you can see if not just from digits but actually from letters as well.That's because it's a hexadecimal hash it has numbers from 0 to 9 and the letters A B C D E F. So there's a total of 16 of them there.So that means each character in the resulting hash takes up four bits because for the power of two 16 and 410 64 is turning 56.That's how these numbers are all linked up together 64 times 4 which is the size of any size of basically any one of these is 256. And the important thing to note here is that this algorithm works not just for word documents or text documents. It works for any digital document or any digital just anything digital.

So you could put a video into the algorithm you could put like text you could put an audio you could put an executable file you could put a whole operating system in there whatever you put in there it will spit out a fingerprint which is a shot of hash.

So because like we humans take the same person who check their fingerprints and then you take the same person checked the finger is going to be the same every time. Otherwise it wouldn't really make sense you would be able to use it for forensics.Another thing is that if we change one tiny symbol like we add like a another exclamation mark here the hash changes completely and entirely.That's called the avalanche effect.

The Five requirement of Hash Algoriithms

1) One-Way

2)Deterministics

3)Fast Computation

4)The Avalanche Effect

5)Must withstand collisions

So the five requirements for hash algorithms is shot out of which six is not the only one. There's other algorithms shout 512 Chah 3.
And you could come up with a hashing algorithm.However there are certain requirements for it to be useful.So basically what that means is that you cannot go backwards.You cannot go from the hash to the documents so you cannot restore or reverse engineer the document based on the hash.It has to be like a fingerprint like for a human.If you have the fingerprints you cannot restore what the person looks like.You cannot understand you know what color eyes they had or anything else about them. But at the same time you have if you have a person you can always get the fingerprints. There's only one way.
Number two is it has to be deterministic meaning that if I take the same document exactly the same document later on and I run the same apply the hash algorithm again I'll get exactly the same result as we saw with that llustration.
So these two or three fourths of our requirement is it has to be has to have fast computation.And the fourth requirement is the avalanche effect. And I specifically put an image here because too like ingrain this in our memory so we remember that we saw this avalanche on the screen. It is an ultra important requirement of the hash algorithm.
So let's see what it implies. The average effect means that if I take exactly the same document and I change it like make a tiny oil change even one bit of data change in the document for instance we've got a plus one over there here. So if we do that you'll change any change then the hash will be absolutely different.So we really saw that in the demonstration where when we were adding an X or exclamation mark or making some other small changes though the reason is called the avalanche effect is because of how that is implemented inside the algorithm. We're not going to go into detail now but like you'll be able to check that in the paper if you like but it basically that one change triggers may a few changes and they in turn trigger more changes and they are more changes.
So it's very smart how it's caused and it's very similar to an avalanche where like one tiny like wrong step can cause snow to start moving and then more snow moves and snow more snow more and you get an avalanche. So that's what the avalanche effect is and it's very very important in the application of block chain.

And part five it must withstand collisions.So what does that mean. What is static collisions mean. Well it means like what as we saw with with people that sometimes one in 60 million that you're going to have to people who have the same thing to print and same thing for the hashing algorithm because the I got the pictures on the screen already. In a second so I'll explain what the pigeons are doing there. So with the hash algorithm as you can see it's 64 bits.

Right so it's very limited. Even though like there's a lot of different variations as you can have it's still limited it's not infinite. And yet the quantity of different digital documents that we can create is unlimited is enormous.We can like there's tons and tons of books tons of different photos being created every single day videos all this stuff.
So in essence the amount of digital data we have is much much greater than we can possibly have is much greater than the difference the number of variations of a 64 character representation.
And so that means that there is a principle called the pigeon hole principle. That means if you have for instance in this case 10 pigeons and only nine holes you're gonna have to put two pigeons into one of those holes. There's no way around that. Right so if you have more of a quantity a then there is slots and quantity B.

Then inevitably there will be what we call collisions in quanta in that representation when you try to move from quantity which is much greater to quantity. So naturally they will be collusions and you can do anything about it just pigeonhole principle and that's ok.The thing with that is that it is so unlikely it is so rare that that will happen that we can deal with. It's not going to ruin the whole room. The problem just like with humans and fingerprints we can tolerate that. That's a very rare instance and it's pretty much a very very unlikely to happen. And like it's not going to affect anything if it does happen somewhere sometime. But we must have some collisions what that does mean is that we need the algorithm needs to be able to withstand artificial collisions that for instance pirates can create. And that's a problem.

So if you can find a way to create these collisions to make two different documents purposefully have the same hash that's a problem because then you can forged documents then you might have an important document that for instance is who's who this house belongs to. Like ownership document.

And it might have a name in there.And if you know if there's a way to forge collisions to create artificial collisions then you will be able to change the name on the documents and the hash will be the same.

So the person checking the document by the hash will think that you are the owner of the house. And so that's what we mean by withstand collisions. So collisions should not be possible.So there we go those are the five requirements for secure and safe hash algorithms. They have to be one way deterministic a fast computation the avalanche effect and must withstand collisions.

Comments