1 00:00:00,150 --> 00:00:02,670 The Fidelman comes in different forms. 2 00:00:03,300 --> 00:00:06,689 Duffy Holman One is 768 bits in length. 3 00:00:07,200 --> 00:00:10,470 Duffy Holman two is 1024 bits in length. 4 00:00:10,920 --> 00:00:14,730 Duffy Holman five is 1536 bits in length. 5 00:00:15,180 --> 00:00:19,200 Once again, the longer the key length, the more secure. 6 00:00:19,770 --> 00:00:23,850 But the downside is more processing power would be required. 7 00:00:24,770 --> 00:00:32,450 Now, just to reiterate, asymmetric key algorithms are used in VPNs today, not for bulk encryption 8 00:00:32,450 --> 00:00:36,770 of data, but they help with the establishment of a shared secret. 9 00:00:37,340 --> 00:00:42,380 Are also used for other things like authentication, which I'm going to talk about in a moment. 10 00:00:42,890 --> 00:00:49,070 Symmetric key algorithms such as these are used for bulk encryption of data. 11 00:00:49,790 --> 00:00:52,550 So we've covered confidentiality or encryption. 12 00:00:52,760 --> 00:00:56,150 Let's look at the second goal, which is integrity. 13 00:00:56,510 --> 00:00:59,510 We want to ensure that data has not been tampered with. 14 00:00:59,870 --> 00:01:05,480 In other words, we want to know that the data has traversed the Internet or other network unchanged 15 00:01:05,480 --> 00:01:06,890 between the two parties. 16 00:01:07,580 --> 00:01:14,630 Data Integrity uses algorithms known as hashing algorithms, also known as trapdoor or message digests. 17 00:01:15,290 --> 00:01:20,420 These are one way algorithms, unlike encryption algorithms, which can be reversed. 18 00:01:21,360 --> 00:01:26,430 Hashing algorithms convert arbitrary data into a fixed length hash. 19 00:01:27,060 --> 00:01:35,430 An example would be MD5 or Message Digest Algorithm five, which has a fixed length of 128 bits. 20 00:01:36,870 --> 00:01:38,280 Now to demonstrate hedging. 21 00:01:38,880 --> 00:01:41,820 Notice I can take a piece of arbitrary information. 22 00:01:41,820 --> 00:01:42,900 Let's say my name. 23 00:01:43,580 --> 00:01:45,050 And I can hash it. 24 00:01:45,680 --> 00:01:47,540 In this case using Sha. 25 00:01:49,150 --> 00:01:51,500 Shore or secure. 26 00:01:51,520 --> 00:01:54,670 Hash algorithm is more secure than MD5. 27 00:01:55,180 --> 00:02:01,390 This is the hexadecimal value or sha and the binary value for sha. 28 00:02:02,210 --> 00:02:09,410 Notice if I change one value, for instance, making that David one and hash it again, notice the entire 29 00:02:09,410 --> 00:02:10,639 hash changes. 30 00:02:11,030 --> 00:02:13,010 But notice it's of a fixed length. 31 00:02:14,480 --> 00:02:17,300 I could put a bunch of people's names in there. 32 00:02:25,600 --> 00:02:26,770 And hash it again. 33 00:02:27,520 --> 00:02:30,970 Notice the entire hash changes but is of a fixed length. 34 00:02:31,830 --> 00:02:33,660 I could go and copy some text. 35 00:02:35,370 --> 00:02:37,260 From, let's say, USA Today. 36 00:02:41,720 --> 00:02:42,730 Arbitrary length. 37 00:02:46,020 --> 00:02:46,950 Pasted it in. 38 00:02:50,710 --> 00:02:50,890 Tree. 39 00:02:51,280 --> 00:02:53,830 I could take the Encyclopedia Britannica. 40 00:02:54,950 --> 00:02:58,910 Put it through an MD5 hash and come up with 128 bits. 41 00:03:01,150 --> 00:03:08,920 So for example, I could take that us today article, put it into an MD5 hash generator and notice it 42 00:03:08,920 --> 00:03:11,740 will come up with 128 bit hash value. 43 00:03:12,400 --> 00:03:16,330 Or I could replace that with let's just say my name. 44 00:03:18,380 --> 00:03:21,230 And will come up with 128 bit hash value. 45 00:03:22,990 --> 00:03:26,950 Hashing is not reversible because data is lost. 46 00:03:27,220 --> 00:03:35,010 You cannot take 128 bit MD5 hash, reverse it and come up with the Encyclopedia Britannica. 47 00:03:35,020 --> 00:03:41,020 But you can take the Encyclopedia Britannica, hash it and come up with 128 bit value. 48 00:03:41,710 --> 00:03:47,770 Please note that the hash will change, as I've demonstrated if any part of the input value changes. 49 00:03:48,550 --> 00:03:52,090 So with hashing we can take data of arbitrary length. 50 00:03:52,940 --> 00:03:55,430 Put it through an MD5 or sha hash. 51 00:03:55,730 --> 00:04:01,850 In this case it's md5 and come up with a fixed 128 bit hash value. 52 00:04:02,450 --> 00:04:09,380 You cannot take the 128 bit hash value and reverse the process and come up with the original data. 53 00:04:10,200 --> 00:04:14,400 It is a one way function or trapdoor function. 54 00:04:16,279 --> 00:04:18,769 There are various hashing algorithms that can be used. 55 00:04:18,769 --> 00:04:21,350 MD5 once again is 128 bits. 56 00:04:21,920 --> 00:04:25,790 MD5 is not recommended today in networking environments. 57 00:04:26,480 --> 00:04:28,790 SHA one is 160 bits and length. 58 00:04:28,970 --> 00:04:32,450 SHA two is 256 or 512 bits in length. 59 00:04:33,050 --> 00:04:36,890 And SHA three is scheduled for release in 2012. 60 00:04:37,340 --> 00:04:40,880 Just be aware that there are various hashing algorithms once again. 61 00:04:41,030 --> 00:04:44,870 SHA two is what's recommended in today's networking environments. 62 00:04:46,220 --> 00:04:56,090 So as an example, if Peter wanted to send data to Sarah ensuring confidentiality and integrity, the 63 00:04:56,090 --> 00:04:57,320 following would happen. 64 00:04:58,910 --> 00:05:06,380 Is private information that no one else except Sarah should read is encrypted, firstly, with an encryption 65 00:05:06,380 --> 00:05:08,120 algorithm like these. 66 00:05:08,630 --> 00:05:14,000 Now, in this case, we're assuming that a shared secret or shared key has been derived. 67 00:05:14,270 --> 00:05:21,260 So assuming that that's happened, Peter can encrypt the data using a symmetric key algorithm like Amy's. 68 00:05:21,680 --> 00:05:25,910 So the clear text information is encrypted into ciphertext. 69 00:05:26,150 --> 00:05:28,400 This provides confidentiality. 70 00:05:29,540 --> 00:05:38,840 Peter then takes the encrypted text or ciphertext and hashes it with a hashing algorithm like SHA or 71 00:05:38,840 --> 00:05:43,370 MD5, which comes up with a fixed length hash. 72 00:05:44,200 --> 00:05:51,880 This will ensure data integrity because if any part of the data is changed, remember the hash will 73 00:05:51,880 --> 00:05:52,930 also change. 74 00:05:54,240 --> 00:06:01,500 So Peter takes the clear text encrypted with an algorithm like ease to come up with ciphertext. 75 00:06:02,010 --> 00:06:06,180 He hashes that encrypted text and comes up with a hash. 76 00:06:06,870 --> 00:06:14,670 He then append the hash to the encrypted ciphertext and sends it to Sarah. 77 00:06:15,630 --> 00:06:22,050 Sarah upon receipt of the data in this case, the encrypted ciphertext wants to make sure that the data 78 00:06:22,050 --> 00:06:27,480 hasn't been tampered with before, going through all the effort of decrypting the text. 79 00:06:27,780 --> 00:06:35,640 So Sarah will take the encrypted text and hash it herself to come up with a MD5 or sha hash. 80 00:06:36,940 --> 00:06:46,240 She will then compare the hash that she derived with the hash appended to the encrypted data only if 81 00:06:46,240 --> 00:06:48,220 the hashes are the same. 82 00:06:49,110 --> 00:06:52,740 Does she bother decrypting the text now? 83 00:06:52,740 --> 00:06:57,180 If the hashes are the same, it means that the data hasn't changed in transit. 84 00:06:57,930 --> 00:07:05,490 If the hashes are the same, Sara can decrypt the data by reversing the A's encryption, knowing that 85 00:07:05,490 --> 00:07:07,680 the data hasn't been tampered with. 86 00:07:08,520 --> 00:07:10,140 However, that being said. 87 00:07:11,110 --> 00:07:15,760 What stops Joe Hacker receiving the data? 88 00:07:15,790 --> 00:07:16,960 Changing it. 89 00:07:16,960 --> 00:07:20,170 So manipulating the data before it reaches error. 90 00:07:20,980 --> 00:07:22,690 Encrypting it with ease. 91 00:07:22,720 --> 00:07:31,510 Hashing that fake data with, let's say SHA and appending a new hash to the data and then transmitting 92 00:07:31,510 --> 00:07:32,650 it to Sara. 93 00:07:33,790 --> 00:07:40,450 Sarah has no way of knowing that the data has been manipulated because when she reverses the process 94 00:07:40,450 --> 00:07:47,650 by hashing this new data, her hash will be the same as Joe Hacker's hash that he appended to the new 95 00:07:47,650 --> 00:07:48,250 data. 96 00:07:48,760 --> 00:07:56,290 So to combat that, what Peter needs to do is use something called hash message authentication code 97 00:07:56,290 --> 00:07:57,460 or Mac. 98 00:07:57,730 --> 00:07:59,200 And there are two variants of this. 99 00:07:59,200 --> 00:08:03,370 You have Mac MD5 and Mac Sha. 100 00:08:03,730 --> 00:08:08,080 And what Peter needs to do is take the data of arbitrary lengths. 101 00:08:08,080 --> 00:08:10,360 So in other words, the data that he wants to send to Sarah. 102 00:08:11,440 --> 00:08:15,910 Plus a secret key that only Sarah and he knows. 103 00:08:16,420 --> 00:08:22,450 And now hash those two values with MD5 or SHA to get the hash. 104 00:08:23,600 --> 00:08:32,120 That will combat Joe Hacker from manipulating the data because Joe Hacker won't know what the secret 105 00:08:32,120 --> 00:08:38,870 key is that Peter and Sarah are using in combination with the hashing algorithm. 106 00:08:40,230 --> 00:08:43,320 Joe Hacker will not know what the secret key is. 107 00:08:43,740 --> 00:08:45,840 So when he hashes the data. 108 00:08:46,550 --> 00:08:53,090 Sarah will know that the data has been manipulated because the hash that she derives will not be the 109 00:08:53,090 --> 00:08:54,140 same hash. 110 00:08:55,040 --> 00:08:57,620 Sarah will be taking the encrypted data. 111 00:08:58,420 --> 00:09:04,840 In combination with the secret key and hashing those two together to come up with her hash. 112 00:09:05,500 --> 00:09:08,500 Joe Hacker will not know what the secret key is. 113 00:09:08,620 --> 00:09:17,470 So when Joe Hacker hashes the data, he's hash will not be the same as the new hash that Sarah derives. 114 00:09:17,890 --> 00:09:21,460 And she will therefore know that the data has been tampered with. 115 00:09:22,220 --> 00:09:30,470 Only Peter and Sarah know what that secret key is, not Joe Hacker, so he cannot successfully manipulate 116 00:09:30,470 --> 00:09:33,320 the data and derive the same hash value. 117 00:09:33,980 --> 00:09:40,130 Thus, data integrity is provided with HMC in combination with MD5 and SHA. 118 00:09:40,980 --> 00:09:43,650 The third goal to accomplish is authentication. 119 00:09:44,470 --> 00:09:51,490 Now authentication is knowing that data received is the same data that was sent and that the claim sender 120 00:09:51,490 --> 00:09:53,530 is in fact the actual sender. 121 00:09:54,250 --> 00:09:56,200 Now, we've already spoken about integrity. 122 00:09:56,380 --> 00:10:02,410 Now we're looking at authenticating a peer to make sure that they are actually who they say they are. 123 00:10:03,320 --> 00:10:08,300 This goes beyond validating the source attempting to access a service during initial login. 124 00:10:08,810 --> 00:10:14,330 You should also validate that the source has not been replaced by an attacking host in the course of 125 00:10:14,330 --> 00:10:17,570 the conversation, which is known as session hijacking. 126 00:10:17,990 --> 00:10:23,510 You want to make sure that the person that you're talking to is the person that they say they are and 127 00:10:23,510 --> 00:10:26,030 that they haven't been replaced by a hacker. 128 00:10:26,760 --> 00:10:28,770 They are two types of authentication. 129 00:10:29,130 --> 00:10:36,060 So we could authenticate rather one to write a two using either a preset key, which is a secret key 130 00:10:36,060 --> 00:10:40,800 value entered into each pair manually and is used to authenticate the pair. 131 00:10:41,340 --> 00:10:46,830 Or we could use RSA signatures which encrypt the hash with a private key. 132 00:10:47,520 --> 00:10:49,320 So firstly, appreciate key. 133 00:10:49,800 --> 00:10:53,460 In this example, Peter needs to be authenticated by Sarah. 134 00:10:54,620 --> 00:10:59,270 In this case, PITA takes the Doofy helm and shade key that they derived. 135 00:11:00,300 --> 00:11:07,140 The pre sched key that was agreed upon with Sarah, which should have been done out of band and other 136 00:11:07,140 --> 00:11:09,240 information relating to IP sick. 137 00:11:09,330 --> 00:11:17,790 And he hashes that with either MD5 or SHA and he attaches the hash to a packet with his ID information, 138 00:11:17,910 --> 00:11:22,740 which may be the IP address or hostname that is used for the VPN. 139 00:11:23,400 --> 00:11:32,100 Sarah can then hash her local copy of the information, which includes the agreed upon preset key and 140 00:11:32,100 --> 00:11:34,800 derive an MD5 or SHA hash. 141 00:11:35,940 --> 00:11:43,230 She can then compare her locally derived hash with the hash that she received from PETA. 142 00:11:44,680 --> 00:11:46,060 If they the same. 143 00:11:46,060 --> 00:11:52,450 She knows that Peter has the same pre shaved key as she does and she can thus authenticate Peter. 144 00:11:52,870 --> 00:11:58,870 If the hashes are different, she knows Peter does not have the correct preset key and therefore the 145 00:11:58,870 --> 00:12:00,310 VPN is not set up. 146 00:12:01,160 --> 00:12:03,560 The second option is to use digital signatures. 147 00:12:04,010 --> 00:12:11,270 Digital signatures have multiple advantages, including the automatic exchange of keys without the need 148 00:12:11,270 --> 00:12:16,130 of programming static authentication keys on multiple devices. 149 00:12:16,550 --> 00:12:18,350 This allows for scalability. 150 00:12:19,530 --> 00:12:21,630 The key lengths are also a lot greater. 151 00:12:22,140 --> 00:12:27,450 Pre shared keys should be changed on a regular basis, and in reality that often doesn't happen. 152 00:12:28,360 --> 00:12:35,380 Another advantage of digital signatures is non repudiation, which means you cannot deny being involved 153 00:12:35,380 --> 00:12:40,990 in a conversation because you're the only person that has your private key. 154 00:12:41,780 --> 00:12:50,000 So the way it works is PETA in this example takes the diffi hellman shade key and other information 155 00:12:50,000 --> 00:12:54,260 and hashes it in a very similar way to appreciate keys. 156 00:12:54,260 --> 00:12:56,840 But notice the pre shade key is not in this list. 157 00:12:57,590 --> 00:13:03,140 That hash is now signed with Peter's private key. 158 00:13:03,740 --> 00:13:07,700 And remember that Peter is the only person that has that private key. 159 00:13:08,460 --> 00:13:11,100 That creates what's called a digital signature. 160 00:13:11,460 --> 00:13:17,910 So a digital signature is created when information is encrypted with a private key. 161 00:13:18,450 --> 00:13:24,480 Please remember that if something is encrypted with someone's private key, only that person's public 162 00:13:24,480 --> 00:13:26,100 key can decrypt it. 163 00:13:27,040 --> 00:13:29,740 Peter now sends that information to Sarah. 164 00:13:31,180 --> 00:13:38,230 Sarah takes the received signature from Peter and decrypts it with Peter's public key, which she had 165 00:13:38,230 --> 00:13:44,500 previously received from Peter that will result in the original hash that Peter created. 166 00:13:45,100 --> 00:13:53,560 Sarah now takes the same information that she has locally and hashes it herself to derive her own hash 167 00:13:53,770 --> 00:13:55,390 of the various parameters. 168 00:13:56,020 --> 00:14:00,040 She then compares the two hashes if they the same. 169 00:14:00,040 --> 00:14:03,640 She knows firstly that Peter has all the correct information. 170 00:14:04,120 --> 00:14:12,130 She also knows that this information could only have come from Peter because only Peter's public key 171 00:14:12,520 --> 00:14:16,360 can decrypt something encrypted with Peter's private key. 172 00:14:16,960 --> 00:14:23,290 So the digital signature proves that the information came from Peter and that all of this information 173 00:14:23,290 --> 00:14:24,190 is correct. 174 00:14:25,010 --> 00:14:27,410 She has thus been able to authenticate Peter. 175 00:14:28,600 --> 00:14:32,860 Now the reverse will happen for both preset keys and digital signatures. 176 00:14:32,890 --> 00:14:34,180 Peter will authenticate. 177 00:14:34,180 --> 00:14:42,010 Sarah So there's mutual two way authentication either by using preset keys or by using digital signatures.