OK so I'm not going to talk about cryptographic hash and hashing and stuff like that.
This is just an introduction to the idea of a crypto graphic hash function.
OK.
Now what is a cryptographic hash function used for.
Well same thing we've been talking about and so I want to show a couple things about the message one
is we can authenticate a message.
That means we know who sent it.
So we know if you sent it because we can use this to do it we could also look check the integrity of
the message.
We can check the integrity of the message.
OK authentication integrity.
And we can do it.
We can look for a digital signature as well.
Signature a digital signature as well.
What is a hash function.
First of all you take off and you put in message and you get out.
You know why whatever you want to call it so f of x f of M gives you Y.
So in other words if I take this message 3 to 1 1 to 5 and I throw it through my hash function it should
give me a message.
Now this message that we're getting should be so so so confused I guess.
Well it confused and diffused really that it's completely unclear how to get backwards.
In other words 3 two 1 to 5 becomes like a B seven question mark exclamation points are a seven B.
Who knew how this turns into this.
Well if you do the hash function well it says you replace this with this you do this and that it doesn't
matter exactly what you do for the last function.
But it should give you a measure of fixed length which is very easy to go one way but very hard to go
the other way.
So we'll know that this is very easy to go this way but very hard to go back.
In other words it should be that we can't go back.
Now that's point number one.
It should be very easy to go one way.
Hard to go the other way.
In other words it can do it too.
It should be that it's fixed length OK.
We said that but it should also be that when you do this message if I did a different message no matter
how close or how far away the other messages.
None of them should ever have a collision.
And give us this as the output.
None of them should ever give us this is up in other words each one each message should have a unique
output.
Each masters have every unique output.
So now let's talk about what that means and how that would work.
OK.
It doesn't matter what the function is.
You know you could do all kinds of crazy stuff with the function you do maade something and you add
something to do this and that the next thing it doesn't matter.
But what's going to be the output needs to be that it's unique that it's impossible to undo.
OK.
Now let's take a message and let's take hash of message and what happens if I send it to you.
So if I send you message and has a message and maybe somebody came along and changed message.
Well guess what.
This is no longer going to be hash of message anymore.
In other words if evil Eve intercepted message and now she changed message that instead of sending you
money I send the money to Eve.
How do you know that that's the wrong message.
Well because if you took my message you receive the hash as well you receive message you receive X but
you also receive hash.
But if you take message yourself and you try and get out whatever the hash is that it's supposed to
be guess what it is incorrect.
In other words you received the wrong message you received x.
It doesn't lead to what should be the original what should be the hash that you receive.
So therefore you know that I didn't send it.
I can say well maybe she'll send me X and then a special messed up hash.
Well she also has to know what hash function we're using and if she doesn't then she can't create this
right and she can't back it.
She can't figure it out and change it in the hash because it's a one way thing.
So that would you know that would be a way to authenticates.