1 00:00:00,000 --> 00:00:06,300 So here we are. David and I are here to talk to you about MS-CHAP V2, Microsoft CHAP V2. 2 00:00:07,360 --> 00:00:16,680 You know, Microsoft, the designer of such illustrious protocols as NetBIOS and CIFS, did not stop there. 3 00:00:16,780 --> 00:00:21,680 They also gave us an authentication protocol, and it has two major functions. 4 00:00:21,880 --> 00:00:26,440 The first is to provide mutual authentication, and the second is to provide key agreement. 5 00:00:27,820 --> 00:00:34,840 So what that means is that a client can authenticate itself to a server as, you know, a client logging into something, 6 00:00:35,520 --> 00:00:39,600 but that simultaneously the server authenticates itself to the client. 7 00:00:39,760 --> 00:00:44,900 So the client knows that the server is really who they're trying to connect to so that no man-in-the-middle attack is possible. 8 00:00:45,820 --> 00:00:53,400 And then key agreement provides, you know, key material so that you can set up an encrypted session moving forward after the handshake is complete. 9 00:00:55,780 --> 00:00:56,260 Now, 10 00:00:58,480 --> 00:01:00,640 this is sort of an archaic protocol. 11 00:01:00,920 --> 00:01:08,280 It was actually published in 1999, but really that was just an update to the older MS-CHAP V1, which was designed even before that. 12 00:01:08,580 --> 00:01:12,440 So this has been around for a while, and it's aging. 13 00:01:12,840 --> 00:01:14,840 But it's also strangely pervasive. 14 00:01:15,080 --> 00:01:24,620 You see it in a lot of places, particularly with PPTP VPNs and WPA2 enterprise connections for the inter-authentication for WPA2 enterprise. 15 00:01:24,620 --> 00:01:31,540 And so, you know, we want to look at this protocol so that we can attack these two points. 16 00:01:32,820 --> 00:01:35,640 So the first question is, like, shouldn't we all know better, you know? 17 00:01:36,460 --> 00:01:38,040 Shouldn't we all know that this isn't secure? 18 00:01:38,400 --> 00:01:40,880 MS-CHAP V2, PPTP, these kind of things. 19 00:01:41,580 --> 00:01:43,580 The Internet is full of articles like this, right? 20 00:01:43,680 --> 00:01:47,980 You know, PPTP authentication proven to be very susceptible to attack. 21 00:01:50,520 --> 00:01:53,700 The problem is that all these articles are about dictionary attacks, right? 22 00:01:53,740 --> 00:01:54,460 The idea is that... 23 00:01:54,620 --> 00:02:01,760 If you get a packet capture for a PPTP VPN connection or a WPA2 wireless inter-authentication capture, 24 00:02:02,320 --> 00:02:06,280 and you combine it with a tool like Asleep, you've got yourself an offline dictionary attack. 25 00:02:06,580 --> 00:02:08,860 And you can try and guess the user's password. 26 00:02:09,360 --> 00:02:15,160 And if you're successful, then you have access to their encrypted traffic as well as their login credentials. 27 00:02:16,880 --> 00:02:21,840 There's even a paper that was actually published by Bruce Schneier and Modge way back in 1999, 28 00:02:22,560 --> 00:02:23,820 where they look at this protocol. 29 00:02:24,840 --> 00:02:30,740 And the conclusion of the paper is basically, you know, we looked at this, 30 00:02:30,840 --> 00:02:33,940 and they fixed most of the problems that we found with MS-CHAP V1. 31 00:02:34,860 --> 00:02:39,740 But the real problem here is that the security of the protocol is based on the user's password. 32 00:02:40,120 --> 00:02:42,100 And we know that users don't choose good passwords, 33 00:02:42,220 --> 00:02:46,240 so, you know, this protocol could be susceptible to that kind of attack. 34 00:02:48,000 --> 00:02:50,280 And so the Internet is actually full of questions like these, 35 00:02:50,340 --> 00:02:53,640 where, you know, people say, well, how secure is PPTP really? 36 00:02:53,880 --> 00:02:54,600 You know, is it... 37 00:02:54,620 --> 00:02:58,040 Is it just a matter of choosing a bad password? 38 00:02:58,240 --> 00:03:01,080 If I were to choose a good passphrase, is the protocol otherwise secure? 39 00:03:02,000 --> 00:03:06,480 And, you know, usually there's a response like this one that says, yeah, that's the deal. 40 00:03:06,680 --> 00:03:10,780 That, you know, it's a secure protocol if you can manage to choose a secure passphrase. 41 00:03:11,840 --> 00:03:15,600 And so, you know, I actually think that that's a reasonable conclusion, 42 00:03:15,760 --> 00:03:18,820 you know, given the information that is available. 43 00:03:19,180 --> 00:03:22,900 I have a friend who runs a kind of a high-profile VPN service, 44 00:03:23,300 --> 00:03:24,480 and he supports... 45 00:03:24,620 --> 00:03:25,660 He supported PPTP. 46 00:03:26,660 --> 00:03:29,540 And I asked him, so, you know, why did you support PPTP? 47 00:03:29,720 --> 00:03:32,580 And he said, well, you know, we looked at the Brucheneyer analysis, 48 00:03:33,080 --> 00:03:36,280 and we concluded that if users, you know, 49 00:03:36,280 --> 00:03:38,120 that it was just the problem with the passwords. 50 00:03:38,380 --> 00:03:40,940 And so we didn't let our users choose passwords. 51 00:03:41,060 --> 00:03:45,360 We had a mechanism where we would generate random strings that were the passwords, 52 00:03:45,480 --> 00:03:46,640 and we felt that we were secure that way. 53 00:03:47,340 --> 00:03:49,120 And, you know, I think that that's a reasonable conclusion, 54 00:03:49,180 --> 00:03:50,900 given the information that's available. 55 00:03:51,100 --> 00:03:52,240 A lot of other people agree. 56 00:03:52,540 --> 00:03:54,240 I put together a list of... 57 00:03:54,620 --> 00:04:00,480 VPN providers that currently support PPTP and MSChad v2. 58 00:04:06,240 --> 00:04:07,580 There's actually more than this. 59 00:04:07,620 --> 00:04:08,820 I just got tired of typing them in. 60 00:04:11,200 --> 00:04:12,460 So it's a lot of people. 61 00:04:12,680 --> 00:04:15,480 There's even some really high-profile VPN providers, 62 00:04:15,560 --> 00:04:17,060 like iPredator. 63 00:04:17,220 --> 00:04:19,180 This is the Pirate Bay's VPN provider. 64 00:04:19,640 --> 00:04:23,800 And they only support PPTP for their authentication 65 00:04:23,800 --> 00:04:24,600 and authentication. 66 00:04:24,620 --> 00:04:29,060 And, you know, presumably, they're trying to protect their traffic 67 00:04:29,060 --> 00:04:31,800 from government-level observation, right? 68 00:04:32,940 --> 00:04:35,580 You also see it, you know, in WPA2 enterprise setups. 69 00:04:35,760 --> 00:04:36,480 It's very common. 70 00:04:36,700 --> 00:04:38,720 For instance, the DEF CON wireless network 71 00:04:39,320 --> 00:04:42,180 is using MSChad v2 as its inter-authentication credentials. 72 00:04:43,260 --> 00:04:44,260 So, you know, what's the deal? 73 00:04:44,340 --> 00:04:45,680 Why is this so popular? 74 00:04:45,840 --> 00:04:47,560 Well, I feel like there's this cycle, right, 75 00:04:47,600 --> 00:04:49,560 where it's really widely supported. 76 00:04:50,220 --> 00:04:51,740 It's built into Windows XP. 77 00:04:52,820 --> 00:04:54,600 It's the only, like, VPN provider. 78 00:04:54,600 --> 00:04:55,480 It's the only VPN authentication method 79 00:04:55,480 --> 00:04:58,080 supported in Ubuntu, by default, out of the box. 80 00:04:58,440 --> 00:04:59,740 And so it's what people use. 81 00:04:59,900 --> 00:05:00,960 You know, it's really widely supported, 82 00:05:01,080 --> 00:05:02,420 and so everybody starts using it. 83 00:05:02,720 --> 00:05:04,480 And since it's the thing that everybody is using, 84 00:05:04,640 --> 00:05:05,780 when people develop new products, 85 00:05:06,000 --> 00:05:06,840 that's what they support. 86 00:05:07,860 --> 00:05:10,440 And since it's what's really supported everywhere, 87 00:05:10,620 --> 00:05:11,680 that's what people end up using. 88 00:05:12,160 --> 00:05:13,920 And since that's what everyone's using, 89 00:05:14,100 --> 00:05:16,900 that's what people support when they develop new products. 90 00:05:17,120 --> 00:05:19,260 It's this really, like, maddening cycle 91 00:05:20,160 --> 00:05:21,880 that's just impossible to escape from. 92 00:05:22,760 --> 00:05:24,580 Just because it's reasonable, 93 00:05:24,600 --> 00:05:27,380 I think, to presume that, you know, 94 00:05:27,380 --> 00:05:28,540 this is an otherwise secure protocol 95 00:05:28,540 --> 00:05:30,320 doesn't mean that it's correct. 96 00:05:34,620 --> 00:05:36,960 So let's take a second and look at the internals 97 00:05:36,960 --> 00:05:38,080 of how this works. 98 00:05:38,740 --> 00:05:39,420 MSChat v2. 99 00:05:39,820 --> 00:05:44,860 So this is the MSChat v2 handshake. 100 00:05:45,980 --> 00:05:48,000 You know, you look at it, and it's just, like, 101 00:05:48,940 --> 00:05:50,360 you feel like they're almost trying to, like, 102 00:05:50,360 --> 00:05:51,540 dazzle you into submission. 103 00:05:51,800 --> 00:05:54,000 You know, like, it's, you know, like, 104 00:05:54,780 --> 00:05:55,860 you know, we'll just, 105 00:05:55,980 --> 00:05:57,620 it's like the digital version of hand-waving. 106 00:05:57,800 --> 00:06:00,080 You know, like, if we just hash it again, 107 00:06:00,260 --> 00:06:01,660 then, you know... 108 00:06:05,600 --> 00:06:06,520 You know, like, 109 00:06:07,340 --> 00:06:09,520 cryptanalysts will look at this and just, you know, 110 00:06:10,540 --> 00:06:12,540 wither, you know, in the... 111 00:06:13,580 --> 00:06:15,300 So let's run through it real fast. 112 00:06:15,640 --> 00:06:16,240 All right. 113 00:06:16,720 --> 00:06:17,520 Client sends hello. 114 00:06:17,760 --> 00:06:18,680 Server sends spike. 115 00:06:18,800 --> 00:06:20,740 Sends back a 16-byte random challenge. 116 00:06:21,100 --> 00:06:23,360 The client generates its own 16-byte random challenge. 117 00:06:23,740 --> 00:06:24,180 Calculates. 118 00:06:24,600 --> 00:06:26,340 Number one of the service challenge, 119 00:06:26,520 --> 00:06:28,140 the client's challenge, and the user name. 120 00:06:28,940 --> 00:06:31,120 Calculates the anti-hash of the user's password. 121 00:06:31,740 --> 00:06:34,040 And then calculates this thing, the challenge response, 122 00:06:34,400 --> 00:06:37,460 by encrypting the challenge hash three different times 123 00:06:37,460 --> 00:06:38,920 with three different DES keys, 124 00:06:39,200 --> 00:06:41,940 which are different sections of the anti-hash 125 00:06:41,940 --> 00:06:42,600 of the user's password. 126 00:06:43,020 --> 00:06:45,300 Sends back the 24-byte challenge response, 127 00:06:45,580 --> 00:06:47,580 the 16-byte challenge hash, and the user name, 128 00:06:47,600 --> 00:06:49,460 user name in the clear, to the server, 129 00:06:50,080 --> 00:06:54,580 who then calculates the MD4 of the MD4 of the user's name. 130 00:06:54,600 --> 00:06:55,300 Get that? 131 00:06:55,340 --> 00:06:56,260 The password, hash, hash. 132 00:06:58,260 --> 00:07:01,580 And then calculates SHA-1 of the anti-hash hash, 133 00:07:02,060 --> 00:07:04,160 the challenge response, and the literal string, 134 00:07:04,500 --> 00:07:07,140 magic server to client signing constant. 135 00:07:09,960 --> 00:07:12,900 Then calculates another SHA-1 hash of the previous digest, 136 00:07:13,260 --> 00:07:15,000 the challenge hash, and the literal string, 137 00:07:15,240 --> 00:07:17,540 pad to make it do more than one iteration. 138 00:07:19,620 --> 00:07:21,320 And then sends that back to the client. 139 00:07:22,760 --> 00:07:24,580 You get the feeling that maybe the design 140 00:07:24,600 --> 00:07:26,580 designers didn't know that this was going to be public one day. 141 00:07:28,960 --> 00:07:32,120 So what's interesting is that if you really look at this, 142 00:07:32,180 --> 00:07:34,040 you get through all the dazzle, 143 00:07:34,160 --> 00:07:36,880 you realize that there's actually only one unknown 144 00:07:36,880 --> 00:07:38,860 in this entire protocol, 145 00:07:39,120 --> 00:07:41,960 which is the MD4 hash of the user's password. 146 00:07:42,240 --> 00:07:44,620 The anti-hash is the only unknown thing here. 147 00:07:44,960 --> 00:07:47,540 Everything else, and that one unknown 148 00:07:47,540 --> 00:07:50,200 is used as the three DES keys 149 00:07:50,200 --> 00:07:53,500 for the encryption of the challenge hash. 150 00:07:53,680 --> 00:07:54,540 So the one unknown. 151 00:07:54,540 --> 00:07:55,560 The one unknown is used in the DES keys 152 00:07:55,560 --> 00:07:56,540 that used to encrypt that thing. 153 00:07:56,780 --> 00:08:00,220 Everything else is either sent in the clear 154 00:08:00,220 --> 00:08:03,300 or can be derived from something sent in the clear, 155 00:08:03,780 --> 00:08:05,620 which means that we can sort of just rip off 156 00:08:05,620 --> 00:08:07,780 all this other stuff and only focus 157 00:08:07,780 --> 00:08:09,940 on this one core problem here, 158 00:08:09,980 --> 00:08:11,660 this one unknown that we're dealing with, right? 159 00:08:12,340 --> 00:08:14,620 And so this is where people usually 160 00:08:14,620 --> 00:08:16,980 plug in their dictionary attack, right? 161 00:08:17,060 --> 00:08:19,460 That they do a packet capture, 162 00:08:19,620 --> 00:08:21,960 and then they just start doing MD4 hashes 163 00:08:21,960 --> 00:08:23,660 of random words, and then using that 164 00:08:23,660 --> 00:08:26,800 as the three DES keys of the known plain text 165 00:08:27,200 --> 00:08:29,320 and seeing if it matches the known ciphertext. 166 00:08:29,640 --> 00:08:30,500 And if you get a match, 167 00:08:30,540 --> 00:08:32,120 then you've found the user's password, right? 168 00:08:33,240 --> 00:08:36,040 But, you know, I don't think we should be satisfied with that. 169 00:08:36,180 --> 00:08:36,440 Right? 170 00:08:36,460 --> 00:08:38,380 You know, we want 100% success. 171 00:08:38,700 --> 00:08:41,360 We don't want to just try and guess a user's password 172 00:08:41,360 --> 00:08:44,280 because, you know, as in the case of the VPN provider 173 00:08:44,280 --> 00:08:47,200 that choose random passwords on behalf of the user, 174 00:08:47,340 --> 00:08:48,680 you know, that would not be feasible. 175 00:08:51,680 --> 00:08:53,640 So let's look at these DES encryptions here, right? 176 00:08:53,660 --> 00:08:55,620 This is really all that's stopping us. 177 00:08:56,320 --> 00:08:57,260 Now, as a refresher, 178 00:08:57,460 --> 00:08:59,600 a DES key is normally 8 bytes long. 179 00:09:00,640 --> 00:09:02,580 So that's 64 bits of key material. 180 00:09:02,840 --> 00:09:04,420 And it should give you a total key space 181 00:09:04,420 --> 00:09:05,680 of 2 to the 64. 182 00:09:06,060 --> 00:09:08,160 You know, that's a really big number, 183 00:09:08,220 --> 00:09:09,420 a lot of keys, right? 184 00:09:10,040 --> 00:09:10,940 Somewhere along the way, 185 00:09:11,080 --> 00:09:12,720 someone made the dubious decision 186 00:09:12,720 --> 00:09:15,260 to turn every 8th bit of a DES key 187 00:09:15,260 --> 00:09:16,200 into a parity bit, 188 00:09:16,320 --> 00:09:18,420 which means that they're not actually used 189 00:09:18,420 --> 00:09:19,820 as part of the key material. 190 00:09:20,460 --> 00:09:22,180 Which means that a DES key 191 00:09:22,180 --> 00:09:23,640 is actually 7 bytes long. 192 00:09:23,660 --> 00:09:27,300 That only gives you 56 bits of key material 193 00:09:27,300 --> 00:09:29,960 for a total key space of 2 to the 56th, 194 00:09:30,020 --> 00:09:31,940 which is substantially smaller. 195 00:09:34,240 --> 00:09:36,420 So, you know, when we look at our core problem here, 196 00:09:36,480 --> 00:09:37,720 we have these three DES encryptions. 197 00:09:38,120 --> 00:09:39,420 So that's triple DES, right? 198 00:09:40,700 --> 00:09:42,060 The way that triple DES works 199 00:09:44,320 --> 00:09:45,640 is, you know, triple DES, 200 00:09:45,880 --> 00:09:47,180 you know, back when people were starting 201 00:09:47,180 --> 00:09:48,740 to lose confidence in DES, 202 00:09:48,880 --> 00:09:49,980 they would use triple DES 203 00:09:49,980 --> 00:09:51,660 in order to secure their communication. 204 00:09:52,160 --> 00:09:53,540 The way that works is you have this 205 00:09:53,540 --> 00:09:54,240 nested construction 206 00:09:54,240 --> 00:09:55,380 where you start in the middle 207 00:09:55,380 --> 00:09:57,300 and you encrypt the, 208 00:09:57,400 --> 00:09:59,360 you DES encrypt the plain text 209 00:09:59,360 --> 00:10:00,500 with one key, 210 00:10:01,040 --> 00:10:02,940 and then you use the output of that, 211 00:10:03,000 --> 00:10:04,580 the ciphertext from the middle encryption, 212 00:10:05,460 --> 00:10:06,760 as part of a DES operation 213 00:10:06,760 --> 00:10:08,080 with a second key, 214 00:10:08,220 --> 00:10:09,360 and you use the output of that 215 00:10:09,360 --> 00:10:11,000 as part of a third DES operation 216 00:10:11,000 --> 00:10:12,000 with a third key. 217 00:10:12,720 --> 00:10:13,620 So when you do that, 218 00:10:13,660 --> 00:10:15,760 you get this multiplicative complexity, right? 219 00:10:16,180 --> 00:10:18,700 Where your key space jumps from 2 to the 56th 220 00:10:18,700 --> 00:10:21,160 to 2 to the 56th times 2 to the 56th 221 00:10:21,160 --> 00:10:22,700 times 2 to the 56th 222 00:10:22,700 --> 00:10:23,520 times 2 to the 56th 223 00:10:23,520 --> 00:10:26,600 for a total key space of 2 to the 168th, 224 00:10:26,760 --> 00:10:27,980 which is enormous, right? 225 00:10:28,100 --> 00:10:30,420 And in practice, there were some attacks 226 00:10:30,420 --> 00:10:33,500 that you could do to reduce that to 2 to the 112th, 227 00:10:33,560 --> 00:10:35,860 but that's still quite big 228 00:10:35,860 --> 00:10:37,680 and certainly sufficient. 229 00:10:40,160 --> 00:10:41,820 So when we go back 230 00:10:41,820 --> 00:10:43,060 and we look at our core problem, though, 231 00:10:43,540 --> 00:10:44,900 there's no nesting here. 232 00:10:45,000 --> 00:10:46,260 This isn't a nested construction. 233 00:10:46,760 --> 00:10:47,820 You know, one DES operation 234 00:10:47,820 --> 00:10:49,980 has no effect on any other DES operation. 235 00:10:50,340 --> 00:10:52,320 They're actually totally independent of each other. 236 00:10:53,520 --> 00:10:55,460 You know, it's just encrypting the same plaintext 237 00:10:55,460 --> 00:10:57,020 three different times with three different keys. 238 00:10:57,540 --> 00:10:59,360 So that is not triple DES. 239 00:10:59,520 --> 00:11:02,240 That actually gives you an additive complexity, right? 240 00:11:02,420 --> 00:11:04,980 Where your key space is 2 to the 56th 241 00:11:04,980 --> 00:11:06,600 plus 2 to the 56th 242 00:11:06,600 --> 00:11:08,060 plus 2 to the 56th, 243 00:11:08,060 --> 00:11:10,680 which is 2 to the 57th.59. 244 00:11:12,320 --> 00:11:14,080 So that's basically the number 245 00:11:14,080 --> 00:11:14,880 that we're dealing with here. 246 00:11:15,000 --> 00:11:16,440 And that's still kind of a big number. 247 00:11:18,840 --> 00:11:21,000 Now, really, we're doing these three DES operations, 248 00:11:21,260 --> 00:11:22,680 and so we need three DES keys. 249 00:11:22,680 --> 00:11:24,260 Each key is 7 bytes long. 250 00:11:24,720 --> 00:11:28,940 And so that's a total key length of 21 bytes. 251 00:11:29,060 --> 00:11:30,600 So we need 21 bytes of key material. 252 00:11:31,220 --> 00:11:33,660 But remember, what we're using for the keys 253 00:11:33,660 --> 00:11:35,860 is the MD4 hash of the user's password. 254 00:11:36,520 --> 00:11:39,640 Now, an MD4 hash is only 16 bytes long, 255 00:11:40,860 --> 00:11:44,240 which means that we have 16 bytes of something, 256 00:11:45,000 --> 00:11:47,340 of, you know, of actual material, 257 00:11:47,600 --> 00:11:48,720 and we need 21. 258 00:11:49,800 --> 00:11:51,060 So what does Microsoft do? 259 00:11:51,240 --> 00:11:52,200 They just pad out 260 00:11:52,680 --> 00:11:53,860 five bytes with zeros. 261 00:11:58,960 --> 00:12:00,400 Which means that this third key 262 00:12:00,400 --> 00:12:02,220 is only two bytes long. 263 00:12:03,400 --> 00:12:04,980 It's a 16-bit key 264 00:12:04,980 --> 00:12:07,660 that you can reforce that on your laptop 265 00:12:07,660 --> 00:12:08,700 in under five seconds. 266 00:12:10,080 --> 00:12:11,580 So if we go back and we look, you know, 267 00:12:11,580 --> 00:12:12,240 at our total complexity, 268 00:12:12,360 --> 00:12:14,800 we've reduced the additive complexity 269 00:12:14,800 --> 00:12:16,600 to 2 to the 56th 270 00:12:16,600 --> 00:12:17,760 plus 2 to the 56th 271 00:12:17,760 --> 00:12:19,420 by basically eliminating the third key 272 00:12:20,560 --> 00:12:22,660 for, you know, a total number of 2 to the 56th. 273 00:12:22,680 --> 00:12:24,720 So now this is what we're dealing with. 274 00:12:25,820 --> 00:12:27,620 That's still, you know, a pretty big number. 275 00:12:28,220 --> 00:12:30,060 So if we go back and we look at the core problem, 276 00:12:30,160 --> 00:12:32,200 we've gotten rid of this, you know, 277 00:12:32,200 --> 00:12:33,720 effectively this last desencryption. 278 00:12:34,360 --> 00:12:36,660 So we're dealing with these two desencryptions here. 279 00:12:37,020 --> 00:12:39,680 And, you know, something that's sort of interesting 280 00:12:39,680 --> 00:12:42,140 about this is that the plain text 281 00:12:42,140 --> 00:12:44,540 is the same in both cases. 282 00:12:45,500 --> 00:12:47,140 That for both desencryptions, 283 00:12:47,200 --> 00:12:48,360 we're encrypting the same thing. 284 00:12:49,400 --> 00:12:51,280 So if you think about how you would implement 285 00:12:51,280 --> 00:12:52,660 a naive sort of encryption, 286 00:12:52,680 --> 00:12:53,320 sort of brute force attack, 287 00:12:53,940 --> 00:12:55,220 what you would do is you would iterate 288 00:12:55,220 --> 00:12:56,240 through the entire key space, 289 00:12:56,560 --> 00:12:58,380 and for every key in the key space, 290 00:12:58,680 --> 00:13:01,760 you would do a desencryption of your known plain text, 291 00:13:02,180 --> 00:13:03,440 and you would see if it matches 292 00:13:03,440 --> 00:13:04,700 your first known ciphertext. 293 00:13:05,160 --> 00:13:07,320 And if it does, then you know you found the first key. 294 00:13:07,760 --> 00:13:08,940 Then you would start over again 295 00:13:08,940 --> 00:13:10,720 and iterate through the entire key space again 296 00:13:11,340 --> 00:13:13,660 and do a desencryption of your... 297 00:13:13,660 --> 00:13:15,300 for each key in the key space, 298 00:13:15,440 --> 00:13:16,720 do a desencryption of your known plain text 299 00:13:16,720 --> 00:13:18,940 and see if it matches your second known ciphertext. 300 00:13:19,360 --> 00:13:22,360 Now, the expensive part of this whole brute force operation, 301 00:13:22,360 --> 00:13:24,180 is this, these DES operations. 302 00:13:24,400 --> 00:13:25,780 That's what costs something 303 00:13:25,780 --> 00:13:27,840 and makes iterating through the key space expensive. 304 00:13:30,680 --> 00:13:32,700 But since it's the same plain text both times, 305 00:13:32,780 --> 00:13:35,280 you can actually reduce this into a single loop 306 00:13:35,280 --> 00:13:37,400 where you iterate through the key space once, 307 00:13:38,360 --> 00:13:40,460 do a DES operation for every key in the key space, 308 00:13:40,740 --> 00:13:42,420 and just do two compares. 309 00:13:42,920 --> 00:13:44,860 You compare the output of your DES operation 310 00:13:44,860 --> 00:13:46,920 with your first ciphertext and your second ciphertext. 311 00:13:48,680 --> 00:13:51,180 Effectively, reducing the total complexity here 312 00:13:51,700 --> 00:13:52,340 just down. 313 00:13:52,360 --> 00:13:53,560 To 2 to the 56th. 314 00:13:55,440 --> 00:13:58,500 So, if we have an MSChat V2 handshake, 315 00:13:58,660 --> 00:14:01,720 we can reduce the entire security of this handshake 316 00:14:01,720 --> 00:14:03,980 down to a single DES encryption. 317 00:14:05,220 --> 00:14:06,960 So at this point, you know, we thought about it some more 318 00:14:06,960 --> 00:14:09,400 and we were like, all right, can we do, you know, some tricks, 319 00:14:09,540 --> 00:14:11,940 whatever, with mb4, and is there anything we could do? 320 00:14:12,200 --> 00:14:13,820 And at some point, we were just like, well, fuck it. 321 00:14:13,880 --> 00:14:14,840 Let's just call David Holton, 322 00:14:16,800 --> 00:14:18,720 who runs a company called Beacon Computing 323 00:14:18,720 --> 00:14:21,620 and knows stuff about brute forcing keys. 324 00:14:32,240 --> 00:14:33,280 Great, you know, we're just looking at, 325 00:14:33,280 --> 00:14:33,880 So, we're just trying to understand 326 00:14:33,880 --> 00:14:37,500 So, a while ago, we started looking at DES 327 00:14:37,500 --> 00:14:40,360 because part of my job at PICO 328 00:14:40,360 --> 00:14:41,920 is trying to find archaic algorithms 329 00:14:41,920 --> 00:14:46,360 that we can actually attack with FPGAs 330 00:14:46,360 --> 00:14:48,800 that would normally be out of the reach of normal computers. 331 00:14:50,880 --> 00:14:52,340 So, just looking at these, 332 00:14:52,360 --> 00:14:59,300 it does, I pulled these from the Wikipedia page, it's a Feistel network cipher, and basically, 333 00:15:00,520 --> 00:15:05,460 back in the day, this was originally developed to run in hardware, you know, this is developed 334 00:15:05,460 --> 00:15:11,380 to run in ASICs, and so they really, you know, developed it as a flowchart, there's lots 335 00:15:11,380 --> 00:15:17,620 of bit permutations and lookup tables and things like that, and so if you zoom into 336 00:15:17,620 --> 00:15:23,460 this F function, and just look at, you know, we have like this E box is a permutation, 337 00:15:24,040 --> 00:15:28,220 S boxes are all just lookup tables, and P box is a permutation, if you look at the P 338 00:15:28,220 --> 00:15:35,240 box, and zoom in a little bit, it's basically just transposing bits inside of, you know, 339 00:15:35,260 --> 00:15:42,580 input bits for output bits, and so if you're trying to do this on a normal computer, like 340 00:15:42,580 --> 00:15:47,500 this is a really horrible implementation of a P box in software. 341 00:15:47,620 --> 00:15:52,280 Where basically, you know, you have a for loop, and then it looks it up in a table and 342 00:15:52,280 --> 00:15:57,140 like moves bits around and stuff like that, and, you know, this is using 32 or 64 bit 343 00:15:57,140 --> 00:16:02,700 operations to move bits around, like it's horribly inefficient, and sure, there's lots 344 00:16:02,700 --> 00:16:06,580 of optimizations that people use nowadays with bit slicing and things like that, but 345 00:16:07,140 --> 00:16:12,520 it's really, you know, trying to do really, really simple operations that should be extremely 346 00:16:12,520 --> 00:16:17,280 simple on, you know, something that's made to do all sorts of general purpose operations, 347 00:16:18,040 --> 00:16:24,120 now if you take this problem and look at it actually implemented on ASIC, you know, it's 348 00:16:24,120 --> 00:16:27,680 essentially free, it's just routing lines, you're just moving bits from one place to 349 00:16:27,680 --> 00:16:34,740 another, and so, you know, why are you using, you know, billions of gates in order to perform 350 00:16:34,740 --> 00:16:40,520 these operations, so one analogy that I like to use for this is that, you know, doing it 351 00:16:40,520 --> 00:16:46,520 in software is kind of like an octopus riding a tricycle versus, you know, a Ferrari or 352 00:16:46,520 --> 00:16:47,060 something like that. 353 00:16:50,340 --> 00:16:55,140 So I think, in this case, the winner is definitely the ASIC, people have realized this for a long 354 00:16:55,140 --> 00:17:04,400 time, back in 1999, EFF built DeepCrack, which was kind of their, they were trying to basically 355 00:17:04,400 --> 00:17:09,440 prove that anybody for, you know, a small amount of money, in this case, it cost them 356 00:17:09,440 --> 00:17:13,760 about a quarter million dollars, would be able to break DES in a pretty short amount 357 00:17:13,760 --> 00:17:16,440 of time, in this case, it was about nine days, worst case. 358 00:17:17,620 --> 00:17:23,880 It was about 1,800 chips total that they made, they fabbed themselves, and so, you know, sure, 359 00:17:24,020 --> 00:17:27,680 if you have a quarter million dollars that you want to spend on this, and have a whole 360 00:17:27,680 --> 00:17:30,860 team of people that can design the chip and send it out to a fab and all that sort of 361 00:17:30,860 --> 00:17:37,100 stuff, that's all fine and great, but for other people, there's this new technology 362 00:17:37,100 --> 00:17:44,200 called FPGAs that were invented in the mid-80s, and up until recently, they haven't really 363 00:17:44,200 --> 00:17:47,600 found many applications in the general, sort of, development of FPGAs, and so, I think 364 00:17:47,620 --> 00:17:49,200 supercomputing space, but 365 00:17:52,460 --> 00:17:53,640 recently, they're finding 366 00:17:53,640 --> 00:17:55,140 their ways into all sorts of different areas. 367 00:17:56,800 --> 00:17:57,660 Here's just a few 368 00:17:57,660 --> 00:17:59,000 that I pulled off of the Wikipedia page. 369 00:17:59,760 --> 00:18:01,720 Digital signal processing, they're used 370 00:18:01,720 --> 00:18:03,540 in, like, base 371 00:18:03,540 --> 00:18:05,460 stations, like most GSM base stations 372 00:18:05,460 --> 00:18:07,420 have some sort of FPGAs in it, so they're 373 00:18:07,420 --> 00:18:09,460 software upgradable in the field, and 374 00:18:09,460 --> 00:18:10,920 software-defined radio, 375 00:18:12,220 --> 00:18:13,640 because with an FPGA 376 00:18:13,640 --> 00:18:15,520 you can basically implement your own ASIC and 377 00:18:15,520 --> 00:18:17,580 then program it to the FPGA and update 378 00:18:17,580 --> 00:18:18,820 it however many times you want. 379 00:18:19,840 --> 00:18:21,400 People just love this, you know, with 380 00:18:21,400 --> 00:18:23,640 like the USRP and GNU Radio Project 381 00:18:23,640 --> 00:18:24,440 and stuff like that. 382 00:18:24,940 --> 00:18:26,460 And so all sorts of other 383 00:18:27,460 --> 00:18:28,340 areas, and 384 00:18:29,080 --> 00:18:30,920 the one area that I focus on is 385 00:18:30,920 --> 00:18:32,800 cryptography, and so 386 00:18:32,800 --> 00:18:34,840 kind of the general idea is designing your 387 00:18:34,840 --> 00:18:36,320 own chip and 388 00:18:37,180 --> 00:18:38,780 making it specifically for breaking 389 00:18:38,780 --> 00:18:40,640 a certain algorithm, and then 390 00:18:40,640 --> 00:18:42,720 programming an FPGA with it, and then you basically have 391 00:18:42,720 --> 00:18:44,480 your own custom crypto accelerator 392 00:18:44,480 --> 00:18:46,040 that's specifically made for breaking 393 00:18:46,040 --> 00:18:46,460 an algorithm. 394 00:18:50,320 --> 00:18:51,700 And then, you know, 395 00:18:51,760 --> 00:18:53,860 it's kind of the same thing that works for all 396 00:18:53,860 --> 00:18:54,540 these different areas 397 00:18:55,800 --> 00:18:56,760 of supercomputing. 398 00:18:58,680 --> 00:18:59,160 So, 399 00:18:59,280 --> 00:19:00,840 looking inside an FPGA, 400 00:19:01,720 --> 00:19:03,820 the bare bones of it 401 00:19:03,820 --> 00:19:05,780 is that you have a bunch of lookup 402 00:19:05,780 --> 00:19:07,140 tables, which can basically 403 00:19:07,140 --> 00:19:09,720 describe any sort of arbitrary logic, 404 00:19:09,920 --> 00:19:11,920 and so there's your gates, 405 00:19:12,000 --> 00:19:13,240 basically, and then 406 00:19:13,240 --> 00:19:15,400 all you really need is logic 407 00:19:15,400 --> 00:19:17,780 and registers, some sort of sense of time 408 00:19:17,780 --> 00:19:19,140 that can actually store your data, 409 00:19:19,860 --> 00:19:21,640 and then you just need to be able to connect everything 410 00:19:21,640 --> 00:19:22,800 together, so they provide 411 00:19:23,620 --> 00:19:25,660 LUTs, registers, routing, and then 412 00:19:26,140 --> 00:19:27,460 they provide a few other things 413 00:19:27,460 --> 00:19:28,980 just to make things easier, like 414 00:19:29,640 --> 00:19:31,200 small block RAM, which is 415 00:19:31,720 --> 00:19:33,520 essentially kind of like small pieces of RAM 416 00:19:33,520 --> 00:19:35,700 inside the FPGA, just because people like 417 00:19:35,700 --> 00:19:37,220 to use FIFOs and all sorts of other 418 00:19:37,220 --> 00:19:39,680 general purpose storage elements, and it makes it 419 00:19:39,680 --> 00:19:40,880 a lot more efficient to do it 420 00:19:41,440 --> 00:19:43,140 that way instead of using up your 421 00:19:43,240 --> 00:19:45,380 LUTs. There's also DSP blocks 422 00:19:45,380 --> 00:19:47,500 that implement adders and multipliers 423 00:19:47,500 --> 00:19:48,220 and things like that, 424 00:19:49,380 --> 00:19:51,620 and DCMs for multiplying clock frequencies 425 00:19:51,620 --> 00:19:53,000 and et cetera, but 426 00:19:53,000 --> 00:19:55,340 the general idea is anything you can describe 427 00:19:55,840 --> 00:19:57,840 in a circuit as an ASIC, 428 00:19:57,880 --> 00:19:59,300 you can program onto an FPGA 429 00:19:59,300 --> 00:20:01,680 and do it 430 00:20:02,660 --> 00:20:03,520 programmatically with 431 00:20:03,520 --> 00:20:05,220 software instead of having to 432 00:20:05,220 --> 00:20:06,400 actually fab a chip. 433 00:20:08,480 --> 00:20:09,840 So, on an FPGA, 434 00:20:10,620 --> 00:20:11,900 you probably can't see this 435 00:20:11,900 --> 00:20:12,500 too well, but 436 00:20:13,240 --> 00:20:14,560 basically describing that S-box, 437 00:20:14,720 --> 00:20:16,160 you're just making a sign statement 438 00:20:16,160 --> 00:20:18,140 and saying, you know, the output of P 439 00:20:18,140 --> 00:20:20,000 equals these bits from S. 440 00:20:20,380 --> 00:20:22,400 And so there's no, you know, 441 00:20:22,420 --> 00:20:23,840 shifting involved. It's all, you can 442 00:20:23,840 --> 00:20:25,720 describe it at the bit level or the byte level 443 00:20:25,720 --> 00:20:27,680 or whatever level you want, because it's basically 444 00:20:27,680 --> 00:20:29,020 just rerouting signals. 445 00:20:30,700 --> 00:20:32,220 So, you can kind of see 446 00:20:32,220 --> 00:20:34,260 how this can make DES a lot 447 00:20:34,260 --> 00:20:35,580 more efficient to run on 448 00:20:35,580 --> 00:20:37,820 a specialized chip, and 449 00:20:39,300 --> 00:20:40,420 so we went ahead 450 00:20:40,420 --> 00:20:42,000 and a while ago, we implemented 451 00:20:42,000 --> 00:20:43,220 DES just to see, you know, 452 00:20:43,240 --> 00:20:44,340 see how fast we could get it 453 00:20:44,340 --> 00:20:45,920 on FPGAs. And 454 00:20:46,720 --> 00:20:48,320 this is a picture of 455 00:20:48,320 --> 00:20:50,280 one of our servers down on the bottom here. It's just 456 00:20:50,280 --> 00:20:52,140 a 4U rack mount server. It draws about 2 457 00:20:52,140 --> 00:20:53,560 kilowatts. And 458 00:20:54,280 --> 00:20:55,980 we went ahead and implemented DES 459 00:20:55,980 --> 00:20:57,480 as a real pipeline. So, 460 00:20:58,440 --> 00:20:59,980 on an FPGA, you can actually, 461 00:21:00,420 --> 00:21:02,020 you know, each one of those stages 462 00:21:02,020 --> 00:21:04,280 of DES, you can 463 00:21:04,280 --> 00:21:06,160 actually implement and then have just registers 464 00:21:06,160 --> 00:21:07,820 in between them. So, as you flow data in, 465 00:21:07,980 --> 00:21:09,880 it just gets clocked along through the whole thing. 466 00:21:10,200 --> 00:21:12,220 And once the pipeline is full, you get 467 00:21:12,220 --> 00:21:13,840 an actual DES operation 468 00:21:13,840 --> 00:21:15,820 every single clock cycle that you're clocking this. 469 00:21:16,560 --> 00:21:18,060 And we can clock this 470 00:21:18,060 --> 00:21:20,040 up to, we've clocked it up to 600 471 00:21:20,040 --> 00:21:22,120 megahertz reliably, you know, 472 00:21:22,140 --> 00:21:23,180 we're maybe doing 450. 473 00:21:24,040 --> 00:21:26,120 And so that means, for each one of 474 00:21:26,120 --> 00:21:27,700 these cores, we're doing 450 475 00:21:27,700 --> 00:21:30,200 million DES operations per second. 476 00:21:31,180 --> 00:21:32,180 And each one of 477 00:21:32,180 --> 00:21:33,800 the FPGAs can fit 40 cores in it. 478 00:21:33,900 --> 00:21:36,080 So, that equals about 18 billion keys per second. 479 00:21:37,700 --> 00:21:38,180 Then, 480 00:21:38,680 --> 00:21:40,400 we can fit 48 FPGAs 481 00:21:40,400 --> 00:21:41,440 in the server, and so 482 00:21:42,220 --> 00:21:43,900 that basically means that we can go through the full 483 00:21:43,900 --> 00:21:46,140 256 key space in under 484 00:21:46,140 --> 00:21:46,760 24 hours. 485 00:21:48,560 --> 00:21:49,960 And that's worst case time. 486 00:21:50,120 --> 00:21:52,080 So, in practice, it'll probably 487 00:21:52,080 --> 00:21:52,700 be half a day. 488 00:21:55,760 --> 00:21:56,180 So, 489 00:21:56,280 --> 00:21:57,580 if you look at equivalent performance, 490 00:21:57,800 --> 00:22:00,280 we just pulled up some benchmarks on CPUs 491 00:22:00,280 --> 00:22:00,940 and GPUs. 492 00:22:02,340 --> 00:22:03,920 On CPUs, to do it in under 493 00:22:03,920 --> 00:22:05,940 24 hours, it would take, you know, 494 00:22:06,740 --> 00:22:08,140 about 80,000 CPU 495 00:22:08,140 --> 00:22:09,960 cores. Or on 496 00:22:09,960 --> 00:22:11,580 GPUs, about 1,800 of them. 497 00:22:12,220 --> 00:22:14,060 So, just for an idea of scale, you know, 498 00:22:14,080 --> 00:22:16,260 4U machine versus data center 499 00:22:16,260 --> 00:22:17,980 full of GPUs or CPUs. 500 00:22:21,800 --> 00:22:22,160 So, 501 00:22:22,780 --> 00:22:24,160 the next question that we had 502 00:22:24,160 --> 00:22:25,820 is, can we make this faster on an FPGA? 503 00:22:25,960 --> 00:22:28,120 And so, we started looking at this, 504 00:22:28,160 --> 00:22:30,100 trying to see if there's any way that we can speed 505 00:22:30,100 --> 00:22:30,920 things up a little bit. 506 00:22:32,440 --> 00:22:34,120 And so, some of the 507 00:22:34,120 --> 00:22:36,340 things with implementing this on an FPGA 508 00:22:36,340 --> 00:22:38,080 is that we have, you know, certain data that needs 509 00:22:38,080 --> 00:22:40,120 to get set in order to set up 510 00:22:40,120 --> 00:22:42,180 everything. And so, if we're splitting 511 00:22:42,180 --> 00:22:43,660 this up across many, many cards, 512 00:22:43,900 --> 00:22:46,160 we have to take the whole key space and then 513 00:22:46,160 --> 00:22:48,060 split it up into small little sections that each 514 00:22:48,060 --> 00:22:49,100 FPGA can crunch on. 515 00:22:49,700 --> 00:22:52,000 So, we have, you know, like a key 516 00:22:52,000 --> 00:22:53,500 start and stop sort of 517 00:22:53,980 --> 00:22:56,100 register set up to tell it where to 518 00:22:56,100 --> 00:22:58,060 start for each one of the cores. And then we also 519 00:22:58,060 --> 00:23:00,100 have to provide the plain text and cipher 520 00:23:00,100 --> 00:23:01,100 text that we're looking for. 521 00:23:03,660 --> 00:23:04,280 And so, 522 00:23:04,360 --> 00:23:06,120 one optimization that we worked 523 00:23:06,120 --> 00:23:08,100 on is, basically, 524 00:23:08,280 --> 00:23:10,100 instead of having this whole 525 00:23:10,100 --> 00:23:12,080 bus going to each core, so we have, so we 526 00:23:12,180 --> 00:23:14,000 set up all these values every time we start up the core, 527 00:23:15,320 --> 00:23:15,920 we're thinking, 528 00:23:16,040 --> 00:23:17,200 well, we could actually 529 00:23:18,060 --> 00:23:19,980 take this bit file that we actually 530 00:23:19,980 --> 00:23:21,940 load onto the FPGA with the configuration and 531 00:23:21,940 --> 00:23:23,440 pre-configure it 532 00:23:24,100 --> 00:23:25,980 with these start, stop, you know, 533 00:23:25,980 --> 00:23:27,920 cipher text, plain text values. And so, 534 00:23:28,340 --> 00:23:30,000 we program the FPGA, it comes 535 00:23:30,000 --> 00:23:32,000 up, and then it sees all these values there 536 00:23:32,000 --> 00:23:33,980 and it's like, oh, I know exactly where to start. It goes 537 00:23:33,980 --> 00:23:35,900 off and starts crunching on things. And so, 538 00:23:35,960 --> 00:23:37,920 we don't have to have all those resources dedicated 539 00:23:37,920 --> 00:23:39,320 to just setting everything up. 540 00:23:41,220 --> 00:23:41,940 And so, 541 00:23:41,940 --> 00:23:43,220 it turns out that Xilinx actually, 542 00:23:43,320 --> 00:23:45,080 which is one of the FPGA manufacturers, 543 00:23:45,660 --> 00:23:47,420 provides a method for programming 544 00:23:47,900 --> 00:23:49,840 specific block RAMs inside the 545 00:23:49,840 --> 00:23:51,880 bit file without having to rebuild the whole 546 00:23:51,880 --> 00:23:53,920 thing. And so, we play 547 00:23:53,920 --> 00:23:55,620 around with this and we're able to 548 00:23:55,620 --> 00:23:56,660 get that to work. 549 00:23:57,980 --> 00:24:00,020 And basically, how it works is, you know, 550 00:24:00,040 --> 00:24:01,760 you set up a couple files and then you can just 551 00:24:02,260 --> 00:24:04,000 essentially just run a command and it'll 552 00:24:04,600 --> 00:24:05,940 drop memory into the bit 553 00:24:05,940 --> 00:24:07,740 file and configure these BRAMs and then 554 00:24:07,740 --> 00:24:09,680 you program it and everything comes up 555 00:24:09,680 --> 00:24:10,340 perfectly good. 556 00:24:11,940 --> 00:24:13,220 So, the second optimization 557 00:24:14,620 --> 00:24:14,980 is 558 00:24:15,840 --> 00:24:17,500 we still need to have a return path 559 00:24:17,500 --> 00:24:19,480 saying when it's found a key or whatever. 560 00:24:19,660 --> 00:24:21,760 And so, we created a really minimal 561 00:24:21,760 --> 00:24:23,480 bus that basically just says, you know, 562 00:24:23,520 --> 00:24:24,980 found a key, and that's it. 563 00:24:25,620 --> 00:24:27,760 And then, based on the time that it took to find 564 00:24:27,760 --> 00:24:29,840 the key, then, because this is all deterministic, 565 00:24:29,860 --> 00:24:31,540 we're getting one key per clock cycle, 566 00:24:31,940 --> 00:24:33,600 we know with fairly good accuracy 567 00:24:33,600 --> 00:24:35,620 exactly where in the key space it was 568 00:24:35,620 --> 00:24:36,420 when it found that key. 569 00:24:37,620 --> 00:24:39,740 And so, with these 570 00:24:39,740 --> 00:24:41,700 sorts of things, we can reduce quite a bit of 571 00:24:41,700 --> 00:24:43,460 the logic and get it down 572 00:24:43,460 --> 00:24:45,380 to be a lot more optimal. And so, this got us 573 00:24:45,380 --> 00:24:46,380 about another 20%. 574 00:24:49,100 --> 00:24:50,900 And so, we're thinking, what else? 575 00:24:51,020 --> 00:24:53,280 And this is kind of a pipe dream that we've 576 00:24:53,280 --> 00:24:55,300 been thinking about for a while, which we 577 00:24:55,300 --> 00:24:56,900 haven't implemented yet, but 578 00:24:56,900 --> 00:24:59,340 we're planning on releasing a framework sometime in the 579 00:24:59,340 --> 00:25:00,740 near future for it. So, 580 00:25:01,740 --> 00:25:03,280 FPGAs have this thing called JTAG, 581 00:25:04,120 --> 00:25:05,380 which, if you've done 582 00:25:05,380 --> 00:25:07,520 any sort of hardware hacking, you're probably familiar with it, 583 00:25:07,580 --> 00:25:09,340 where it's a debug interface that most 584 00:25:09,340 --> 00:25:11,680 chips have. And on an FPGA, 585 00:25:11,680 --> 00:25:13,560 this is an interface you can use for 586 00:25:14,060 --> 00:25:14,940 programming it. 587 00:25:15,480 --> 00:25:17,140 They also have all sorts of things 588 00:25:17,600 --> 00:25:19,440 built in for doing 589 00:25:19,440 --> 00:25:21,240 on-chip debugging, where you can basically put 590 00:25:21,240 --> 00:25:23,460 essentially a logic analyzer 591 00:25:23,460 --> 00:25:25,380 inside the chip, and then tap lines 592 00:25:25,380 --> 00:25:27,160 and things like that. And so, 593 00:25:27,240 --> 00:25:29,360 we found that there's actually a couple 594 00:25:29,360 --> 00:25:30,960 commands that they have with JTAG 595 00:25:32,520 --> 00:25:33,580 for letting you 596 00:25:33,580 --> 00:25:35,360 read and write to block RAM entirely 597 00:25:35,360 --> 00:25:36,380 over JTAG. And so, 598 00:25:37,060 --> 00:25:39,400 with this, if we do all of our communication 599 00:25:39,400 --> 00:25:41,580 with just these little tiny block RAMs inside 600 00:25:41,580 --> 00:25:43,440 the FPGA, we don't have 601 00:25:43,440 --> 00:25:45,340 to have a bus at all communicating to the outside world. 602 00:25:45,520 --> 00:25:47,400 All we have to have is JTAG going to 603 00:25:47,400 --> 00:25:49,360 the device, and we don't have to use 604 00:25:49,360 --> 00:25:51,240 any routing resources at all to talk to 605 00:25:51,240 --> 00:25:53,400 any of the cores. We can do it all 606 00:25:53,400 --> 00:25:54,340 transparently. And so, 607 00:25:56,020 --> 00:25:57,520 this is one thing that we're working 608 00:25:57,520 --> 00:25:59,400 on, and hopefully this will be working soon. 609 00:25:59,520 --> 00:26:01,680 But that could probably get us another 20-30% 610 00:26:02,040 --> 00:26:03,100 speed improvement as well. 611 00:26:05,760 --> 00:26:06,280 But anyway, 612 00:26:07,900 --> 00:26:08,260 regardless, 613 00:26:09,380 --> 00:26:11,400 with all of this, it's 614 00:26:11,580 --> 00:26:13,120 still fun to crack MSChap 615 00:26:13,120 --> 00:26:15,060 V2, if only we can do it. 616 00:26:15,220 --> 00:26:15,380 So, 617 00:26:17,260 --> 00:26:19,380 all these talks that I give, it's always 618 00:26:19,380 --> 00:26:21,500 like, oh yeah, you could do this 619 00:26:21,500 --> 00:26:22,920 if you get your own FPGA and 620 00:26:23,820 --> 00:26:25,160 set it all up and 621 00:26:25,660 --> 00:26:27,120 spend a bunch of money on this, but 622 00:26:28,460 --> 00:26:29,160 we decided 623 00:26:29,580 --> 00:26:30,800 why not let you guys do it? 624 00:26:33,540 --> 00:26:34,260 Thank you. 625 00:26:44,120 --> 00:26:44,600 Hello? 626 00:26:45,520 --> 00:26:46,720 So, you know, 627 00:26:46,760 --> 00:26:48,280 this is one of these things where it's like, 628 00:26:49,220 --> 00:26:51,060 you know, David's clearly a genius 629 00:26:51,060 --> 00:26:53,060 and, you know, he can crack 630 00:26:53,060 --> 00:26:55,100 all this stuff. If there was only some way that we could 631 00:26:55,100 --> 00:26:57,200 leverage his genius so that 632 00:26:57,200 --> 00:26:58,140 everyone could benefit. 633 00:26:59,260 --> 00:27:00,040 And so, 634 00:27:00,820 --> 00:27:03,000 we put something together where I wrote this tool 635 00:27:03,000 --> 00:27:04,580 called ChapCrack, and 636 00:27:05,280 --> 00:27:07,240 it's a simple little tool 637 00:27:07,240 --> 00:27:09,100 that you can point 638 00:27:09,100 --> 00:27:11,220 at any packet capture, and it 639 00:27:11,220 --> 00:27:12,780 will parse the entire packet capture 640 00:27:12,780 --> 00:27:14,620 and pull out any MSChap V2 641 00:27:14,620 --> 00:27:16,480 handshakes that exist in the whole capture. 642 00:27:17,860 --> 00:27:18,580 And it will 643 00:27:18,940 --> 00:27:20,920 give you the things that we're interested 644 00:27:20,920 --> 00:27:22,660 in here, you know, like the known plain text 645 00:27:22,660 --> 00:27:23,820 and the known cipher text 646 00:27:24,580 --> 00:27:24,940 for 647 00:27:26,980 --> 00:27:28,680 that core problem that we're dealing with. 648 00:27:29,200 --> 00:27:30,860 And it will even crack that third 649 00:27:30,860 --> 00:27:32,500 key for you, the two-byte key. 650 00:27:35,020 --> 00:27:36,840 And it tells you, you know, the username of 651 00:27:36,840 --> 00:27:38,920 the person who's logging in in this case 652 00:27:38,920 --> 00:27:41,080 because that's, of course, sent in the clear with MSChap 653 00:27:41,220 --> 00:27:42,720 V2. And then it gives you 654 00:27:42,720 --> 00:27:44,460 this last little thing here, a submission 655 00:27:44,460 --> 00:27:46,040 token. So what is that? 656 00:27:47,480 --> 00:27:48,760 So, right now we have 657 00:27:48,760 --> 00:27:50,660 right here we have everything that we need 658 00:27:50,660 --> 00:27:52,660 from both parts of this thing, except for 659 00:27:53,200 --> 00:27:54,720 the key, with the exception 660 00:27:54,720 --> 00:27:55,280 of the third key. 661 00:27:56,460 --> 00:27:58,620 And so, I have this online service 662 00:27:58,620 --> 00:28:00,460 called CloudCracker, and 663 00:28:00,460 --> 00:28:02,260 it's basically an online password cracker. 664 00:28:03,060 --> 00:28:04,600 We support a few different formats 665 00:28:04,600 --> 00:28:06,440 and you can submit a hash 666 00:28:06,440 --> 00:28:08,360 of a WPA handshake or 667 00:28:08,360 --> 00:28:10,480 you know, a Cripshaw 512 668 00:28:10,480 --> 00:28:11,120 or something. 669 00:28:11,220 --> 00:28:12,140 Something like that. And 670 00:28:12,140 --> 00:28:15,060 we, you know, spin it out across the cloud, 671 00:28:15,280 --> 00:28:17,000 run a cracking job, and mail you 672 00:28:17,000 --> 00:28:19,020 your results. And so 673 00:28:19,020 --> 00:28:21,080 what we've done is added a 674 00:28:21,080 --> 00:28:23,200 MSChap V2 option to CloudCracker. 675 00:28:23,920 --> 00:28:24,740 And so 676 00:28:24,740 --> 00:28:27,080 if you have any kind of 677 00:28:27,080 --> 00:28:29,200 MSChap V2 handshake, you can run 678 00:28:29,200 --> 00:28:30,700 a chap crack over the handshake, 679 00:28:30,940 --> 00:28:33,020 get that CloudCracker submission token, 680 00:28:33,700 --> 00:28:35,080 and paste it into the website 681 00:28:35,080 --> 00:28:35,380 here. 682 00:28:36,620 --> 00:28:38,500 Once you do that, you just 683 00:28:40,260 --> 00:28:40,960 submit the 684 00:28:40,960 --> 00:28:42,720 job with your email address, and 685 00:28:43,340 --> 00:28:44,900 David has been kind enough to 686 00:28:44,900 --> 00:28:46,860 put his FPGA cracking 687 00:28:46,860 --> 00:28:48,660 magic online, and it 688 00:28:49,240 --> 00:28:50,520 transparently sends that over there, 689 00:28:50,680 --> 00:28:52,860 runs the job, and you get your results back 690 00:28:52,860 --> 00:28:54,400 in less than a day. 691 00:28:55,080 --> 00:28:57,020 Which means that anybody should now have the ability 692 00:28:57,020 --> 00:28:58,500 to crack MSChap V2. 693 00:29:05,440 --> 00:29:06,820 We're hoping that by doing 694 00:29:06,820 --> 00:29:08,740 this, we can break out of this 695 00:29:08,740 --> 00:29:10,820 like, fucking, uh, 696 00:29:10,960 --> 00:29:12,740 cycle of, uh, 697 00:29:13,060 --> 00:29:14,780 of, uh, of, uh, 698 00:29:14,780 --> 00:29:15,560 support and use. 699 00:29:16,380 --> 00:29:18,680 But in the meantime, have some fun with it. 700 00:29:19,460 --> 00:29:20,820 So, thanks for listening. 701 00:29:21,360 --> 00:29:22,900 And, uh, let's all 702 00:29:22,900 --> 00:29:24,920 give a round of applause for Marsh Ray, 703 00:29:25,080 --> 00:29:26,580 who couldn't be here today, but was 704 00:29:27,220 --> 00:29:28,780 instrumental in a lot of this stuff as well.