Diffie Helman comes in different forms.
Diffie Hellman one is 768 bits in length the film and two it's 1024 bits in length DIFI home and five
is 1536 bits in length.
Once again the longer the key length the more secure.
But the downside is more processing power would be required.
Now just to reiterate asymmetric key algorithms are used in VPN today not for bulking corruption of
data but they help with the establishment of a shared secret.
They're also used for other things like a syndication which I get to talk about in a moment symmetric
key algorithms such as Alias are used for Bolt encryption of data.
So we've covered confidentiality encryption.
Let's look at the second goal which is integrity.
We want to ensure that data has not been tampered with.
In other words we want to know that that data has traversed the internet or other network unchanged
between the two parties.
Data integrity uses algorithms known as hashing algorithms also known as Treptow or message digests
these a one way algorithms unlike encryption algorithms which can be reversed hashing algorithms convert
arbitrary data into a fixed length hash.
An example would be in the five or message digest algorithm 5 which has a fixed length of 128.
That's now to demonstrate hashing.
Notice I can take a piece of arbitrary information.
Let's say my name and I can hash it in this case using schaw Shaugh or secure hash algorithm is more
secure than M.D 5.
This is the hexadecimal very Forshaw and the binary value Forshaw.
Now it is if I change one value for instance making that David 1 and hash it again notice the entire
hash changes.
But notice it's of a fixed length.
I could put a bunch of people's names in there
and hash it again.
Notice the entire hash changes.
But he's of a fixed length.
I could go and copy some text from let's say USA Today.
Arbitrary length.
I could take the Encyclopedia Britannica put it through an empty five hash and come up with 128.
That's.
So for example I could take that USA Today article put it into an empty five hash generator and notice
it will come up with a 128 bit hash value.
Or I could replace that with let's just say my name and it'll come up with a 128 bit hash value ashing
is nonreversible because data is lost.
You cannot take 128 but M.D five hash reverse it and come up with the Encyclopedia Britannica.
But you can take the Encyclopedia Britannica hash it and come up with 128 but value.
Please note that the hash will change.
As I've demonstrated if any part of the input value changes so with hashing we can take data of arbitrary
length put it through an empty five or char hash.
In this case it's M.D five and come up with a fixed 128 but ash Valley you cannot take the 128 bit hash
value and reverse the process and come up with the original data.
It is a one way function or trapdoor function.
There are various hashing algorithms that can be used M.D 5 once again is 128.
That's M-B 5 is not recommended today.
In networking environments Shaw one is 160 Betson length shot to these 256 or Sabran 12 bits in length
and Shaugh 3 is scheduled for release in 2012.
Just be aware that there are various hashing algorithms once again shot to is what's recommended in
today's networking environments.
So as an example if Peter wanted to send data to sirra in sharing confidentiality and integrity the
following would happen.
Peter's private information that no one else except Sarah should read is encrypted firstly with an encryption
algorithm like a yes.
Now in this case we're assuming that a shared secret or shaid key has been derived.
So assuming that that's happened Peter can encrypt the data using a symmetric key algorithm like a s.
So the kid text information is encrypted into ciphertext.
This provides confidentiality Petah then takes being corrupted text will ciphertext and hashes it with
a hashing algorithm like Shawa M.D. 5 which comes up with a fixed length hash.
This will ensure data integrity.
Because if any part of the date is changed remember the hash will also change.
So Peter takes the clear text encrypted with an algorithm like s to come up with ciphertext he hashes
that encrypted text and comes up with a hash.
Even a pin is the hash to the encrypted ciphertext and sends it to Sarah.
Sarah upon receipt of the data in this case the encrypted ciphertext wants to make sure that the data
hasn't been tampered with before going through all the effort of decrypting the text.
So Sarah will take the encrypted text and hash it herself to come up with a M.D five Wilshaw hash.
She will then compare the hash that she derived with the hash appended to the encrypted data.
Only if the hashes are the same as she bother decrypting the text now if the hashes are the same.
It means that the data hasn't changed in transit.
If the hashes are the same Saraa can decrypt the data by reversing the ace encryption knowing that the
data hasn't been tampered with.
However that being said what stops Joe hacker receiving the data changing it so manipulating the data
before it reaches Cerra encrypting it with a yes hashing that fake data with let's say Shaw and appending
a new hash to the data and then transmitting it to Sarah.
Sarah has no way of knowing that the data has been manipulated because when she reverses the process
by hashing this new data the hash will be the same as Joe Hakas hash that he appended to the new data.
So to combat that what Pete needs to do is use something called hash message into question code or SCHMOCK
and there are two variants of this.
You have a schmuck M.D 5 and H Mac Shaw.
And what PD needs to do is take the data of arbitrary lengths.
In other words the data that he wants to send to Sarah Plus a secret key that only Sarah and he knows
and now hash those two values with the five or Shaw to get the hash that will combat Joe hacker from
manipulating the data.
Because Joe hacker won't know what the secret key is that Peter and Sirah are using in combination with
the hashing algorithm Joe hacker will not know what the secret key is.
So when he hashes the data Sarah will know that the data has been manipulated because of the hash that
she derives will not be the same hash seru will be taking the encrypted data.
In combination with the secret key and hashing those two together to come up with her hash Joe hacker
will not know what the secret key is.
So when Joe hacker hashes the data he's hash will not be the same as the new hash that Sarah derives
and she will therefore know that the data has been tampered with.
Only Peter and Sarah know what that secret key is not.
Joe hacker say he can not successfully manipulate the data and derive the same hash fairly.
Thus data integrity is provided with a smack in combination with M.D 5 and Shaw.
The third goal to accomplish is authentic cation.
Now authentication is knowing that data received is the same data that was sent and that the claim sender
is in fact the actual sender.
Now we've already spoken about integrity.
Now we are looking at a thing to Kading appear to make sure that there are actually who they say they
are.
This goes beyond validating the source attempting to access a service sharing initial logging.
You should also validate that the source has not been replaced by an attacking host.
In the course of the conversation which is known as session highjacking you want to make sure that the
person that you are talking to is the person that they say they are and that they haven't been replaced
by a hacker.
They are two types of authentication so we could have sent Akkad wrote a one to rodded to using either
appreciate key which is a secret key value entered into each peer manually and is used to indicate the
pier.
Or we could use RSA signatures which encrypt the hash with a private key.
So firstly appreciate key in this example.
Peter needs to be authenticated by Sarah.
In this case Peter it takes a Diffie Helman shape key that they derived the pre-shared key that was
agreed upon with Sarah which should have been done out of band and other information relating to OPSEC
and he hashes that with either M.D Feibel Shaw and he attaches the hash to a packet with his identification
information which may be the IP address or hostname that is used for the VPN.
Sarah can then hash a local copy of the information which includes the agreed upon pre-shared key and
derive and in the final shall Hesh she can then compay her locally derived hash with the hash that you
received from Peter.
If they the same she knows that Peter has the same pre-shared key as she does and she can any indicate
Peter if the hashes are different she knows Peter does not have the correct pre-shared key and therefore
the VPN is not set up.
The second option is to use digital signatures digital signatures have multiple advantages including
the automatic exchange of keys without the need of programming static authentication keys on multiple
devices.
This allows for scalability.
The key L'anse are also a lot greater appreciate keys should be changed on a regular basis.
And in reality that often doesn't happen.
Another advantage of digital signatures is non repudiation.
Which means you can not deny being involved in a conversation because you're the only person that has
your private key.
So the way it works is pita in this example takes a Diffie Hellman shaky and other information and hashes
it in a very similar way to pre-shared keys.
But notice the preset key is not in this list.
That hash is now signed with Peter's private key and remember that Peter is the only person that has
that private key that creates what's called a digital signature.
So a digital signature is created when information is encrypted with a private key.
Please remember that if something is encrypted with someone's private key only that person's public
key can decrypted peed in our sins.
That information to Sarah Sarah takes the received signature from Peter and decrypts it with Peter's
public key which he had previously received from Peter.
That will result in the original hash that Peter created.
Sarah Not takes the same information that she has locally and hashes it herself to derive her own hash
of the various parameters.
She then compares the two hashes.
If say the same she knows firstly that PETA has all the correct information.
She also knows that this information could only have come from PETA because only PETA's public key can
decrypt something encrypted with Peter's private key.
So the digital signature proves that the information came from Peter and that all of this information
is correct.
She has thus been able to think Akkad Peter.
Now the reverse will happen for both pre-shared keys and digital signatures.
Peter Will authentic syndicate Sarah.
So there's mutual two way into question either by using pre-shared keys or by using digital signatures.