What we talk about cryptography we tend to only think about one part of the CIA of security.
There remember CIA stands for confidentiality integrity and availability.
So when we talk about cryptography we tend to concentrate on confidentiality.
Right we're encrypting stuff.
Well that's not always the case.
Well I want to talk about right now something called hashing a hash provides integrity when it comes
to the CIA of security.
Now we don't encrypt with the hash we make things in Taggerty a fight.
I'm going to stick to that word because that's now part of the Webster's dictionary.
So let me explain how a hash works.
The idea behind a hash is that it is an algorithm.
That's why I got my algorithm machine here and it doesn't encrypt what it will do is it will take a
arbitrarily large amount of data and you take that data and you run it through and it comes out in a
fixed value every time.
So if I have a five letter input it's going to come out.
However whatever size the hash is if I have a 300 billion byte input it's always still going to come
out this size.
Now at first glance he'd say Well Mike what am I going to do with that.
Well there's a couple of things about hashes that are cool.
Number one hashes are one way.
If I generate this and I create a hash there is no way it is impossible to figure out what the actual
original data was.
The other thing that's cool about a hash is that it's deterministic.
So look at this he starts with 1 a 6.
Got it.
So I take this document and it doesn't have to be a document it could be a image it doesn't matter as
long as it's ones and zeros.
And if I could take all knowledge known to man from the beginning of mankind and put it into a big word
document and I could go to page $405 and in twenty seven thousand six hundred twenty two and I could
go in there and change one letter one letter change so this upper case could change it to a lower case
c and if I take that value and I run it through a hash algorithm it's going to come out with a completely
different value.
So hashes are a very good way to say this is the data from which I got.
So for example if I'm downloading a big executable file I can run a hash on it and compare it to the
hash value that's up on the Web site and then that way if it didn't come down right or something I could
clearly and very explicitly know that this is the right values so hashes are something we use all over
the place within the world of cryptography so that's the basics of a hash.
Now for the security plus there are lots of hashes hashes have been going around for a long long time
and we have a lot of different versions of them.
They all have different size outputs or what we call a message digest they're all the same word.
And what I want to do right now is just take a minute and let's run through the different types of hashes
that you're going to see on security plus there are a zillion types of hashes out there but luckily
for us we can break down what you need to know for the security plus into three groups.
First is called Message Digest version 5 better known as M.D 5 and 5 is the grandpa of hashes.
It's been around since the early 90s.
It was invented by Ron Rivest of RSA fame and it's been used for years and years and years and years.
The important thing to remember about M.D 5 is that it uses a 128 bit hash.
Now M.D five is a great one but they found a little problem with an ox plane that in just a moment.
The second type of hash I want you to be aware of is the secure hash algorithm better than the Shah.
And this is a family of hashes that were developed by the National Institute of Standards here in the
U.S. technically they're still being developed the earliest version of Shaw that you're going to see
on the security plus is called Shaw Dash 1.
Now Shaw one has a 160 bit hash.
Now here's the problem.
Both M.D 5 and Shaw 1 have the ability to generate what we call collisions.
Let me explain that.
A collision simply means when you take two different types of data and generate the same hash.
If you can force a hash to make occasional collisions it can often be figured out how the hash works.
And that is a naughty naughty thing.
We don't like that.
So neither end D5 nor shot want or use that commonly anymore.
If you're talking about hashes that are being used today for websites and all kinds of stuff we're talking
about shot to now shot to is not just one type of hash shot two is broken down into different types.
Based on the length of the hash.
So we don't see a shot to what we will say though is shot 256 or shot 512.
So you could see that these big long hashes are much less prone.
In fact no one's made a collision with them yet.
Knock on wood.
The last type of hash I want to talk about.
It's mentioned on security plus.
Let me bring it up is right.
EMT and that stands for race integrity primitives evaluation message digest.
Now this is not a real common hashing algorithm.
It's nice because it's open standard that everybody can check it out but it's just not used that much.
Nothing really wrong with it it just that everybody like shot to these days but do be aware for the
test that right BMD comes in 128 160 256 and 320 bit versions and you will be tested on every one of
these on the security plus Yep that is a lot of hashes you need to memorize my friends.
Not only do you need to memorize the different names of each hash but make sure you know the size of
the hash because the security plus loves to hash on that sorry OK I'll keep my day job.
Now people will ask me especially just been exposed to this.
What do we do with hashes.
The easier answer is within the world occurred toggery you would be hard pressed to find a place where
we don't use hashes.
Some great examples.
Example Number one password storage.
Most operating systems never store your passwords so you type in a password at it at it and you hit
enter and the password is saved onto the hard drive only as its hash.
So when you type in your password to log into something it goes ahead and hashes it and compares it
and says oh you type in the right password.
We use hashes on virtually every type of encryption and authentication known to man we use hashes everywhere.
So what I'm on right now is you only need to memorize the different types of hashes.
Starting from here and going through the rest of this course we're going to be seeing hashes over and
over again.