start	end	text
0	1680	Okay, we're going to get started.
1680	3180	AV will come at some point.
3180	5640	Until then, you get micro-figures.
5640	9320	I don't know if you can see anything there at all, but we'll do what we can.
9840	15640	So, I'm Sean Anconi, and I'm an academic researcher at the University of Melbourne.
15640	18500	I'm going to start with my long list of thank-yous.
18500	24720	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.
24720	28540	A team of researchers across the world at various different universities.
29280	36420	My particular journey, I've done a fairly standard academic thing, other than a few run-ins with the law during the process.
36640	38740	Some time in government, I worked in the U.S.
38740	42060	Senate, which also feeds into some of this talk, and then at the U.S.
42060	43020	Federal Trade Commission.
43020	46400	They're a little less involved in the kind of scary stuff.
46840	56680	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?
56680	58820	So, we've all got theories about how they do it.
58820	61600	Maybe it's implants, maybe it's fancy math.
61600	69620	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.
69700	80680	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.
80680	95080	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.
95080	109000	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.
109000	110720	So, how do they do that?
110880	112700	We could have a few guesses.
112700	126780	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.
127040	139840	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.
139840	144760	We think the security on those algorithms is pretty tight, so how are they actually doing it?
144760	148160	Maybe it's just a matter of getting compliance out into the wild.
148160	156780	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.
156780	163460	But it doesn't really explain the scale at which we think the NSA is able to do interception and decryption.
163800	168380	And then most recently on the internet I've seen a whole lot of AI mumbo-jumbo.
168380	172160	Perhaps the NSA is using LLMs to crack everything.
172160	175520	I think that one seems a little even more unlikely.
175600	177120	So what's the truth of it?
177120	179400	How are they actually doing this at scale?
179420	181940	The answer is probably some mix of these.
181940	188860	Having a large data center full of ASICs is likely quite helpful, but it isn't going to get you all the way there.
188860	203760	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.
203900	206820	So let's...
206820	207960	Oh, sure.
208820	209680	Okay.
210360	212580	So... oh my god, that's loud.
212840	214360	Maybe I'll go back here.
216760	231720	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.
231840	235720	So here we have our baby intro crypto 101 slide.
235720	240340	I know this is old news probably for many of you, but as we add a few more features.
240400	247140	So Alice wants to talk to Bob, and then we have our adversary who wants to intercept in the middle.
247140	252520	Maybe they have cut a transcontinental sub and are intercepting the traffic.
252520	254400	So right now, no encryption on this.
254400	254920	Great.
254920	258200	Eve can listen in and hear that Alice hates her.
259240	265060	Unfortunately, now Alice and Bob have decided to use cryptography and suddenly it's opaque to them.
265060	267400	This is the challenge that the NSA faces.
267520	271680	So what are the concrete cryptographic building blocks that they're going to use?
271680	275540	Well, they'll probably have a symmetric cipher under some key K.
275640	279340	As we know, that's not going to be enough to actually secure the communication.
279340	283680	Right now, this is susceptible to things like man in the middle attacks, replay attacks.
283680	287040	So we're going to need all these different pieces.
287260	289780	On there, we'll have a key exchange at the beginning.
289780	290880	Still not good.
290880	292920	Now we're going to need some kind of authentication.
292920	294880	So we're going to add a digital signature.
295020	298980	We're going to add nonces to ensure that replay attacks aren't possible.
299500	303420	And this involves randomness at a number of different stages.
303420	313160	And the security of the protocol critically is fundamentally reliant on the unguessability of these random values.
313160	318520	So for those of you who are familiar with random number generation, this will seem like fairly straightforward to you.
318520	321880	Well, of course, these random numbers aren't truly random.
321920	334680	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.
334680	347060	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.
347100	349700	So that's what a chunk of the talk is going to be about.
349920	361880	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?
361880	374140	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?
374780	375460	Okay.
375460	377280	So let's go back even a little further.
377280	378840	Back to the design of DES.
378840	386440	We have a standards organization which attempts to set what algorithms will be used and what their design is.
386440	392660	So earlier on, this was the National Bureau of Standards, which evolved into the National Institute of Standards and Technology.
392680	399020	And there's a cute little stick figure graphic online about the early standardization of DES due to Jeff Moser.
399020	401060	You can check that out online.
401760	404040	But this was quite a long time ago.
404040	411940	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?
412120	417760	Well, there's the well known Snowden slide that showed that the NSA did in fact have this capability.
417820	429740	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.
429740	437540	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.
437860	441700	And for the NSA, this resulted in a happy dance.
442480	451860	So what is the public cryptography community missing or what were they missing in around 2010 that actually led to this decryption happening?
451880	454180	Was there a big algorithmic breakthrough?
455540	458820	They're probably one of the largest hires of mathematicians in the world.
458820	466040	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?
466060	472120	Did they have an algorithm to calculate the discrete log of Diffie-Hellman faster than we think is possible?
472300	473040	Maybe.
473420	476980	Or is it something both a little more mundane and a little more sinister?
476980	479000	And we're going to talk about what that was.
479000	486060	So, again, as a refresher, we need in order to generate crypto keys, we need a good source of system randomness.
486280	490500	Not every crypto system is going to rely on randomness, but most will.
490500	496000	And so this is going to be the focus for today is those crypto systems that do need randomness.
496060	509640	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.
510240	523980	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.
523980	540740	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.
541100	552500	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.
552560	564520	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.
564520	569720	If you compromise the standard, you're going to compromise a large set of products.
569800	578300	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.
578880	581420	Now if you dive into U.S.
581420	587320	federal information security standards, a number of them are much larger than others.
587320	596780	Now the primary one of these is FIPS, the federal information processing standards, 140-X, where X is the series of the standard.
597000	600700	At the time of research, it was 140-2.
600700	609580	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.
609760	625760	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?
625760	630360	And with this certification, you then have approval for your products to be procured by the U.S.
630360	631380	federal government.
631380	641560	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.
641560	642000	government.
642000	653880	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.
653880	668260	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.
668260	672760	Now I will say that just because FIPS is supported doesn't mean it's necessarily the default.
672760	675740	With many devices you do have to switch the FIPS mode on.
675740	679740	It is also available for software systems such as OpenSSL.
679740	696400	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.
697220	709500	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.
709540	718220	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.
718220	720400	You have to use it for everything.
720900	726520	And here you can see the diagram of what one of the FIPS approved random number generators looked like.
726520	735400	This is the ANSI X9.31 generator which was the earliest random number generator that I could find in a FIPS standard.
735400	737140	And that's going to be where we begin our story.
737140	748140	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.
748540	759220	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.
759260	766000	Every time you generate a random number, you mix that up by XORing it with the prior version of the state.
766020	771660	How the state is initialized is left somewhat up to the implementation.
772020	774880	And then you use a block cipher as a mixing function.
774880	781520	So you feed the time into either DES and the earliest versions of the design I could find, or then AES later.
781520	784500	You XOR it with the prior state, that gets you the new state.
784500	790020	You do this again with another timestamp, and then you get the output of the random number generator.
790380	797680	Now, for those of you keen-eyed individuals, you might have remembered that AES is in fact invertible under a given key.
797740	804680	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.
804680	813760	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.
813980	819520	Now, timestamps are somewhat guessable, they're relatively low entropy, especially on older systems.
819520	829740	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.
829920	836780	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.
836780	844240	In my estimates of how much real entropy this has, it's about 2 to the 28, which is crackable on a standard laptop.
844580	858380	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.
858380	867840	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.
868700	872220	So how did this actually come to be a standard?
872280	885940	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.
886200	894040	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.
894140	904840	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.
904840	912520	The only things that should get standardized are things for which there are no known significant public cryptographic concerns or weaknesses.
912740	922960	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.
923140	930340	And then all the way up until 2016, this random number generator was actually part of the official government standard.
931340	950480	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.
950800	953900	So what does the standard actually say about this key?
953900	955480	It seems to be really important.
955480	958140	If you know the key, you can break the random number generator.
958160	964000	So reading directly from the standard, this is the entirety of what it said about the key.
964080	969860	For AES 128-bit key, let star K be 128-bit key.
969900	970580	Okay?
970720	975900	This star K is reserved only for the generation of pseudo random numbers.
976140	980040	That is the sum total of the guidance about the key.
980120	984100	The standard did not specify that the key should not be hardcoded.
984320	993980	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.
994500	1000640	One of the other beautiful things about the cryptographic module validation program is that all the certificates are public.
1000640	1011800	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.
1011800	1025520	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.
1025520	1029820	If the key was generated dynamically, there are other attacks you could probably use to recover it.
1029820	1039980	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.
1040220	1042920	And see if I can squint this.
1042920	1046460	Here is some of the language that was used in the certification documents.
1046600	1054140	The key is compiled into the binary, static key stored in the firmware, entered in the factory, loaded at factory, embedded in Flash.
1054300	1062260	Now, unfortunately, I wasn't able to obtain many of the physical hardware devices that were actually under the certification program.
1062260	1064300	I did get my hands on a few.
1064440	1075520	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.
1075940	1080500	So they weren't actually able to tell us what their hardware was doing and they discontinued the product.
1080500	1082100	So we weren't able to get a copy.
1082140	1089960	However, I was able to get a copy of a device running Fortios V4 that was certified under this program.
1089960	1096700	And at the time, this was the second largest network device operating system out there behind Juniper.
1097600	1100600	So reverse engineered it and what did I find?
1100760	1105080	There we are, a hard coded key for the random number generator.
1105480	1108200	Now, something about this key struck me as familiar.
1108200	1112920	You spend too much time staring at hexadecimal values and some of them just embed in your brain.
1113500	1121300	I then went back to the test vectors for the ANSI X931 generator and that is the exact same key.
1121300	1127040	So some poor cryptographic engineer had obviously pulled it right out of the standard without thinking.
1127040	1130940	Now, naturally, this led to a pretty straightforward attack.
1131380	1144420	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.
1144420	1148520	That server random has the raw output from the random number generator.
1148520	1164180	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.
1164780	1167400	So this took about how much was it?
1167400	1173460	It was 2 to the 25 brute work under empirical observation in order to brute force the key.
1173880	1187160	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.
1187580	1194960	So after our contact with Fortios to let them know of the issue, they took it out of Fortios V5.
1195340	1199700	So at this point, you're probably thinking, great, we've solved the problem.
1199700	1201500	Fortios V5 is secure.
1201540	1201860	Okay.
1201860	1204000	Let's move to the next random number generator.
1204620	1210780	So this is counter DRBG, which is the evolution of the ANSI X931 generator.
1210780	1212940	You think, okay, there's that problem with the key.
1212940	1215520	What if we make that key a bit more dynamic?
1215520	1217800	What if we generate it at run time?
1217800	1223340	Surely we will avoid all the pitfalls of the prior random number generator.
1223340	1231020	So this one was standardized in a document known as special publication 890, which had a series of random number generators.
1231020	1234280	And we'll talk about one more of them in this talk as well.
1234280	1238560	This is the successor design to X931, and there are a couple of changes.
1238560	1243900	So now instead of using the timestamp, we are encrypting and incrementing counters.
1243900	1248060	So hopefully you can't just guess the value of the counter if it's initialized randomly.
1248600	1255580	And this also added support for adding in additional entropy into the pseudo random number generator as time went.
1255580	1270820	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.
1271560	1275520	So this pseudo random number generator worked in a three-step process.
1275520	1289100	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.
1289100	1293020	So split the output into a portion for the key and the counter.
1293600	1313500	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.
1313980	1319860	And then one more time, just to ensure that you've refreshed the state again after this process, repeat it.
1319860	1331280	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.
1331280	1333860	So the key is now being refreshed pretty frequently.
1333860	1336480	There's an opportunity to add in additional entropy.
1337180	1338540	We should be safe.
1339240	1342140	There are two problems with this design.
1342160	1348000	The first is that you can generate an arbitrary amount of output in the second step.
1348000	1356240	What this means is that you can generate, say, 10 kilobytes of random data under the same key before the key is actually rotated.
1356240	1366520	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.
1366660	1374360	The second thing is that the additional entropy was totally optional and left up to implementers to decide what they wanted to do.
1374520	1384440	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.
1384940	1387040	So this leads to an attack.
1387040	1399060	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.
1399060	1401000	You've still got this invertibility problem.
1401000	1408980	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.
1408980	1412380	So no additional entropy, whole thing's deterministic once more.
1414340	1419720	If there is additional entropy, of course, if you know how that's being generated, you might be able to guess it.
1419760	1423120	Depending on how much it is, you can brute force it.
1423120	1424240	Okay.
1424240	1434280	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.
1434280	1442880	So we systematically reviewed all of or I systematically reviewed all of the CMVP certificates again, and what did I find?
1442880	1448180	Fortios V5 had switched to using this pseudo random number generator.
1448440	1454060	So I reverse engineered it as before and also used it to simulate a number of other targets.
1454060	1464580	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.
1465160	1473360	This time, in order to actually extract the key for AES during that second stage, I used a side channel attack.
1473360	1482740	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.
1482900	1491740	And using the attack, I was able to recover a long-term client ECDSA secrets that had been generated using this process.
1493440	1502900	So cool attack, bro, but not necessarily what I was hoping for in terms of explaining wide-scale decryption capabilities of the NSA.
1503440	1514820	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.
1515980	1516520	Okay.
1516540	1522320	This story has been told quite a lot, and so I'm not going to belabor all the details.
1522320	1524820	I'm not going to go through the actual implementation details.
1524820	1531060	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.
1531960	1538000	So, again, this is a proposal where problems were known about it relatively early on.
1538000	1559020	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.
1559020	1563240	You could distinguish between the two, and that's a big warning sign for pseudo-random number generators.
1563740	1580520	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.
1582440	1592080	In 2013, the Snowden slides came out with specifically relating to Project Bull Run, and this is particularly interesting.
1592080	1601800	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.
1602080	1603820	So, is this the end of the story?
1603820	1623680	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,
1623680	1632160	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.
1632760	1640200	Now, Junos is interesting because it didn't seem like they were actually using this random number from their documentation.
1640200	1647320	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.
1647320	1654080	They were actually chaining it with NCX931, the first random number generator that we broke here.
1654080	1662440	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.
1662440	1664960	They were just using it as input to another one.
1665800	1671500	And further than that, they weren't using the potentially backdoored values in the NIST standard.
1671500	1675260	They were using their own values for the points on the curve.
1676260	1678740	So, let's rewind back a little bit.
1678740	1683700	What did the NSA say in their leaked Snowden slides say that they had been doing?
1683720	1691960	Insert vulnerabilities into commercial encryption systems, IT systems, networks, and endpoint communications devices used by targets.
1691960	1694060	And then here's the more interesting bullet point.
1694060	1699000	Influence policies, standards, and specifications for commercial public key cryptography.
1700140	1710100	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.
1710720	1720620	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.
1720620	1733180	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.
1734140	1742800	So, in theory, this still wouldn't be a problem because ScreenOS was only certified for use with ANSI X931 and not dual EC.
1746800	1766560	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.
1766560	1774720	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.
1774940	1788160	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.
1788280	1802400	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.
1802800	1804660	So, this made us somewhat suspicious.
1804660	1813740	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.
1813900	1818940	And we found that across versions, these flaws were subtly introduced over time.
1818960	1835420	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.
1835540	1846000	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.
1846000	1852800	And we demonstrated this not in the wild because we didn't know the relationship between the two points that the NSA was using.
1852800	1853720	That's the whole point of it.
1853720	1855400	It should be a nobody but us backdoor.
1855400	1864900	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.
1864980	1871300	We did run scans against devices in the wild to look for ones that were vulnerable and were able to identify them.
1871860	1884680	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.
1884680	1893540	But again, this is one more bit in the of trying to compromise standards as a technique of to subvert crypto at scale.
1893540	1901320	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.
1901780	1910560	So there was also some really good public reporting about how what had actually happened with the insertion of the bugs into ScreenOS.
1910680	1916220	And this is what I think is kind of both surprising, interesting, and gives us a bit of a policy lesson.
1916520	1919460	So it seems like, and I'll skip this to here.
1919460	1921940	You're not going to be able to see it on that screen anyway.
1922140	1931320	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.
1931340	1949740	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.
1949740	1952480	I don't know the details of exactly who it was.
1952720	1964560	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.
1964740	1967420	I can give you one more small bit of information.
1967420	1971900	Now, you might remember that I said it very early on that I used to work in the U.S.
1971900	1974780	Senate as a cyber security fellow for U.S.
1974780	1977040	Senator Ron Wyden in 2018.
1977120	1983640	And I'll read you a little bit from the Bloomberg article that described their findings.
1985620	1990400	In a July 2017, I'm going to have to read this from over here.
1991440	2001940	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.
2002740	2009120	NSA told Wyden's staff in 2018 that there was a lessons learned report.
2009180	2014040	But the agency now asserts that it cannot locate the document.
2014580	2020640	According to a Wyden aide, Reuters previously reported NSA's claim that the document had been lost.
2020760	2026160	And to this date, as far as I know, no one has actually seen this document within the legislative branch.
2026160	2027740	And I have asked around.
2027740	2030180	So you can join your own dots there.
2030540	2034100	So what is the big picture from all of this?
2034100	2047660	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.
2047660	2057440	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.
2057440	2066040	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.
2066680	2070420	So let's think back to and try and build a model around this.
2070420	2072300	Let's go to supply chain attacks.
2072300	2074920	Because this is starting to give some of that vibe.
2074920	2086280	So traditionally, supply chain attacks are surreptitious actions that leverage the procurement and deployment process to get compromised devices into the hands of adversaries.
2086680	2093120	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.
2093120	2097960	Something in the supply chain has gone wrong and made the product vulnerable.
2098920	2103560	This is the DOD's version of what a supply chain attack looks like.
2103560	2107380	Again, you can download the slides after if you want to actually peek at it.
2107380	2107980	And
2111080	2116900	this is the NSA's version of what a supply chain attack looks like.
2117200	2130520	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.
2130520	2131800	So that's great.
2131800	2134520	But it's not quite what's happening here.
2135220	2139980	That process targets only one phase of the whole product life cycle.
2140040	2145780	For the most part, it targets once the implementation has already occurred, then you go in and insert something.
2145780	2146700	That's where your spy is.
2146700	2150500	But that's too unsophisticated for a state-level adversary.
2151160	2162380	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.
2163020	2166500	Now, let me look at my beautiful figure here, because I can't see it.
2167300	2190800	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.
2191080	2196020	So what I call this is a pre-supply chain operation, or a psycho for short.
2196020	2199160	It is a broader version of the supply chain attack.
2199160	2207360	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.
2207760	2210420	So these are similar to supply chain operations.
2210420	2212560	They're adversarial and surreptitious.
2212560	2222560	But instead of corrupting the implementation phase, there's a greater focus on corrupting the design, standardization, and certification stages of the product.
2223080	2235340	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.
2235460	2244020	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.
2244740	2253560	The first is to actually create binding regulations that require people to implement products in certain ways.
2253660	2269260	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.
2269260	2276720	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.
2276720	2283320	If you introduce backwards compatibility, that also introduces the potential for downgrade attacks.
2283320	2296050	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.
2296680	2300080	The next is you can directly mandate design flaws.
2300080	2318960	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.
2320220	2320900	Julie C.
2320900	2322920	was yet another different sort of technique.
2322920	2331280	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.
2331300	2339740	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.
2339740	2342800	There is a way to use the Julie C.
2342800	2347940	random number generator with parameters that are verifiably what we call nothing up my sleeve.
2347940	2354180	So you generate them using a hash of some innocuous phrase, and then everyone's relatively confident.
2354220	2360240	But if you're able to instead hijack the process and choose the parameters yourselves, maybe you can introduce a backdoor.
2361240	2363500	You can introduce intentional complexity.
2363500	2366090	This kind of overlaps with the regulatory rollover.
2366940	2374900	And then you can also make sure that you intentionally exclude things from the threat model of whatever standardization and certification you're using.
2374900	2388300	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.
2388320	2405680	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.
2406820	2410000	So does any of this actually apply to the real world?
2410000	2411780	So I've built this lovely model.
2411780	2416980	Are there any other types of attacks other than the random number generator ones for which this is vaguely plausible?
2419780	2428360	So I'm going to race through a few recent examples of other standardization where this actually seems like it might have occurred.
2428960	2445500	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,
2445500	2448280	but is still used by plenty of manufacturers.
2449040	2460380	Ultimately, Simon and Speck were included in Linux, Android, and Android, but not for a very substantial period of time.
2461140	2463660	There were a few things that were suspicious about the designs.
2463660	2466260	There was no explanation of the parameter choices.
2466260	2473020	The NSA design documents more were producing the design and not explaining how the design came to be.
2473020	2474520	So this was a little fishy.
2474640	2483920	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.
2484700	2492180	And as a result of Tomer and his team showing up at the ISO, they were actually able to prevent it being standardized.
2492340	2496440	Had it not been for them, it seems likely like it would have gone through.
2498520	2502060	So another thing that I mentioned briefly was export-grade cryptography.
2502060	2511100	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.
2511100	2514760	It's also about how you've changed the ecosystem as a result.
2514760	2525240	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.
2526360	2532480	There are examples of other influences on parameter choices, even through the ITF.
2532480	2542000	There is an RFC5114 that standardized a whole bunch of Diffie-Hellman groups.
2542000	2558960	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.
2558960	2573860	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.
2573900	2576220	So there's another nice example there.
2576740	2585780	And then combining this with an export downgrade attack, we were able to compromise 7% of the Alexa 1 million through the handshake.
2585780	2601220	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.
2603000	2610460	One other one, which is even more recent, this was Black Hat two years ago, was the Tetra radio encryption standard.
2610460	2614560	There are a whole bunch of different sub-algorithms under the Tetra standard.
2614560	2619160	The ones that were found to be flawed were TEA1 and TEA3.
2619200	2632480	These are used for things like police radios for within enterprise deployments for real-world systems, oil rigs, that sort of thing, like SCADA.
2633320	2648400	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.
2649880	2652620	So, putting it all together, we get this nice chart.
2652640	2653700	Thank you.
2653720	2662500	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.
2662520	2670040	Now, in some of these instances, I remain unconvinced that this was an intentional malicious attempt to subvert the standard.
2670040	2676100	However, some of these are still illustrative of what one might want to do were one to try and subvert a standard.
2676100	2685840	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.
2686020	2697740	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.
2697740	2705600	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.
2705600	2708980	Other people have the personality that that's just going to drive them further.
2708980	2717920	But I think there is a substantial effect that is played by interpersonal dynamics on what actually comes out of these standardizations.
2717920	2725120	And we know there's a long history of governments using this type of social engineering to modify policy.
2725120	2729780	And so in this instance, I think we also have to apply that to crypto policy and design as well.
2729780	2742220	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.
2742720	2745900	Now, I'm going to wrap up in a couple of minutes for questions.
2745940	2749800	But I have one or two more points to give you for a takeaway.
2749920	2757720	Another thing is that the design of your standards organizations actually makes a difference to how easy they are to target.
2758100	2771320	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.
2771320	2776280	And this gives room for more people to scrutinize both the process and to participate.
2776680	2779300	And this can actually be used to strengthen crypto.
2779460	2790780	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.
2791400	2796000	So if you're a more closed process, that makes you more susceptible to these kinds of attacks.
2796000	2805060	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.
2805060	2807120	It is not an anyone-come-and-join.
2807120	2813760	And it also requires long-term buy-in and long-term participation in order to actually remain part of the process.
2813760	2819280	And so this kind of exclusionary factor actually can make the cryptography itself weaker in the long run.
2819280	2823620	And this is very nearly what happened with Simon and Speck.
2823880	2835260	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.
2835260	2838700	And so we're in a rare place to try and be able to influence there.
2838980	2843340	That said, we don't get any career rewards for saving the world from backdoored crypto.
2843340	2847020	So there's only a limited amount of time that we can spend doing that.
2847400	2848960	So some takeaway points.
2848960	2855280	The first one, and this is what I like to hammer home more generally, is that standardization is not security.
2855280	2862180	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.
2862180	2866460	You still have to work to ensure that your crypto implementations are robust.
2866460	2872300	All of the attacks that we saw relied not just on broken standards, but also on broken implementations.
2872300	2877020	So an implementation flaw combined with a broken standard led to the real world attack.
2877020	2880880	That doesn't mean, like, it's somewhat understandable if you trust the standard.
2880880	2885060	Not everyone has time or the ability to think through the standard themselves.
2885060	2891320	But even so, if you're going to trust the standard, please still pay close attention to your implementations.
2892180	2895020	And then the other thing is that certification is not an audit.
2895020	2907140	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.
2907620	2912480	So what have we learned about the way that the NSA actually breaks crypto?
2912540	2917320	So there are the sexy things which I would like to imagine that the NSA has maybe done.
2917320	2923560	An L of one-fourth algorithm for computing the discrete log for Diffie-Hellman mod p.
2923560	2924300	That would be great.
2924300	2925480	An algorithmic speed-up.
2925480	2926680	They've got tons of mathematicians.
2926680	2928140	Super cool, super sexy.
2928960	2936460	I would love to imagine that they have some, like, secret side-channel attack thing that they're doing at scale somehow.
2936460	2940200	That'd be really cool, but also probably a little less plausible.
2940460	2942860	Some things that are more plausible, though.
2942940	2948320	It seems unlikely that the old Diffie-Hellman attacks for pre-computation that I mentioned are still working.
2948800	2952300	Some of these RNG attacks are now a bit older.
2952380	2955140	And so they're likely not happening to the same extent.
2955140	2959580	I do see the random number generators that are being deployed in the wild being much better.
2959600	2963620	Linux has, in the last couple years, updated their one to be a lot more...
2963620	2969880	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.
2969880	2976200	So I think some of these attacks are becoming less plausible ways for the NSA to achieve their SIGINT goals.
2976580	2979380	However, there's still a lot of value for them in the legacy attacks.
2979380	2985880	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.
2986560	2993600	There's now a whole world of firmware attacks and ODAs that's still viable.
2993600	2995240	So there's some of that still happening.
2995260	3003480	Probably not on the kind of scale that one might imagine, but these regulatory attacks to undermine crypto is still happening.
3003480	3009240	We're seeing this particularly in the EU with their attempts to mandate backdoors in cryptography.
3009240	3013780	This happened in Australia with the access and assistance bill, and so we still have to keep our eyes open.
3013780	3020440	The game is not over, and it seems likely that the NSA still has very substantial decryption capabilities.
3021160	3024840	So one more slide on our takeaways.
3025160	3030200	At the end of the day, our standards and certification are a target.
3030840	3035280	Opaque vendor implementations of the standards are likewise a significant target.
3035280	3039260	They get substantially less scrutiny, and that's where I found a lot of the problems.
3039440	3044660	And then being an asshole could actually be an intentional strategy to undermine crypto.
3045400	3059940	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,
3059940	3062680	but then also substantial implementation flaws.
3062800	3065900	Thank you very much, and I think we've got about four minutes for questions.
3073080	3074280	Go for it.
3075800	3078780	The slides will be posted to the DEF CON website.
3078780	3082960	I'm not sure how that happens, but I can also post them to my own website.
3082960	3086220	I can have that up later today, if you just put in my name.
3089440	3092100	C-O-H-N-E-Y dot info.
3092100	3095180	It's just a standard bio thing, but I'll put a link to the slides this afternoon.
3096980	3098160	Anything else?
3114670	3117910	So some of this research is getting a little bit longer in the tooth.
3117910	3126470	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.
3126710	3128130	Same thing with the website.
3128250	3134650	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.
3151670	3157250	Yeah, so I think for the most part we're feeling a lot more comfortable about the way that things have been done recently.
3157830	3159690	So there's a mix of factors leading to this.
3159690	3171110	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.
3171490	3182130	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.
3182130	3186270	Just some bad feelings at the back of our heads.
3205590	3208250	Largely standardizing around
3214990	3223490	, because that's now understood, it's easy to get guessbooks for it, not to start moving through the process.
3223830	3236950	Is that something you've looked at yourself with your team, as far as the goodness of CPU jitter as an actual use case?
3237350	3251050	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.
3251350	3259410	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.
3259410	3260090	And
3275760	3289140	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.
3289620	3292200	But I understand that that is a...
3292200	3292720	Yeah.
3294160	3296800	Okay, thank you very much, everyone.
