1 00:00:00,000 --> 00:00:01,680 Okay, we're going to get started. 2 00:00:01,680 --> 00:00:03,180 AV will come at some point. 3 00:00:03,180 --> 00:00:05,640 Until then, you get micro-figures. 4 00:00:05,640 --> 00:00:09,320 I don't know if you can see anything there at all, but we'll do what we can. 5 00:00:09,840 --> 00:00:15,640 So, I'm Sean Anconi, and I'm an academic researcher at the University of Melbourne. 6 00:00:15,640 --> 00:00:18,500 I'm going to start with my long list of thank-yous. 7 00:00:18,500 --> 00:00:24,720 At that size font you probably can't see it, but there is a long list of people who actually made all this research possible. 8 00:00:24,720 --> 00:00:28,540 A team of researchers across the world at various different universities. 9 00:00:29,280 --> 00:00:36,420 My particular journey, I've done a fairly standard academic thing, other than a few run-ins with the law during the process. 10 00:00:36,640 --> 00:00:38,740 Some time in government, I worked in the U.S. 11 00:00:38,740 --> 00:00:42,060 Senate, which also feeds into some of this talk, and then at the U.S. 12 00:00:42,060 --> 00:00:43,020 Federal Trade Commission. 13 00:00:43,020 --> 00:00:46,400 They're a little less involved in the kind of scary stuff. 14 00:00:46,840 --> 00:00:56,680 So, the motivating question for a lot of my last 15 years has been, how does the NSA or state-level adversaries actually break crypto? 15 00:00:56,680 --> 00:00:58,820 So, we've all got theories about how they do it. 16 00:00:58,820 --> 00:01:01,600 Maybe it's implants, maybe it's fancy math. 17 00:01:01,600 --> 00:01:09,620 We don't actually know, as members of the public, unless some of you are former NSA employees, how this is done in a real practical sense. 18 00:01:09,700 --> 00:01:20,680 So, one of the things me and the various labs that I've worked in has done is try and replicate some of the setups that the National Security Agency might use, and see what we can replicate. 19 00:01:20,680 --> 00:01:35,080 Whether that's very large number crunching, whether that's trying to reverse engineer different hardware parts and see if there are vulnerabilities there, or even more interestingly, trying to figure out how decryption is done at scale. 20 00:01:35,080 --> 00:01:49,000 So, we know that for a substantial fortune of the NSA's existence and other similarly placed state-level adversaries, they have actually been able to engage in signals intelligence of decrypted traffic at scale. 21 00:01:49,000 --> 00:01:50,720 So, how do they do that? 22 00:01:50,880 --> 00:01:52,700 We could have a few guesses. 23 00:01:52,700 --> 00:02:06,780 The first is, well, they're the NSA, they've got a billion dollar-ish black budget, they can just buy a lot of chips, a lot of GPUs, a lot of ASICs, and accelerate crypto cracking faster than we could, and maybe they're just brute-forcing stuff. 24 00:02:07,040 --> 00:02:19,840 But we're pretty certain that AES-128 is very good, AES-256 is excellent, and even with a whole data center full of ASICs, you're unlikely to make very much progress at all. 25 00:02:19,840 --> 00:02:24,760 We think the security on those algorithms is pretty tight, so how are they actually doing it? 26 00:02:24,760 --> 00:02:28,160 Maybe it's just a matter of getting compliance out into the wild. 27 00:02:28,160 --> 00:02:36,780 Many of you probably saw the Snowden slides of agents putting chips into or tampering with existing hardware devices, maybe that's some of it. 28 00:02:36,780 --> 00:02:43,460 But it doesn't really explain the scale at which we think the NSA is able to do interception and decryption. 29 00:02:43,800 --> 00:02:48,380 And then most recently on the internet I've seen a whole lot of AI mumbo-jumbo. 30 00:02:48,380 --> 00:02:52,160 Perhaps the NSA is using LLMs to crack everything. 31 00:02:52,160 --> 00:02:55,520 I think that one seems a little even more unlikely. 32 00:02:55,600 --> 00:02:57,120 So what's the truth of it? 33 00:02:57,120 --> 00:02:59,400 How are they actually doing this at scale? 34 00:02:59,420 --> 00:03:01,940 The answer is probably some mix of these. 35 00:03:01,940 --> 00:03:08,860 Having a large data center full of ASICs is likely quite helpful, but it isn't going to get you all the way there. 36 00:03:08,860 --> 00:03:23,760 Having implants that you can target at specific adversaries, like the NSA's adversaries, not the NSA themselves, is again going to be very useful, but won't get you all the way there to the type of mass interception that we actually think is happening. 37 00:03:23,900 --> 00:03:26,820 So let's... 38 00:03:26,820 --> 00:03:27,960 Oh, sure. 39 00:03:28,820 --> 00:03:29,680 Okay. 40 00:03:30,360 --> 00:03:32,580 So... oh my god, that's loud. 41 00:03:32,840 --> 00:03:34,360 Maybe I'll go back here. 42 00:03:36,760 --> 00:03:51,720 So let's take it back a little bit and go to an actual picture of what cryptography looks like, sketch version, and slowly add in some of the pieces to try and figure out what the NSA themselves might actually be targeting in order to achieve decryption at scale. 43 00:03:51,840 --> 00:03:55,720 So here we have our baby intro crypto 101 slide. 44 00:03:55,720 --> 00:04:00,340 I know this is old news probably for many of you, but as we add a few more features. 45 00:04:00,400 --> 00:04:07,140 So Alice wants to talk to Bob, and then we have our adversary who wants to intercept in the middle. 46 00:04:07,140 --> 00:04:12,520 Maybe they have cut a transcontinental sub and are intercepting the traffic. 47 00:04:12,520 --> 00:04:14,400 So right now, no encryption on this. 48 00:04:14,400 --> 00:04:14,920 Great. 49 00:04:14,920 --> 00:04:18,200 Eve can listen in and hear that Alice hates her. 50 00:04:19,240 --> 00:04:25,060 Unfortunately, now Alice and Bob have decided to use cryptography and suddenly it's opaque to them. 51 00:04:25,060 --> 00:04:27,400 This is the challenge that the NSA faces. 52 00:04:27,520 --> 00:04:31,680 So what are the concrete cryptographic building blocks that they're going to use? 53 00:04:31,680 --> 00:04:35,540 Well, they'll probably have a symmetric cipher under some key K. 54 00:04:35,640 --> 00:04:39,340 As we know, that's not going to be enough to actually secure the communication. 55 00:04:39,340 --> 00:04:43,680 Right now, this is susceptible to things like man in the middle attacks, replay attacks. 56 00:04:43,680 --> 00:04:47,040 So we're going to need all these different pieces. 57 00:04:47,260 --> 00:04:49,780 On there, we'll have a key exchange at the beginning. 58 00:04:49,780 --> 00:04:50,880 Still not good. 59 00:04:50,880 --> 00:04:52,920 Now we're going to need some kind of authentication. 60 00:04:52,920 --> 00:04:54,880 So we're going to add a digital signature. 61 00:04:55,020 --> 00:04:58,980 We're going to add nonces to ensure that replay attacks aren't possible. 62 00:04:59,500 --> 00:05:03,420 And this involves randomness at a number of different stages. 63 00:05:03,420 --> 00:05:13,160 And the security of the protocol critically is fundamentally reliant on the unguessability of these random values. 64 00:05:13,160 --> 00:05:18,520 So for those of you who are familiar with random number generation, this will seem like fairly straightforward to you. 65 00:05:18,520 --> 00:05:21,880 Well, of course, these random numbers aren't truly random. 66 00:05:21,920 --> 00:05:34,680 But digging into the details turns out to be quite important, because if there is a flaw systemically in the random number generators, maybe this would open up a pathway for a state level adversary to systemically decrypt the traffic. 67 00:05:34,680 --> 00:05:47,060 Because once you're able to predict some of these values, and again, the details of which random numbers you need to predict are going to be dependent on implementation, you might be able to decrypt traffic at scale. 68 00:05:47,100 --> 00:05:49,700 So that's what a chunk of the talk is going to be about. 69 00:05:49,920 --> 00:06:01,880 And then the second half, which I think is almost the more interesting half, we're going to move beyond random number generators and say, well, how do you encourage people to have broken random number generators in the first place? 70 00:06:01,880 --> 00:06:14,140 And if you're a state level adversary, how do you go about ensuring that the implementations and protocols that people use are broken in the first place so that you can later come along and break the traffic? 71 00:06:14,780 --> 00:06:15,460 Okay. 72 00:06:15,460 --> 00:06:17,280 So let's go back even a little further. 73 00:06:17,280 --> 00:06:18,840 Back to the design of DES. 74 00:06:18,840 --> 00:06:26,440 We have a standards organization which attempts to set what algorithms will be used and what their design is. 75 00:06:26,440 --> 00:06:32,660 So earlier on, this was the National Bureau of Standards, which evolved into the National Institute of Standards and Technology. 76 00:06:32,680 --> 00:06:39,020 And there's a cute little stick figure graphic online about the early standardization of DES due to Jeff Moser. 77 00:06:39,020 --> 00:06:41,060 You can check that out online. 78 00:06:41,760 --> 00:06:44,040 But this was quite a long time ago. 79 00:06:44,040 --> 00:06:51,940 What changed such that the NSA went from breaking DES with shorter key lengths to being able to break traffic at scale on the internet? 80 00:06:52,120 --> 00:06:57,760 Well, there's the well known Snowden slide that showed that the NSA did in fact have this capability. 81 00:06:57,820 --> 00:07:09,740 Some of it was due to intercepting traffic after it had been decrypted at places like Google's termination, just after the termination, the NSA would have a network tap and then they'd be able to read the decrypted traffic. 82 00:07:09,740 --> 00:07:17,540 But something about this slide kind of twigged for my lab that suggested that they were actually able to do some of the decryption themselves. 83 00:07:17,860 --> 00:07:21,700 And for the NSA, this resulted in a happy dance. 84 00:07:22,480 --> 00:07:31,860 So what is the public cryptography community missing or what were they missing in around 2010 that actually led to this decryption happening? 85 00:07:31,880 --> 00:07:34,180 Was there a big algorithmic breakthrough? 86 00:07:35,540 --> 00:07:38,820 They're probably one of the largest hires of mathematicians in the world. 87 00:07:38,820 --> 00:07:46,040 Do they know something about math that we didn't such that they were able to compromise either the random number generators or the public key crypto? 88 00:07:46,060 --> 00:07:52,120 Did they have an algorithm to calculate the discrete log of Diffie-Hellman faster than we think is possible? 89 00:07:52,300 --> 00:07:53,040 Maybe. 90 00:07:53,420 --> 00:07:56,980 Or is it something both a little more mundane and a little more sinister? 91 00:07:56,980 --> 00:07:59,000 And we're going to talk about what that was. 92 00:07:59,000 --> 00:08:06,060 So, again, as a refresher, we need in order to generate crypto keys, we need a good source of system randomness. 93 00:08:06,280 --> 00:08:10,500 Not every crypto system is going to rely on randomness, but most will. 94 00:08:10,500 --> 00:08:16,000 And so this is going to be the focus for today is those crypto systems that do need randomness. 95 00:08:16,060 --> 00:08:29,640 The best way of doing it probably is using quantum mechanical fluctuations, having a true random number generator and actually get something that's pulling from as far as physicists know is a truly random distribution. 96 00:08:30,240 --> 00:08:43,980 But there are some issues with this in that true random number generators have tended to be expensive, not available in commodity hardware, your phone doesn't have one in them, so if your phone wants to do TLS, it's going to need some other source of randomness. 97 00:08:43,980 --> 00:09:00,740 And so what we've traditionally done is use pseudo random number generators and schematically we gather entropy from a variety of sources, whether those keyboard timings, what time the computer was turned on, mix that up using a whitening function and use that to generate our crypto keys. 98 00:09:01,100 --> 00:09:12,500 And so in order to figure out what the NSA, how the NSA was breaking traffic at scale, a good path forward would be to look at standardized designs of pseudo random number generators that are everywhere. 99 00:09:12,560 --> 00:09:24,520 And the reason why standards are important is because from a financial perspective, industry is going to latch on to those standards to choose what they design into their products, which makes them an excellent target if you want to compromise something. 100 00:09:24,520 --> 00:09:29,720 If you compromise the standard, you're going to compromise a large set of products. 101 00:09:29,800 --> 00:09:38,300 So we're going to dig a little bit into some of the standardization programs that have existed that an adversary such as the NSA would have been able to break. 102 00:09:38,880 --> 00:09:41,420 Now if you dive into U.S. 103 00:09:41,420 --> 00:09:47,320 federal information security standards, a number of them are much larger than others. 104 00:09:47,320 --> 00:09:56,780 Now the primary one of these is FIPS, the federal information processing standards, 140-X, where X is the series of the standard. 105 00:09:57,000 --> 00:10:00,700 At the time of research, it was 140-2. 106 00:10:00,700 --> 00:10:09,580 Now there's 140-3, and I'm pleased to say that a lot of the issues in this talk have been remediated over the last two, three-ish years with that new standard. 107 00:10:09,760 --> 00:10:25,760 And as part of that, they also introduced the cryptographic module verification program, the CMVP, where vendors were able to go to NIST and say, hey, we think we meet FIPS 140-2, can you give us certification under this program? 108 00:10:25,760 --> 00:10:30,360 And with this certification, you then have approval for your products to be procured by the U.S. 109 00:10:30,360 --> 00:10:31,380 federal government. 110 00:10:31,380 --> 00:10:41,560 So if you are a major vendor of hardware devices, of course you're going to want to ensure that you have a FIPS compliant mode such that you can sell to one of the biggest customers out there, the U.S. 111 00:10:41,560 --> 00:10:42,000 government. 112 00:10:42,000 --> 00:10:53,880 And so there are a large set of incentives, even if you think your crypto should be designed in a slightly different way, to at least support the FIPS standards such that you can attain this certification and then sell your devices. 113 00:10:53,880 --> 00:11:08,260 So if you look at all the biggest hardware device manufacturers in the world, so network devices, Juniper, Cisco, and the like, all of them do maintain FIPS supported modes in their products. 114 00:11:08,260 --> 00:11:12,760 Now I will say that just because FIPS is supported doesn't mean it's necessarily the default. 115 00:11:12,760 --> 00:11:15,740 With many devices you do have to switch the FIPS mode on. 116 00:11:15,740 --> 00:11:19,740 It is also available for software systems such as OpenSSL. 117 00:11:19,740 --> 00:11:36,400 This is a little iffy in terms of the way that the certification has worked historically because the documents are largely written for end-to-end systems such as integrated hardware devices, but OpenSSL did have them certified as a library for inclusion within other products. 118 00:11:37,220 --> 00:11:49,500 Now a couple of interesting things about having the FIPS mode turned on is when FIPS is turned on you're actually required to use the FIPS algorithms for every system function. 119 00:11:49,540 --> 00:11:58,220 So at this point it no longer becomes optional whether you use the FIPS random number generator, the FIPS approved random number generator, or the FIPS approved public key algorithm. 120 00:11:58,220 --> 00:12:00,400 You have to use it for everything. 121 00:12:00,900 --> 00:12:06,520 And here you can see the diagram of what one of the FIPS approved random number generators looked like. 122 00:12:06,520 --> 00:12:15,400 This is the ANSI X9.31 generator which was the earliest random number generator that I could find in a FIPS standard. 123 00:12:15,400 --> 00:12:17,140 And that's going to be where we begin our story. 124 00:12:17,140 --> 00:12:28,140 It might be a little hard to follow along with the size of the graphic for how this random number generator works, but I will try and describe it to the best of my ability over voice. 125 00:12:28,540 --> 00:12:39,220 So essentially the way that this random number generator works, and this is going to be our first candidate for NSA backdooring, is you feed in the time as the entropy. 126 00:12:39,260 --> 00:12:46,000 Every time you generate a random number, you mix that up by XORing it with the prior version of the state. 127 00:12:46,020 --> 00:12:51,660 How the state is initialized is left somewhat up to the implementation. 128 00:12:52,020 --> 00:12:54,880 And then you use a block cipher as a mixing function. 129 00:12:54,880 --> 00:13:01,520 So you feed the time into either DES and the earliest versions of the design I could find, or then AES later. 130 00:13:01,520 --> 00:13:04,500 You XOR it with the prior state, that gets you the new state. 131 00:13:04,500 --> 00:13:10,020 You do this again with another timestamp, and then you get the output of the random number generator. 132 00:13:10,380 --> 00:13:17,680 Now, for those of you keen-eyed individuals, you might have remembered that AES is in fact invertible under a given key. 133 00:13:17,740 --> 00:13:24,680 So if you know the key, and you know the output of the random number generator, you can run the whole thing backwards and get to the state. 134 00:13:24,680 --> 00:13:33,760 And then if you're able to guess the, you're able to, if you run it backwards, you can get the state XORed with the timestamp. 135 00:13:33,980 --> 00:13:39,520 Now, timestamps are somewhat guessable, they're relatively low entropy, especially on older systems. 136 00:13:39,520 --> 00:13:49,740 In fact, I think it was only in the last couple months that a number of distros moved to using 64-bit time for the system random number generators. 137 00:13:49,920 --> 00:13:56,780 And so if you're guessing a 32-bit timestamp that's relying on when the machine is turned on, you can run that actually pretty quickly. 138 00:13:56,780 --> 00:14:04,240 In my estimates of how much real entropy this has, it's about 2 to the 28, which is crackable on a standard laptop. 139 00:14:04,580 --> 00:14:18,380 So you reverse that, you invert the output from the random number generator that hopefully you've captured, you get the XOR of the timestamp and the state, you guess the timestamp, you've now recovered the state. 140 00:14:18,380 --> 00:14:27,840 If you can guess a second timestamp, you can then verify your guess by comparing it to the next output of the random number generator under a new timestamp. 141 00:14:28,700 --> 00:14:32,220 So how did this actually come to be a standard? 142 00:14:32,280 --> 00:14:45,940 Well, one of the really interesting things here, and this is going to be a repeated part of the story, is that before it became part of the federal information processing standards, someone, in this case John Kelsey, actually pointed out this particular flaw. 143 00:14:46,200 --> 00:14:54,040 And this pattern of, well, there's a potential flaw in the standard, but we're going to go ahead and standardize it anyway, is something that we see over and over. 144 00:14:54,140 --> 00:15:04,840 And even if it's not proof of backdooring, is a reason to be suspicious about the way that standardization is happening in and gives us substantial unease about the process. 145 00:15:04,840 --> 00:15:12,520 The only things that should get standardized are things for which there are no known significant public cryptographic concerns or weaknesses. 146 00:15:12,740 --> 00:15:22,960 So as early as 1998, this is a little tricky for me, squinting at it on the tiny screen, we'd known about the flaw. 147 00:15:23,140 --> 00:15:30,340 And then all the way up until 2016, this random number generator was actually part of the official government standard. 148 00:15:31,340 --> 00:15:50,480 So as I said before, if for some reason you're able to figure out the key that is used in this random number generator, then you can probably invert the whole process and guess the future outputs of the random number generator, allowing you to break whatever crypto system is relying on these random numbers. 149 00:15:50,800 --> 00:15:53,900 So what does the standard actually say about this key? 150 00:15:53,900 --> 00:15:55,480 It seems to be really important. 151 00:15:55,480 --> 00:15:58,140 If you know the key, you can break the random number generator. 152 00:15:58,160 --> 00:16:04,000 So reading directly from the standard, this is the entirety of what it said about the key. 153 00:16:04,080 --> 00:16:09,860 For AES 128-bit key, let star K be 128-bit key. 154 00:16:09,900 --> 00:16:10,580 Okay? 155 00:16:10,720 --> 00:16:15,900 This star K is reserved only for the generation of pseudo random numbers. 156 00:16:16,140 --> 00:16:20,040 That is the sum total of the guidance about the key. 157 00:16:20,120 --> 00:16:24,100 The standard did not specify that the key should not be hardcoded. 158 00:16:24,320 --> 00:16:33,980 And so, of course, the obvious thing to do is to go and look at all the places where this random number generator is used and see how many of them actually hardcoded the key. 159 00:16:34,500 --> 00:16:40,640 One of the other beautiful things about the cryptographic module validation program is that all the certificates are public. 160 00:16:40,640 --> 00:16:51,800 Every device that has been certified under the program has a listing of the name of the product and what algorithm they use, which makes it an obvious target now that we know that there might be hardcoded keys out there. 161 00:16:51,800 --> 00:17:05,520 So, I went out and went through all of the 300-odd certifications, went through every device, and reverse engineered all of them that were not explicitly clear in their documentation that the key was generated dynamically. 162 00:17:05,520 --> 00:17:09,820 If the key was generated dynamically, there are other attacks you could probably use to recover it. 163 00:17:09,820 --> 00:17:19,980 But at least for the low hanging fruit of the hardcoded ones, I was able to find 12 different certificates or devices that actually had hardcoded their key. 164 00:17:20,220 --> 00:17:22,920 And see if I can squint this. 165 00:17:22,920 --> 00:17:26,460 Here is some of the language that was used in the certification documents. 166 00:17:26,600 --> 00:17:34,140 The key is compiled into the binary, static key stored in the firmware, entered in the factory, loaded at factory, embedded in Flash. 167 00:17:34,300 --> 00:17:42,260 Now, unfortunately, I wasn't able to obtain many of the physical hardware devices that were actually under the certification program. 168 00:17:42,260 --> 00:17:44,300 I did get my hands on a few. 169 00:17:44,440 --> 00:17:55,520 One manufacturer that we contacted as part of the remediation process had actually lost the source code because they had acquired the vendor in a murder and acquisition. 170 00:17:55,940 --> 00:18:00,500 So they weren't actually able to tell us what their hardware was doing and they discontinued the product. 171 00:18:00,500 --> 00:18:02,100 So we weren't able to get a copy. 172 00:18:02,140 --> 00:18:09,960 However, I was able to get a copy of a device running Fortios V4 that was certified under this program. 173 00:18:09,960 --> 00:18:16,700 And at the time, this was the second largest network device operating system out there behind Juniper. 174 00:18:17,600 --> 00:18:20,600 So reverse engineered it and what did I find? 175 00:18:20,760 --> 00:18:25,080 There we are, a hard coded key for the random number generator. 176 00:18:25,480 --> 00:18:28,200 Now, something about this key struck me as familiar. 177 00:18:28,200 --> 00:18:32,920 You spend too much time staring at hexadecimal values and some of them just embed in your brain. 178 00:18:33,500 --> 00:18:41,300 I then went back to the test vectors for the ANSI X931 generator and that is the exact same key. 179 00:18:41,300 --> 00:18:47,040 So some poor cryptographic engineer had obviously pulled it right out of the standard without thinking. 180 00:18:47,040 --> 00:18:50,940 Now, naturally, this led to a pretty straightforward attack. 181 00:18:51,380 --> 00:19:04,420 So monitoring a TLS flow from a Fortios V4 device, we were able to see the server random being sent by one of these hardware devices to any client connecting. 182 00:19:04,420 --> 00:19:08,520 That server random has the raw output from the random number generator. 183 00:19:08,520 --> 00:19:24,180 We can then invert that under the key that we got from the firmware or the test vector and then use that with a guess of the time stamp and verifying it against the master secret from the TLS handshake to ensure that we actually have cracked this. 184 00:19:24,780 --> 00:19:27,400 So this took about how much was it? 185 00:19:27,400 --> 00:19:33,460 It was 2 to the 25 brute work under empirical observation in order to brute force the key. 186 00:19:33,880 --> 00:19:47,160 We were able to perform internet wide scans and find private keys against perform against hosts in the wild decrypting what would be passively TLS handshakes and then being able to decrypt all of the traffic. 187 00:19:47,580 --> 00:19:54,960 So after our contact with Fortios to let them know of the issue, they took it out of Fortios V5. 188 00:19:55,340 --> 00:19:59,700 So at this point, you're probably thinking, great, we've solved the problem. 189 00:19:59,700 --> 00:20:01,500 Fortios V5 is secure. 190 00:20:01,540 --> 00:20:01,860 Okay. 191 00:20:01,860 --> 00:20:04,000 Let's move to the next random number generator. 192 00:20:04,620 --> 00:20:10,780 So this is counter DRBG, which is the evolution of the ANSI X931 generator. 193 00:20:10,780 --> 00:20:12,940 You think, okay, there's that problem with the key. 194 00:20:12,940 --> 00:20:15,520 What if we make that key a bit more dynamic? 195 00:20:15,520 --> 00:20:17,800 What if we generate it at run time? 196 00:20:17,800 --> 00:20:23,340 Surely we will avoid all the pitfalls of the prior random number generator. 197 00:20:23,340 --> 00:20:31,020 So this one was standardized in a document known as special publication 890, which had a series of random number generators. 198 00:20:31,020 --> 00:20:34,280 And we'll talk about one more of them in this talk as well. 199 00:20:34,280 --> 00:20:38,560 This is the successor design to X931, and there are a couple of changes. 200 00:20:38,560 --> 00:20:43,900 So now instead of using the timestamp, we are encrypting and incrementing counters. 201 00:20:43,900 --> 00:20:48,060 So hopefully you can't just guess the value of the counter if it's initialized randomly. 202 00:20:48,600 --> 00:20:55,580 And this also added support for adding in additional entropy into the pseudo random number generator as time went. 203 00:20:55,580 --> 00:21:10,820 So this was optional in the standard, but if a manufacturer so chose, they could add in entropy from things like packet timings to further mix up with the state of the pseudo random number generator and prevent the kinds of attacks that we saw before. 204 00:21:11,560 --> 00:21:15,520 So this pseudo random number generator worked in a three-step process. 205 00:21:15,520 --> 00:21:29,100 Take the existing key and a counter, add one to the counter, add any additional entropy together, run that all through so concatenate them, run it through AES, and then you'll get out from it a new key and a new counter. 206 00:21:29,100 --> 00:21:33,020 So split the output into a portion for the key and the counter. 207 00:21:33,600 --> 00:21:53,500 Then again, increment the counter by one, concatenate it with the key, run it, sorry, not concatenate it, use the key, and run the counter through AES, and then you get the output from the random number generator itself that will be given to the client application. 208 00:21:53,980 --> 00:21:59,860 And then one more time, just to ensure that you've refreshed the state again after this process, repeat it. 209 00:21:59,860 --> 00:22:11,280 So this is just like step one, where under the key K, concatenate the counter plus one and the additional entropy, run that through AES, and you'll get a new key and a new counter. 210 00:22:11,280 --> 00:22:13,860 So the key is now being refreshed pretty frequently. 211 00:22:13,860 --> 00:22:16,480 There's an opportunity to add in additional entropy. 212 00:22:17,180 --> 00:22:18,540 We should be safe. 213 00:22:19,240 --> 00:22:22,140 There are two problems with this design. 214 00:22:22,160 --> 00:22:28,000 The first is that you can generate an arbitrary amount of output in the second step. 215 00:22:28,000 --> 00:22:36,240 What this means is that you can generate, say, 10 kilobytes of random data under the same key before the key is actually rotated. 216 00:22:36,240 --> 00:22:46,520 It's not that you generate one block of output under the key, generate as many blocks of output as you need under the same key and counter value, and only then do you refresh it. 217 00:22:46,660 --> 00:22:54,360 The second thing is that the additional entropy was totally optional and left up to implementers to decide what they wanted to do. 218 00:22:54,520 --> 00:23:04,440 And we know that implementers aren't always putting in as much work as they could into their cryptographic designs, and so many manufacturers that we found just didn't implement this whatsoever. 219 00:23:04,940 --> 00:23:07,040 So this leads to an attack. 220 00:23:07,040 --> 00:23:19,060 If you can generate a large enough amount of randomness, if you can convince a client application to generate a large amount of randomness in that second step, you might then be and see some of the raw output. 221 00:23:19,060 --> 00:23:21,000 You've still got this invertibility problem. 222 00:23:21,000 --> 00:23:28,980 You can recover the state, which is the counter value, and then it's all deterministic from there, unless there's additional entropy coming in. 223 00:23:28,980 --> 00:23:32,380 So no additional entropy, whole thing's deterministic once more. 224 00:23:34,340 --> 00:23:39,720 If there is additional entropy, of course, if you know how that's being generated, you might be able to guess it. 225 00:23:39,760 --> 00:23:43,120 Depending on how much it is, you can brute force it. 226 00:23:43,120 --> 00:23:44,240 Okay. 227 00:23:44,240 --> 00:23:54,280 So let's go back to our prior idea, which was go back to the CMVP, see who's using it, see how bad the implementations actually are, and then try and learn something from it. 228 00:23:54,280 --> 00:24:02,880 So we systematically reviewed all of or I systematically reviewed all of the CMVP certificates again, and what did I find? 229 00:24:02,880 --> 00:24:08,180 Fortios V5 had switched to using this pseudo random number generator. 230 00:24:08,440 --> 00:24:14,060 So I reverse engineered it as before and also used it to simulate a number of other targets. 231 00:24:14,060 --> 00:24:24,580 I didn't reverse all of them, because that would have taken more time than it was worth for the proof of concept, but I at least demonstrated that under the assumptions that those other products were using, they were also vulnerable. 232 00:24:25,160 --> 00:24:33,360 This time, in order to actually extract the key for AES during that second stage, I used a side channel attack. 233 00:24:33,360 --> 00:24:42,740 So perhaps this should make everyone a little more skeptical about whether the NSA was doing this at scale, but at least tells us something about the design. 234 00:24:42,900 --> 00:24:51,740 And using the attack, I was able to recover a long-term client ECDSA secrets that had been generated using this process. 235 00:24:53,440 --> 00:25:02,900 So cool attack, bro, but not necessarily what I was hoping for in terms of explaining wide-scale decryption capabilities of the NSA. 236 00:25:03,440 --> 00:25:14,820 It has, however, given us another bit of information about the standardization process, and that is the piece that I want to keep us focusing on long-term when we think about how large-scale decryption is actually happening. 237 00:25:15,980 --> 00:25:16,520 Okay. 238 00:25:16,540 --> 00:25:22,320 This story has been told quite a lot, and so I'm not going to belabor all the details. 239 00:25:22,320 --> 00:25:24,820 I'm not going to go through the actual implementation details. 240 00:25:24,820 --> 00:25:31,060 I'll just give you a little bit of the refresher to tweak that bit in your brain that's what's going on here with standardization. 241 00:25:31,960 --> 00:25:38,000 So, again, this is a proposal where problems were known about it relatively early on. 242 00:25:38,000 --> 00:25:59,020 In 2004, there was a draft proposal for inclusion into NIST SP890A, the same document as that last RNG that we just saw, and there was an early distinguishing attack by Schoenmaker and which showed that you could tell if the output, if a given string of output was actually from this random number generator or was truly random. 243 00:25:59,020 --> 00:26:03,240 You could distinguish between the two, and that's a big warning sign for pseudo-random number generators. 244 00:26:03,740 --> 00:26:20,520 In 2007, Dan Schumo and Niels Ferguson demonstrated that this could potentially be lead to a backdoor attack where if you knew the settings of particular curve points, you could use those curve points to run a passive TLS decryption attack. 245 00:26:22,440 --> 00:26:32,080 In 2013, the Snowden slides came out with specifically relating to Project Bull Run, and this is particularly interesting. 246 00:26:32,080 --> 00:26:41,800 I'll show the slide in a minute because it detailed or very lightly detailed that the NSA may actually have been concretely involved in the standardization process. 247 00:26:42,080 --> 00:26:43,820 So, is this the end of the story? 248 00:26:43,820 --> 00:27:03,680 It took until 2014 for this proposal to actually be removed from the standard, despite the fact that it had been concretely shown to be vulnerable, and then it was in 2015, years after the Snowden slides, years after this backdoor, where we actually found this inside Juniper Screen OS, 249 00:27:03,680 --> 00:27:12,160 which is their smaller product line, so this isn't their Junos, which is their larger network operating system, but we did find this deployed in the wild. 250 00:27:12,760 --> 00:27:20,200 Now, Junos is interesting because it didn't seem like they were actually using this random number from their documentation. 251 00:27:20,200 --> 00:27:27,320 It didn't seem like they were using this random number generator as the random number generator that would be used to produce the raw output. 252 00:27:27,320 --> 00:27:34,080 They were actually chaining it with NCX931, the first random number generator that we broke here. 253 00:27:34,080 --> 00:27:42,440 So, maybe even if there's a passive backdoor in the dual EC random number generator, they're fine because they weren't really using it anyway. 254 00:27:42,440 --> 00:27:44,960 They were just using it as input to another one. 255 00:27:45,800 --> 00:27:51,500 And further than that, they weren't using the potentially backdoored values in the NIST standard. 256 00:27:51,500 --> 00:27:55,260 They were using their own values for the points on the curve. 257 00:27:56,260 --> 00:27:58,740 So, let's rewind back a little bit. 258 00:27:58,740 --> 00:28:03,700 What did the NSA say in their leaked Snowden slides say that they had been doing? 259 00:28:03,720 --> 00:28:11,960 Insert vulnerabilities into commercial encryption systems, IT systems, networks, and endpoint communications devices used by targets. 260 00:28:11,960 --> 00:28:14,060 And then here's the more interesting bullet point. 261 00:28:14,060 --> 00:28:19,000 Influence policies, standards, and specifications for commercial public key cryptography. 262 00:28:20,140 --> 00:28:30,100 So, we did ‑‑ we, again, reverse engineered the ScreenOS code to find out what had been happening in different versions of ScreenOS and if it was actually vulnerable. 263 00:28:30,720 --> 00:28:40,620 So, here is a diff we did on a patch where Juniper announced that someone had gotten in in an unauthorized fashion into their code base and made some changes to their cryptography. 264 00:28:40,620 --> 00:28:53,180 One of the changes we found was that someone had actually changed the points on the curve that determine who has access to a potential passive backdoor from the dual EC random number generator. 265 00:28:54,140 --> 00:29:02,800 So, in theory, this still wouldn't be a problem because ScreenOS was only certified for use with ANSI X931 and not dual EC. 266 00:29:06,800 --> 00:29:26,560 So, in order to actually mount this attack, the same kind of thing as before, we would have to capture raw output from the random number generator and use now knowledge of the relationship between the two points in the standard or the two points used by the random number generator to reverse it. 267 00:29:26,560 --> 00:29:34,720 I'm not going to go over the details, but it turned out there were a number of particular implementation flaws as well that were present that made this viable. 268 00:29:34,940 --> 00:29:48,160 So, the first thing we found was that instead of actually being run through ANSI X931, the raw random number output from dual EC had mistakenly been exposed. 269 00:29:48,280 --> 00:30:02,400 On top of that, there was a choice for how many bytes you could use to produce the nonce and ScreenOS was producing more than enough bytes than were actually needed for the protocol which also led to our attack being much more efficient. 270 00:30:02,800 --> 00:30:04,660 So, this made us somewhat suspicious. 271 00:30:04,660 --> 00:30:13,740 We looked into the various different versions of ScreenOS that were released to figure out what unauthorized changes had been made to the code that kind of led to this. 272 00:30:13,900 --> 00:30:18,940 And we found that across versions, these flaws were subtly introduced over time. 273 00:30:18,960 --> 00:30:35,420 So, first, ANSI X931 was present and then in a later patch, dual EC was removed from the from the sorry, the ANSI X931 generator was removed from the chaining process to expose dual EC. 274 00:30:35,540 --> 00:30:46,000 So, over time, it looks like an adversary had a long-term plan for how to take a subtle cryptographic weakness into an actual passive TLS decryption attack. 275 00:30:46,000 --> 00:30:52,800 And we demonstrated this not in the wild because we didn't know the relationship between the two points that the NSA was using. 276 00:30:52,800 --> 00:30:53,720 That's the whole point of it. 277 00:30:53,720 --> 00:30:55,400 It should be a nobody but us backdoor. 278 00:30:55,400 --> 00:31:04,900 But by switching out those points ourselves on a target device that we purchased, we were able to show that at least this attack is viable. 279 00:31:04,980 --> 00:31:11,300 We did run scans against devices in the wild to look for ones that were vulnerable and were able to identify them. 280 00:31:11,860 --> 00:31:24,680 But it also seems that in some part, this probably wasn't actually as useful as maybe the NSA was hoping it would be because it never got deployed at the kind of scale where it would have been useful. 281 00:31:24,680 --> 00:31:33,540 But again, this is one more bit in the of trying to compromise standards as a technique of to subvert crypto at scale. 282 00:31:33,540 --> 00:31:41,320 Which, again, is the point of the talk rather than the particular individual bugs in the random number generators which are illustrative of this technique. 283 00:31:41,780 --> 00:31:50,560 So there was also some really good public reporting about how what had actually happened with the insertion of the bugs into ScreenOS. 284 00:31:50,680 --> 00:31:56,220 And this is what I think is kind of both surprising, interesting, and gives us a bit of a policy lesson. 285 00:31:56,520 --> 00:31:59,460 So it seems like, and I'll skip this to here. 286 00:31:59,460 --> 00:32:01,940 You're not going to be able to see it on that screen anyway. 287 00:32:02,140 --> 00:32:11,320 It seems like it wasn't actually the NSA that changed the value of the points that ScreenOS was using or that introduced the actual bugs. 288 00:32:11,340 --> 00:32:29,740 I have both had myself contact with individuals whom I trust who have told me that this was a Chinese APT, likely state sponsored, there's also public reporting which used different sources to back it up that suggests that this vulnerability was actually exploited by Chinese state sponsored hackers. 289 00:32:29,740 --> 00:32:32,480 I don't know the details of exactly who it was. 290 00:32:32,720 --> 00:32:44,560 But this is particularly fascinating as it shows us what was meant to be a nobody aspect or probably for the United States was repurposed by a foreign state adversary. 291 00:32:44,740 --> 00:32:47,420 I can give you one more small bit of information. 292 00:32:47,420 --> 00:32:51,900 Now, you might remember that I said it very early on that I used to work in the U.S. 293 00:32:51,900 --> 00:32:54,780 Senate as a cyber security fellow for U.S. 294 00:32:54,780 --> 00:32:57,040 Senator Ron Wyden in 2018. 295 00:32:57,120 --> 00:33:03,640 And I'll read you a little bit from the Bloomberg article that described their findings. 296 00:33:05,620 --> 00:33:10,400 In a July 2017, I'm going to have to read this from over here. 297 00:33:11,440 --> 00:33:21,940 In a July 2020 response to Wyden and other members of Congress, Juniper provided few new details of the case but blamed the intrusions on a sophisticated nation state hacking unit. 298 00:33:22,740 --> 00:33:29,120 NSA told Wyden's staff in 2018 that there was a lessons learned report. 299 00:33:29,180 --> 00:33:34,040 But the agency now asserts that it cannot locate the document. 300 00:33:34,580 --> 00:33:40,640 According to a Wyden aide, Reuters previously reported NSA's claim that the document had been lost. 301 00:33:40,760 --> 00:33:46,160 And to this date, as far as I know, no one has actually seen this document within the legislative branch. 302 00:33:46,160 --> 00:33:47,740 And I have asked around. 303 00:33:47,740 --> 00:33:50,180 So you can join your own dots there. 304 00:33:50,540 --> 00:33:54,100 So what is the big picture from all of this? 305 00:33:54,100 --> 00:34:07,660 The big takeaway is that standardization and accompanying certification processes are significant targets for state-level adversaries and that it is plausible that these are used for large-scale surveillance. 306 00:34:07,660 --> 00:34:17,440 So if we're trying to figure out what are the ingredients that go into building a large-scale decryption and interception program, this is likely one of the ingredients. 307 00:34:17,440 --> 00:34:26,040 We've got lots of different pieces from the NSA bull run slides to the empirical research that my team did to some of the follow-up journalism that's been done. 308 00:34:26,680 --> 00:34:30,420 So let's think back to and try and build a model around this. 309 00:34:30,420 --> 00:34:32,300 Let's go to supply chain attacks. 310 00:34:32,300 --> 00:34:34,920 Because this is starting to give some of that vibe. 311 00:34:34,920 --> 00:34:46,280 So traditionally, supply chain attacks are surreptitious actions that leverage the procurement and deployment process to get compromised devices into the hands of adversaries. 312 00:34:46,680 --> 00:34:53,120 And part of the idea here is that by the time it gets to the administrator actually deploying it, it should already be too late. 313 00:34:53,120 --> 00:34:57,960 Something in the supply chain has gone wrong and made the product vulnerable. 314 00:34:58,920 --> 00:35:03,560 This is the DOD's version of what a supply chain attack looks like. 315 00:35:03,560 --> 00:35:07,380 Again, you can download the slides after if you want to actually peek at it. 316 00:35:07,380 --> 00:35:07,980 And 317 00:35:11,080 --> 00:35:16,900 this is the NSA's version of what a supply chain attack looks like. 318 00:35:17,200 --> 00:35:30,520 What this is actually depicting is this is one of the leaked slogan slides showing the tailored access operations group intercepting Cisco network devices in the mail process, inserting implants and then sending them on. 319 00:35:30,520 --> 00:35:31,800 So that's great. 320 00:35:31,800 --> 00:35:34,520 But it's not quite what's happening here. 321 00:35:35,220 --> 00:35:39,980 That process targets only one phase of the whole product life cycle. 322 00:35:40,040 --> 00:35:45,780 For the most part, it targets once the implementation has already occurred, then you go in and insert something. 323 00:35:45,780 --> 00:35:46,700 That's where your spy is. 324 00:35:46,700 --> 00:35:50,500 But that's too unsophisticated for a state-level adversary. 325 00:35:51,160 --> 00:36:02,380 Instead, a state-level adversary can target a much larger portion of the product life cycle, going even before an individual firm starts to design their product. 326 00:36:03,020 --> 00:36:06,500 Now, let me look at my beautiful figure here, because I can't see it. 327 00:36:07,300 --> 00:36:30,800 So all the way back at the concept and design stage, the NSA is able to influence the way that firms go about designing their products initially, even before the engineers actually get to writing a line of code, by ensuring that they have certification and standardization requirements that impose on them in a particular way and that require them to build products that will have security flaws. 328 00:36:31,080 --> 00:36:36,020 So what I call this is a pre-supply chain operation, or a psycho for short. 329 00:36:36,020 --> 00:36:39,160 It is a broader version of the supply chain attack. 330 00:36:39,160 --> 00:36:47,360 Now, I think it is plausible to say, well, this is really just a fancy supply chain operation attack, but I needed some fancy mnemonic to give you to take away. 331 00:36:47,760 --> 00:36:50,420 So these are similar to supply chain operations. 332 00:36:50,420 --> 00:36:52,560 They're adversarial and surreptitious. 333 00:36:52,560 --> 00:37:02,560 But instead of corrupting the implementation phase, there's a greater focus on corrupting the design, standardization, and certification stages of the product. 334 00:37:03,080 --> 00:37:15,340 Now, if we want to actually go about doing these, this takes us a little further away from crypto qua crypto and a little closer to kind of the politics around product design. 335 00:37:15,460 --> 00:37:24,020 So there are a few ways that I identified that have potentially been used in the past, or that could potentially be used to conduct one of these attacks. 336 00:37:24,740 --> 00:37:33,560 The first is to actually create binding regulations that require people to implement products in certain ways. 337 00:37:33,660 --> 00:37:49,260 So one thing that you might do is rather than directly having a requirement such like you cannot, we'll talk about export restrictions in a second, but rather than putting a limit on key lengths, you might say you have to introduce support for these 30 different algorithms. 338 00:37:49,260 --> 00:37:56,720 And we know from the history of cryptography that the more algorithms you support, the more cryptographic agility you have, the more fragile your system becomes. 339 00:37:56,720 --> 00:38:03,320 If you introduce backwards compatibility, that also introduces the potential for downgrade attacks. 340 00:38:03,320 --> 00:38:16,050 So even without prescribing specific detailed product features, by creating a regulatory environment that introduces fragility, you can potentially encourage implementers surreptitiously to have products that are broken. 341 00:38:16,680 --> 00:38:20,080 The next is you can directly mandate design flaws. 342 00:38:20,080 --> 00:38:38,960 So we saw this with the capping of the DES key length at 56 bits, which seems likely, the reason that was likely done was to enable state level adversaries, particularly the NSA, to brute force the keys while still allowing a modicum of security for people in public who were using the algorithm. 343 00:38:40,220 --> 00:38:40,900 Julie C. 344 00:38:40,900 --> 00:38:42,920 was yet another different sort of technique. 345 00:38:42,920 --> 00:38:51,280 So that's going into a design and changing the standardization of parameters such that the choice of parameters are known to have a weakness. 346 00:38:51,300 --> 00:38:59,740 You could do this with things like Diffie-Hellman groups, which were used in the logjam attack, such that the choice of parameters admits a certain type of attack. 347 00:38:59,740 --> 00:39:02,800 There is a way to use the Julie C. 348 00:39:02,800 --> 00:39:07,940 random number generator with parameters that are verifiably what we call nothing up my sleeve. 349 00:39:07,940 --> 00:39:14,180 So you generate them using a hash of some innocuous phrase, and then everyone's relatively confident. 350 00:39:14,220 --> 00:39:20,240 But if you're able to instead hijack the process and choose the parameters yourselves, maybe you can introduce a backdoor. 351 00:39:21,240 --> 00:39:23,500 You can introduce intentional complexity. 352 00:39:23,500 --> 00:39:26,090 This kind of overlaps with the regulatory rollover. 353 00:39:26,940 --> 00:39:34,900 And then you can also make sure that you intentionally exclude things from the threat model of whatever standardization and certification you're using. 354 00:39:34,900 --> 00:39:48,300 So in this case, SP890A and FIPS 140-2 didn't include anything about side channels, which allowed me to actually perform the side channel attack because there was no hardening against any of the random number generators used there. 355 00:39:48,320 --> 00:40:05,680 So again, I think I'm not convinced that the NSA is using side channel attacks on a large scale, but this is still illustrative of the point that by excluding things from the threat model of the standardization process, you can make products weaker than they would be otherwise and use this as part of your nation state program. 356 00:40:06,820 --> 00:40:10,000 So does any of this actually apply to the real world? 357 00:40:10,000 --> 00:40:11,780 So I've built this lovely model. 358 00:40:11,780 --> 00:40:16,980 Are there any other types of attacks other than the random number generator ones for which this is vaguely plausible? 359 00:40:19,780 --> 00:40:28,360 So I'm going to race through a few recent examples of other standardization where this actually seems like it might have occurred. 360 00:40:28,960 --> 00:40:45,500 There was a family of lightweight ciphers called Simon and Speck, which had been pushed by the US in particular at the International Standards Organization, which is another standards body that probably doesn't hold quite as much weight as the FIPS standards in terms of actual implementations, 361 00:40:45,500 --> 00:40:48,280 but is still used by plenty of manufacturers. 362 00:40:49,040 --> 00:41:00,380 Ultimately, Simon and Speck were included in Linux, Android, and Android, but not for a very substantial period of time. 363 00:41:01,140 --> 00:41:03,660 There were a few things that were suspicious about the designs. 364 00:41:03,660 --> 00:41:06,260 There was no explanation of the parameter choices. 365 00:41:06,260 --> 00:41:13,020 The NSA design documents more were producing the design and not explaining how the design came to be. 366 00:41:13,020 --> 00:41:14,520 So this was a little fishy. 367 00:41:14,640 --> 00:41:23,920 There was a whole bunch of procedural weirdness that happened at the International Standards Organization that I think Tomer assured details in some of his works worth looking up. 368 00:41:24,700 --> 00:41:32,180 And as a result of Tomer and his team showing up at the ISO, they were actually able to prevent it being standardized. 369 00:41:32,340 --> 00:41:36,440 Had it not been for them, it seems likely like it would have gone through. 370 00:41:38,520 --> 00:41:42,060 So another thing that I mentioned briefly was export-grade cryptography. 371 00:41:42,060 --> 00:41:51,100 This seems like another pretty easy fit for this sort of threat model whereby it's not just about the adversaries who use the exported weaker cryptography. 372 00:41:51,100 --> 00:41:54,760 It's also about how you've changed the ecosystem as a result. 373 00:41:54,760 --> 00:42:05,240 TLS implementations were forced to support export-grade cryptography under the same protocol, which led to attacks such as the drown attack, which was something else that I worked on for a period of time. 374 00:42:06,360 --> 00:42:12,480 There are examples of other influences on parameter choices, even through the ITF. 375 00:42:12,480 --> 00:42:22,000 There is an RFC5114 that standardized a whole bunch of Diffie-Hellman groups. 376 00:42:22,000 --> 00:42:38,960 These were then used as part of the logjam attack, where the NSA presumably precomputed a portion of the computation needed to perform the number field sieve calculation to extract the discrete logs. 377 00:42:38,960 --> 00:42:53,860 If you're reusing the same Diffie-Hellman group over and over, and you're able to perform this partial computation, then you can complete the computation for any given handshake in a very short period of time, at least for 1024-bit groups. 378 00:42:53,900 --> 00:42:56,220 So there's another nice example there. 379 00:42:56,740 --> 00:43:05,780 And then combining this with an export downgrade attack, we were able to compromise 7% of the Alexa 1 million through the handshake. 380 00:43:05,780 --> 00:43:21,220 This is, again, probably another viable example of being able to actually use kind of this weird regulatory standardization process in order to achieve large-scale passive decryption as part of a state-level set of attacks. 381 00:43:23,000 --> 00:43:30,460 One other one, which is even more recent, this was Black Hat two years ago, was the Tetra radio encryption standard. 382 00:43:30,460 --> 00:43:34,560 There are a whole bunch of different sub-algorithms under the Tetra standard. 383 00:43:34,560 --> 00:43:39,160 The ones that were found to be flawed were TEA1 and TEA3. 384 00:43:39,200 --> 00:43:52,480 These are used for things like police radios for within enterprise deployments for real-world systems, oil rigs, that sort of thing, like SCADA. 385 00:43:53,320 --> 00:44:08,400 And there was a critical design flaw, again, introduced as part of the standardization process, which led to substantial weaknesses in the key strength reduction from what was meant to be 80 bits to something that was readily breakable on a laptop. 386 00:44:09,880 --> 00:44:12,620 So, putting it all together, we get this nice chart. 387 00:44:12,640 --> 00:44:13,700 Thank you. 388 00:44:13,720 --> 00:44:22,500 We get a really nice chart of, over the years, all the different attempts that I have been able to chart, at least, by which these techniques have actually been used. 389 00:44:22,520 --> 00:44:30,040 Now, in some of these instances, I remain unconvinced that this was an intentional malicious attempt to subvert the standard. 390 00:44:30,040 --> 00:44:36,100 However, some of these are still illustrative of what one might want to do were one to try and subvert a standard. 391 00:44:36,100 --> 00:44:45,840 And you can be sure that those on the other side to us who are trying to protect crypto are definitely taking those lessons to heart and are still trying to subvert the standards. 392 00:44:46,020 --> 00:44:57,740 This also leads to one interesting attack that I call the arsehole attack, which is standardization committees largely work by people being nice to each other and acting in good faith. 393 00:44:57,740 --> 00:45:05,600 And if someone is behaving intentionally like an arsehole, that'll put other people off and they may no longer take place in the standardization. 394 00:45:05,600 --> 00:45:08,980 Other people have the personality that that's just going to drive them further. 395 00:45:08,980 --> 00:45:17,920 But I think there is a substantial effect that is played by interpersonal dynamics on what actually comes out of these standardizations. 396 00:45:17,920 --> 00:45:25,120 And we know there's a long history of governments using this type of social engineering to modify policy. 397 00:45:25,120 --> 00:45:29,780 And so in this instance, I think we also have to apply that to crypto policy and design as well. 398 00:45:29,780 --> 00:45:42,220 So potentially have a deep think when you're involved in crypto standardization about kind of the rules for the road around conduct to make sure that those rules are actually facilitating a secure design process. 399 00:45:42,720 --> 00:45:45,900 Now, I'm going to wrap up in a couple of minutes for questions. 400 00:45:45,940 --> 00:45:49,800 But I have one or two more points to give you for a takeaway. 401 00:45:49,920 --> 00:45:57,720 Another thing is that the design of your standards organizations actually makes a difference to how easy they are to target. 402 00:45:58,100 --> 00:46:11,320 Something like the IETF, which prides itself on being very open and inclusive, is in a way the same version of Kirchhoff's principle, where not only is your code open, but your meetings are open. 403 00:46:11,320 --> 00:46:16,280 And this gives room for more people to scrutinize both the process and to participate. 404 00:46:16,680 --> 00:46:19,300 And this can actually be used to strengthen crypto. 405 00:46:19,460 --> 00:46:30,780 For something that's a lot more closed, such as prior iterations of some of the NIST process, they have since this research actually made some improvements, which I think are changing the way that standardization happens. 406 00:46:31,400 --> 00:46:36,000 So if you're a more closed process, that makes you more susceptible to these kinds of attacks. 407 00:46:36,000 --> 00:46:45,060 The ISO is a wonderful example of a process that I would not design, because for the large part, the representatives there represent countries rather than individuals. 408 00:46:45,060 --> 00:46:47,120 It is not an anyone-come-and-join. 409 00:46:47,120 --> 00:46:53,760 And it also requires long-term buy-in and long-term participation in order to actually remain part of the process. 410 00:46:53,760 --> 00:46:59,280 And so this kind of exclusionary factor actually can make the cryptography itself weaker in the long run. 411 00:46:59,280 --> 00:47:03,620 And this is very nearly what happened with Simon and Speck. 412 00:47:03,880 --> 00:47:15,260 The only nice thing there to say is that academic institutions give professors like me a lot of leeway to spend our time doing things that aren't always producing research papers, at least once you have tenure. 413 00:47:15,260 --> 00:47:18,700 And so we're in a rare place to try and be able to influence there. 414 00:47:18,980 --> 00:47:23,340 That said, we don't get any career rewards for saving the world from backdoored crypto. 415 00:47:23,340 --> 00:47:27,020 So there's only a limited amount of time that we can spend doing that. 416 00:47:27,400 --> 00:47:28,960 So some takeaway points. 417 00:47:28,960 --> 00:47:35,280 The first one, and this is what I like to hammer home more generally, is that standardization is not security. 418 00:47:35,280 --> 00:47:42,180 The fact that you're using a standardized algorithm does not mean that you don't have to apply any thought whatsoever to your crypto. 419 00:47:42,180 --> 00:47:46,460 You still have to work to ensure that your crypto implementations are robust. 420 00:47:46,460 --> 00:47:52,300 All of the attacks that we saw relied not just on broken standards, but also on broken implementations. 421 00:47:52,300 --> 00:47:57,020 So an implementation flaw combined with a broken standard led to the real world attack. 422 00:47:57,020 --> 00:48:00,880 That doesn't mean, like, it's somewhat understandable if you trust the standard. 423 00:48:00,880 --> 00:48:05,060 Not everyone has time or the ability to think through the standard themselves. 424 00:48:05,060 --> 00:48:11,320 But even so, if you're going to trust the standard, please still pay close attention to your implementations. 425 00:48:12,180 --> 00:48:15,020 And then the other thing is that certification is not an audit. 426 00:48:15,020 --> 00:48:27,140 Just because you've been approved by whatever the federal government's latest cryptographic module validation program is, that is not the same as having a bunch of crypto experts actually go through your code and actually think about it. 427 00:48:27,620 --> 00:48:32,480 So what have we learned about the way that the NSA actually breaks crypto? 428 00:48:32,540 --> 00:48:37,320 So there are the sexy things which I would like to imagine that the NSA has maybe done. 429 00:48:37,320 --> 00:48:43,560 An L of one-fourth algorithm for computing the discrete log for Diffie-Hellman mod p. 430 00:48:43,560 --> 00:48:44,300 That would be great. 431 00:48:44,300 --> 00:48:45,480 An algorithmic speed-up. 432 00:48:45,480 --> 00:48:46,680 They've got tons of mathematicians. 433 00:48:46,680 --> 00:48:48,140 Super cool, super sexy. 434 00:48:48,960 --> 00:48:56,460 I would love to imagine that they have some, like, secret side-channel attack thing that they're doing at scale somehow. 435 00:48:56,460 --> 00:49:00,200 That'd be really cool, but also probably a little less plausible. 436 00:49:00,460 --> 00:49:02,860 Some things that are more plausible, though. 437 00:49:02,940 --> 00:49:08,320 It seems unlikely that the old Diffie-Hellman attacks for pre-computation that I mentioned are still working. 438 00:49:08,800 --> 00:49:12,300 Some of these RNG attacks are now a bit older. 439 00:49:12,380 --> 00:49:15,140 And so they're likely not happening to the same extent. 440 00:49:15,140 --> 00:49:19,580 I do see the random number generators that are being deployed in the wild being much better. 441 00:49:19,600 --> 00:49:23,620 Linux has, in the last couple years, updated their one to be a lot more... 442 00:49:23,620 --> 00:49:29,880 There was a theoretical attack that I looked at a couple years ago that we weren't able to turn into an actual attack, but now that one's gone as well. 443 00:49:29,880 --> 00:49:36,200 So I think some of these attacks are becoming less plausible ways for the NSA to achieve their SIGINT goals. 444 00:49:36,580 --> 00:49:39,380 However, there's still a lot of value for them in the legacy attacks. 445 00:49:39,380 --> 00:49:45,880 There is a long tail of things on the internet that are still using legacy devices, downgrade attacks, all that kind of thing still viable. 446 00:49:46,560 --> 00:49:53,600 There's now a whole world of firmware attacks and ODAs that's still viable. 447 00:49:53,600 --> 00:49:55,240 So there's some of that still happening. 448 00:49:55,260 --> 00:50:03,480 Probably not on the kind of scale that one might imagine, but these regulatory attacks to undermine crypto is still happening. 449 00:50:03,480 --> 00:50:09,240 We're seeing this particularly in the EU with their attempts to mandate backdoors in cryptography. 450 00:50:09,240 --> 00:50:13,780 This happened in Australia with the access and assistance bill, and so we still have to keep our eyes open. 451 00:50:13,780 --> 00:50:20,440 The game is not over, and it seems likely that the NSA still has very substantial decryption capabilities. 452 00:50:21,160 --> 00:50:24,840 So one more slide on our takeaways. 453 00:50:25,160 --> 00:50:30,200 At the end of the day, our standards and certification are a target. 454 00:50:30,840 --> 00:50:35,280 Opaque vendor implementations of the standards are likewise a significant target. 455 00:50:35,280 --> 00:50:39,260 They get substantially less scrutiny, and that's where I found a lot of the problems. 456 00:50:39,440 --> 00:50:44,660 And then being an asshole could actually be an intentional strategy to undermine crypto. 457 00:50:45,400 --> 00:50:59,940 And then my final takeaway is that in practice what we saw, again, as I mentioned, is that actually breaking crypto at scale requires this beautiful intersection, beautiful in a tragic way, of both the standards corruption or standards problems with the algorithms, 458 00:50:59,940 --> 00:51:02,680 but then also substantial implementation flaws. 459 00:51:02,800 --> 00:51:05,900 Thank you very much, and I think we've got about four minutes for questions. 460 00:51:13,080 --> 00:51:14,280 Go for it. 461 00:51:15,800 --> 00:51:18,780 The slides will be posted to the DEF CON website. 462 00:51:18,780 --> 00:51:22,960 I'm not sure how that happens, but I can also post them to my own website. 463 00:51:22,960 --> 00:51:26,220 I can have that up later today, if you just put in my name. 464 00:51:29,440 --> 00:51:32,100 C-O-H-N-E-Y dot info. 465 00:51:32,100 --> 00:51:35,180 It's just a standard bio thing, but I'll put a link to the slides this afternoon. 466 00:51:36,980 --> 00:51:38,160 Anything else? 467 00:51:54,670 --> 00:51:57,910 So some of this research is getting a little bit longer in the tooth. 468 00:51:57,910 --> 00:52:06,470 I think it's interesting to consider in the context, but if you Google scholar my name, all the crypto papers are largely on this line of work. 469 00:52:06,710 --> 00:52:08,130 Same thing with the website. 470 00:52:08,250 --> 00:52:14,650 But I'm happy to update, try and get the DEF CON hacker tracker updated to as well include some of those in the references. 471 00:52:31,670 --> 00:52:37,250 Yeah, so I think for the most part we're feeling a lot more comfortable about the way that things have been done recently. 472 00:52:37,830 --> 00:52:39,690 So there's a mix of factors leading to this. 473 00:52:39,690 --> 00:52:51,110 Some of it is formally verified implementations, formal proofs of the protocols, which is different from formally verifying the implementations, and also changes to the way that standardization occurs. 474 00:52:51,490 --> 00:53:02,130 We have a couple of ideas on where there might be still some more problematic designs out there, whether backdoored or not, but so far nothing that we can really point to. 475 00:53:02,130 --> 00:53:06,270 Just some bad feelings at the back of our heads. 476 00:53:25,590 --> 00:53:28,250 Largely standardizing around 477 00:53:34,990 --> 00:53:43,490 , because that's now understood, it's easy to get guessbooks for it, not to start moving through the process. 478 00:53:43,830 --> 00:53:56,950 Is that something you've looked at yourself with your team, as far as the goodness of CPU jitter as an actual use case? 479 00:53:57,350 --> 00:54:11,050 So I think, like, if I had to build an RNG today, what I would first do is I'd use the CPU instruction to generate output, and then I'd run that output through a cryptographic RNG with CPU jitter, plus other sources of entropy. 480 00:54:11,350 --> 00:54:19,410 There's one in SP-890A that I still think is a pretty good design, HMAC-DRBG, which uses a hash function, so it's one way. 481 00:54:19,410 --> 00:54:20,090 And 482 00:54:35,760 --> 00:54:49,140 being able to serve, to validate the entropy source, if you rely on the CPU jitter, et cetera, it's a fast, pain in the ass process, practically, from a product development standpoint. 483 00:54:49,620 --> 00:54:52,200 But I understand that that is a... 484 00:54:52,200 --> 00:54:52,720 Yeah. 485 00:54:54,160 --> 00:54:56,800 Okay, thank you very much, everyone.