[00:00.000 --> 00:08.680] DEF CON, I missed you. Wow. So, show of hands, how many people [00:08.680 --> 00:14.460] are here for their absolute very first DEF CON? Thank you. [00:16.680 --> 00:21.940] You know, I've been doing DEF CON for a long time. This is [00:21.940 --> 00:26.400] about my 15th year. And I've watched it grow up. I've watched [00:26.400 --> 00:31.020] it grow from a tiny little thing at the Alexis Park to we've kind [00:31.020 --> 00:35.640] of overfilled the Rio. And the one thing that amazes me is just [00:35.640 --> 00:40.520] like, wow, people are just here having incredible amounts of [00:40.520 --> 00:48.560] just fun and joy. And you guys see this iHackPineapples guy? [00:49.100 --> 00:55.800] I don't know who you are, but you're my freaking hero. Basically [00:55.800 --> 00:57.920] this guy is like, you're going to come to DEF CON, you're going [00:57.920 --> 01:00.740] to hijack the Wi-Fi. Yeah, I'm going to take that really crappy [01:00.740 --> 01:02.700] piece of gear you bought and I'm going to break it. And if you're [01:02.700 --> 01:08.260] late, you can fix it. And if not, go get a refund. So, awesome. [01:08.640 --> 01:12.160] So what am I here to talk to you about? So I have a little bit of [01:12.260 --> 01:15.700] a tradition when it comes to my DEF CON talk. I never actually [01:15.700 --> 01:19.260] tell people what I'm going to talk about. Sorry. I don't know [01:19.260 --> 01:22.460] what I'm going to talk about. The subjects of my talk is a [01:22.460 --> 01:30.480] decent random number generator. So my talks are weird for DEF [01:30.480 --> 01:34.920] CON. Because, you know, we're hackers. We like to break [01:34.920 --> 01:41.840] things. But that's not really just what I do here. I like to [01:41.840 --> 01:46.680] show what's possible. And I like to show, hey, we can scan the [01:46.680 --> 01:50.460] entire Internet in a series of seconds. We can bust people who [01:50.460 --> 01:53.420] are doing violations of network neutrality. There's a few funny [01:53.420 --> 01:58.700] things we can do over DNS. Actually it was great. I once [01:58.700 --> 02:03.260] had like Darth Vader dancing on stage video streaming over DNS. [02:03.260 --> 02:06.040] Somebody told me you couldn't get high bandwidth over DNS. [02:06.040 --> 02:11.540] Somebody was wrong. But this is not the same thing. It's just [02:11.540 --> 02:18.880] showing what can be broken. So let's talk about why, what we're [02:18.880 --> 02:21.180] going to talk about today. Because we're going to be here [02:21.180 --> 02:23.660] for a few hours and you should have some idea that maybe [02:23.660 --> 02:26.600] there will be something you're interested in. We have a bunch [02:26.600 --> 02:30.140] of subjects. We are actually going to talk about why random [02:30.140 --> 02:35.000] number generation keeps getting things owned year after year. [02:35.160 --> 02:38.720] Have kind of a quote which is I would like to not be fixing the [02:38.720 --> 02:42.620] same bugs 15 years from now. I'd like to be fixing new bugs. But [02:42.620 --> 02:47.280] that would require dealing with the existing stuff. I want to [02:47.280 --> 02:50.520] talk about how we're sort of expecting users to recognize [02:50.520 --> 02:56.080] these huge strings of hex and it's bullshit. I want to talk [02:56.080 --> 03:00.040] about browser road day. There's a ton of vulnerabilities that [03:00.040 --> 03:02.780] are undiscovered and they all kind of follow the same form [03:02.780 --> 03:05.760] and we have to start dealing with them. I want to talk about [03:05.760 --> 03:10.200] DDoS. We really are getting distributed denial of service [03:10.200 --> 03:13.720] attacks that are scaling at a level where really it's an open [03:13.720 --> 03:18.720] question if the internet is going to keep working. So how [03:18.720 --> 03:24.720] much did the NSA shit the bed anyway? But before any of that, [03:24.720 --> 03:29.400] I want to talk about why hackers are useful. And I want to do [03:29.400 --> 03:34.880] that by discussing of all things, hard drives. So let me [03:34.880 --> 03:39.600] give you a scenario. An attacker has compromised a system and [03:39.600 --> 03:44.260] put something malicious on the hard drive. How bad could it be? [03:44.340 --> 03:48.040] What could possibly go wrong? Well, you know, they might have [03:48.040 --> 03:50.500] put in like an auto-launching daemon. You boot up your [03:50.500 --> 03:53.200] machine, it's got a root kit. You might have replaced some [03:53.200 --> 03:56.320] core operating system files. Maybe they got really, really [03:56.320 --> 03:59.720] clever and they like hit the master boot records. The first [03:59.720 --> 04:02.380] thing the computer does right when it turns on is load some [04:02.380 --> 04:06.260] piece of malware. And in all of these cases it sucks but at [04:06.260 --> 04:09.820] least you can like format the hard drive, the bad guy is gone, [04:09.820 --> 04:16.280] they are destroyed, right? Well, this funny thing happens when [04:16.280 --> 04:20.440] you start researching hard drives. So a little bit of a [04:20.440 --> 04:27.380] joke. What is the difference between a hard drive and a brick? [04:27.380 --> 04:31.840] The answer to this question is, given sufficient research, there [04:31.840 --> 04:37.720] is no difference. Never in my life have I done more expensive [04:37.720 --> 04:42.900] research. There goes 75 bucks. There it is gone again. See, [04:43.440 --> 04:49.540] here's the deal. In theory, a hard drive is a thing you put [04:49.540 --> 04:55.680] data on. Bits go in, bits come out, the bits stay the same. In [04:55.680 --> 05:02.340] reality, we have what I like to call exhibits iron law of [05:02.340 --> 05:08.100] computer architecture. Yo dog, I heard you like computers. So I [05:08.100 --> 05:11.780] put a computer in your computer so you can compute while you [05:11.780 --> 05:23.930] compute. Now what is great about this iron law is that the more [05:23.930 --> 05:28.910] you understand about computer architecture, the truer it gets. [05:28.910 --> 05:32.470] Pretty much everything that runs automatically is another little [05:32.470 --> 05:35.110] computer that is running on its own cycle that is going and [05:35.110 --> 05:40.730] doing stuff. And of course, it's doing it fast, it's doing it [05:40.730 --> 05:45.570] trusted, it's doing it insecurely. The reality is, is [05:45.570 --> 05:50.330] that everything in your computer has become very generic. Your [05:50.330 --> 05:57.250] iPhone has seven ARM chips. The biggest lie about a computer is [05:57.250 --> 06:03.090] that it's just one. Okay? Every device you have ever owned is a [06:03.090 --> 06:08.570] small network of mutually trusting, overly mutually [06:08.570 --> 06:12.970] trusting devices. A hard drive is really just another computer [06:12.970 --> 06:15.590] with direct access to your system memory via specially [06:16.150 --> 06:19.750] designed physical and logical protocols. Now maybe you doubt [06:19.750 --> 06:22.710] me. Maybe you think, oh, come on, Dan, you might be [06:22.710 --> 06:25.470] exaggerating. So let me actually show you what happens when you [06:25.470 --> 06:30.250] log into your hard drive. I did this project with Travis [06:30.250 --> 06:33.350] Goodspeed, probably the single most entertaining hardware hacker [06:33.350 --> 06:36.990] in the world. He's the guy behind POC, GTFO, proof of [06:36.990 --> 06:43.030] concept. Get the fuck out. And so we sit down one day, we buy a [06:43.030 --> 06:46.250] huge stack of hard drives and it turns out on the back of them [06:46.990 --> 06:50.050] there's a serial port. What happens when you go into the [06:50.050 --> 06:53.370] serial port? Well, you know, there's like an entire shell. It [06:53.370 --> 06:56.750] has like documentation. It actually tells you what your [06:56.750 --> 07:00.650] commands are. Oh, really, edit processor memory. And here are [07:00.650 --> 07:04.250] my arguments that I need to know for that. Sweet. You get some [07:04.250 --> 07:07.330] internal drive metadata. Like there's no hacking here. It's [07:07.330 --> 07:10.450] like a straight up interface, right? You can go ahead, you can [07:10.450 --> 07:14.930] like learn about your main disk, the public one. There's a [07:14.930 --> 07:17.210] second one. There's an entire system partition. You can go [07:17.210 --> 07:21.310] ahead and scrape through that too. Read the data back out. [07:21.310 --> 07:24.230] Actually take a look at the data. You know, when your hard [07:24.230 --> 07:28.590] drive is initialized, they run a bunch of tests. This is a [07:28.590 --> 07:32.990] Seagate hard drive. It's actually Seagate's test output. [07:32.990 --> 07:41.650] My favorite part of course being WTF status. Sweet. Now you might [07:41.650 --> 07:46.050] be saying, but Dan, you had to like hook up special pins to the [07:46.050 --> 07:48.550] hard drive. What, an attacker is going to teleport to your home [07:48.550 --> 07:51.950] and do that? No, no, no. An attacker is going to go ahead [07:51.950 --> 07:55.130] and there's a great command for messing with hard drives called [07:55.130 --> 07:58.390] HD parm. We're going to run help on it. We're going to grep for [07:58.390 --> 08:03.150] my favorite phrase in computer security, extremely dangerous. [08:10.320 --> 08:15.300] And you'll notice nowhere does it ask for a password but it [08:15.300 --> 08:21.180] totally wants the firmware to replace the system partition. So [08:22.540 --> 08:26.340] I'm not kidding about making bricks. I actually have my lab [08:26.340 --> 08:32.620] notes from this and it looks like a, I don't know, a wake. [08:32.620 --> 08:35.980] It's like this hard drive, fate, platters exposed, finger [08:35.980 --> 08:38.880] printed, and I think we actually have like our fingers on the [08:38.880 --> 08:43.260] platters. Firmware dump is 01 wrong. Brick by Dan when he [08:43.260 --> 08:46.160] wrote to the buffer, probably repairable. Brick by Dan with HD [08:46.160 --> 08:50.960] parm. Brick by Dan when he set the serial port to 62,500. [08:50.960 --> 08:56.200] You look at these things funny and they blow up. I tell you [08:56.200 --> 08:58.700] it's the most effective security technology of the hard drives. [09:01.060 --> 09:04.000] So this eventually became a paper with a somewhat [09:04.000 --> 09:07.160] predictable subject. Implementation and implications [09:07.160 --> 09:11.800] of a stealth hard drive back door. I'm kind of an unindicted [09:11.800 --> 09:15.200] co-conspirator on this. They did ten months of work. They [09:15.200 --> 09:20.180] actually built malicious firmware that hides on the hard [09:20.180 --> 09:24.160] drive, corrupts the surrounding operating system whether or not [09:24.160 --> 09:27.900] the drive has been formatted. It's owned forever. Kind of [09:27.900 --> 09:34.100] nice. Why do I tell you all of this? There is something which [09:34.100 --> 09:37.880] I have been discussing privately for some time called storage [09:37.880 --> 09:42.700] XOR execution. Which basically says from an architectural [09:42.700 --> 09:46.900] standpoint, if you have code you're running that you know is [09:46.900 --> 09:52.060] malicious, that you are completely aware is exposed to [09:52.060 --> 09:58.220] skilled attackers, at minimum separate the piece of the system [09:58.220 --> 10:02.660] that remembers, that persists, that stores from the piece of [10:02.660 --> 10:08.360] the system that computes, that operates, that parses. So sure, [10:08.360 --> 10:11.940] you can go ahead and provide some malicious input and own the [10:11.940 --> 10:16.320] machine. That might happen. But you can't keep your ownership [10:16.320 --> 10:20.660] without storing it somewhere where it might get discovered. [10:21.220 --> 10:24.220] You actually spend time with attackers. One of the things [10:24.220 --> 10:27.760] they tell you is it's not about ownage. It's about continued [10:27.760 --> 10:30.940] ownage. It's about coming back in a year and your root kit is [10:30.940 --> 10:34.360] still ready to go. You don't have to break your way back in. [10:34.940 --> 10:41.480] Okay? You can't even start discussing storage XOR execution [10:42.000 --> 10:47.320] if you don't have the paranoia of realizing all of these places [10:47.320 --> 10:52.360] to persist your attacks. You know, I'm one of these rare [10:52.360 --> 10:55.620] people in information security that is happy we are talking [10:55.620 --> 10:59.720] about APT, about advanced persistent threats. People say, [10:59.720 --> 11:02.000] how can we be discussing this? These attacks aren't very [11:02.000 --> 11:05.360] advanced. I'm like, holy hell, we have people admitting we have [11:05.360 --> 11:09.140] vulnerabilities we have no idea what to do about. Great. Stuff [11:09.140 --> 11:15.940] is not working. Let's at least talk about that. We aren't even [11:15.940 --> 11:21.980] having it as a basic part of discussion that maybe when you [11:21.980 --> 11:26.580] use resources in a cloud, the underlying hardware should only [11:26.580 --> 11:30.240] be shared with other people in your cloud, like in your [11:30.240 --> 11:34.160] organization. Perhaps there should not be one piece of [11:34.160 --> 11:37.640] hardware for two different customers. Two customers, one [11:37.640 --> 11:48.840] hardware. Works about as well as you think. This, this is the [11:48.840 --> 11:52.860] value of hacker engineering. See what I like about hacking is [11:52.860 --> 11:57.600] that we have no delusions, okay? We are willing to see what [11:57.600 --> 12:02.600] systems are actually capable of from first principles. In fact [12:02.600 --> 12:06.980] you say something is impossible and we get to work. We are [12:06.980 --> 12:10.680] needed. Let me tell you, there's a lot of people out there who [12:10.680 --> 12:15.240] want to modify the internet who have no idea how it works. At [12:15.240 --> 12:20.640] least we have a fighting chance. You know what? I got to say, I [12:20.640 --> 12:26.100] like hacking all the things. But I also like all the things. Let [12:26.100 --> 12:33.100] me show you something very near and dear to my heart. This is a [12:33.100 --> 12:40.720] cat in a shark costume on a Roomba chasing a duck. Fuck [12:40.720 --> 12:52.510] yeah! The internet has changed things. I get this cat. There's [12:52.510 --> 12:55.970] no Bob Saget. There's no America's Funniest Home Videos. [12:55.970 --> 13:00.670] There's no Wiffle Ball hitting some kid in the nuts. There's [13:00.670 --> 13:06.650] just the kitty, okay? And that, that is awesome, okay? One of my [13:06.650 --> 13:10.290] favorite artists, she goes on television, she's told, your [13:10.290 --> 13:14.290] music sounds like a rat being strangled. She goes, why yes, [13:14.290 --> 13:18.110] there's a market for dubstep. I should play violin while playing [13:18.110 --> 13:23.530] dubstep. She gets a half billion views on YouTube. She's a big [13:23.530 --> 13:28.250] deal now. And yeah, she does it with playing songs from Skyrim [13:28.250 --> 13:35.090] and Halo and Zelda. This appeals to my interest, okay? Lindsay [13:35.090 --> 13:41.090] Stolle has rocked it. We live in a world that sucks less because [13:41.090 --> 13:47.090] of the internet. I believe in email. I have never in my life [13:47.090 --> 13:51.670] received an inter-office memo and I hope I never do. I prefer [13:51.670 --> 13:58.910] Skype over plain old telephone, plain owned telephone service. I [13:58.910 --> 14:02.490] prefer online banking over having to sit for hours in a line [14:02.490 --> 14:09.010] in a bank. The internet has changed how things work. We [14:09.010 --> 14:14.490] could lose it. Like there's a level of compromise out there [14:14.490 --> 14:18.450] where we don't get all these nice things. And there are some [14:18.450 --> 14:24.450] people who even prefer that. Got to remember, the internet was [14:24.450 --> 14:28.690] not the first time we tried to create the internet. It's very [14:28.690 --> 14:33.290] matrixed like that. This is like the eighth attempt. Who here [14:33.290 --> 14:41.430] is on like Prodigy or Minitel or AOL? Like, we tried this a [14:41.430 --> 14:46.350] bunch of times. AOL spent like a billion dollars on modems one [14:46.350 --> 14:48.810] year. Turned out it was a good investment. They're still [14:48.810 --> 14:52.990] making $160 million a year off that stuff. Grandma loves her [14:52.990 --> 15:00.650] dial up. The reason the internet worked is because it [15:00.650 --> 15:05.630] was ours. Okay? This was the playground of nerds. This wasn't [15:05.630 --> 15:09.910] biz dudes who made something for biz reasons. This was nerds who [15:09.910 --> 15:18.950] were like, I got to send me some e-mail. And the key is, my God, [15:18.950 --> 15:22.190] it was cheap. No one on the internet ever said that you had [15:22.190 --> 15:25.910] to pay some portion of your revenues. People complain about [15:25.910 --> 15:29.930] paying for DNS names. What is the ratio between how much money [15:29.930 --> 15:34.570] Google makes and how much they pay for Google.com? I don't [15:34.570 --> 15:45.810] think there's a smaller number. One over Google. Contrast that [15:45.810 --> 15:48.850] with the Apple situation. Oh, you would like to be on our [15:48.850 --> 15:54.710] device. 30% gross, please. You know, it's a very, very [15:54.710 --> 16:01.390] different model. And the free internet has disrupted so much. [16:01.530 --> 16:05.250] And there are those who would like to disrupt it back. So, [16:05.250 --> 16:09.210] here's the challenge. We are the guys who actually know how this [16:09.210 --> 16:12.770] damn thing works. We are the people who know that breaking [16:12.770 --> 16:18.130] everything is possible. We don't know that fixing everything is [16:18.130 --> 16:21.590] impossible. Now, you know, technically it's a bit of a game [16:21.590 --> 16:27.130] but technically correct is the best kind of correct. So why do [16:27.130 --> 16:31.570] I do this? Why am I here? Because I see openness to the [16:31.570 --> 16:36.570] possibilities. I see that there's sheer joy in this [16:36.570 --> 16:40.850] community for understanding how things work. I see people [16:40.850 --> 16:45.070] willing to call bullshit on everything. Especially the parts [16:45.070 --> 16:49.010] of security theory that are just clearly wrong. Because, [16:49.010 --> 16:52.850] what, you think everyone else in engineering can screw up and we [16:52.850 --> 16:57.410] in security are infallible? We screw things up all the time. We [16:57.410 --> 17:03.870] just have way more attitude about it. So, that's kind of my [17:03.870 --> 17:08.550] world. Whoa, why did everything just go dark? Get back here. Come [17:08.550 --> 17:19.890] back. I believe in you. All right. So that's the grand world [17:19.890 --> 17:25.650] vision kiddies on Roombas. Let's nerd out a bit. I want to talk [17:25.650 --> 17:29.550] to you guys about random number generators. Generation of random [17:29.550 --> 17:42.930] numbers is indeed too important to be left to chance. What does [17:42.930 --> 17:46.590] it actually mean to need a random number generator? Many [17:46.590 --> 17:50.990] processes require a generator of unpredictable numbers. That means [17:50.990 --> 17:54.410] if you get the last thousand, you can't figure out what the [17:54.410 --> 17:57.110] next one is going to be. You can't go back and figure out [17:57.110 --> 18:00.890] what some of the older ones were that you missed. Now, just [18:00.890 --> 18:05.490] because we require a strong random number generator doesn't [18:05.490 --> 18:09.430] mean we're actually getting strong random number generators. [18:09.430 --> 18:11.990] Here's a couple of various talks. How I Met Your Girlfriend [18:11.990 --> 18:17.610] by the great Sammy Kamkar. Many web applications are failing [18:17.610 --> 18:21.250] for session management. Exploit information for Python. Exploit [18:21.250 --> 18:27.730] information for Ruby. What the hell is going on? Well, the deal [18:27.730 --> 18:30.450] is that all these various web frameworks, you don't actually [18:30.450 --> 18:35.070] log into them that frequently. One of my friends was an admin [18:35.070 --> 18:40.010] at a major e-commerce site. He's like, yeah. Oh, wait, wait. We [18:40.010 --> 18:44.530] have an interruption. Excuse me. So as you all know, we have a [18:44.530 --> 18:48.670] tradition here at DEF CON with new speakers. We have a new [18:48.670 --> 18:55.970] speaker with us this year. His name is Kaminskow? Kaminskow? I [18:55.970 --> 18:58.370] think that's the right way to pronounce this. No, I think you [18:58.370 --> 19:03.130] messed it up. Try again. Kamikow? Kamikow. Yeah, it's [19:03.130 --> 19:10.330] Kamikow. Anyway. Come here. It's good to be back. Good to see [19:10.330 --> 19:22.090] you. Magnificent bastards. New speakers and really fucking old [19:22.090 --> 19:34.780] speakers. Oh, snap. It overflows back to zero. Actually, I missed [19:34.780 --> 19:42.220] the year or so. So the deal is this. You have literally one of [19:42.220 --> 19:47.080] the largest e-commerce sites in the world. We found a phone. [19:47.260 --> 20:00.510] Does anybody have one? I'd say drink but I just did. Yeah, so [20:00.510 --> 20:03.430] you've got one of the largest e-commerce sites in the world and [20:03.430 --> 20:07.250] you'd be like, how many logins per second do you process? You [20:07.250 --> 20:11.950] think it's like tens of thousands or thousands? Hundreds? [20:12.310 --> 20:18.150] They're like, yeah, seven. Seven times a second we have to accept [20:18.270 --> 20:22.690] a password. And it's surprising but when you actually think about [20:22.690 --> 20:27.270] what happens, you put in your password, you get a cookie, that [20:27.270 --> 20:30.550] is now password equivalent. That's the thing that's shoved [20:30.550 --> 20:35.850] into the web app every single time you visit. That value [20:35.850 --> 20:41.150] ideally is a random value. Man, it would suck if you could go [20:41.150 --> 20:44.510] ahead and log in a thousand times and predict the next [20:44.510 --> 20:49.490] thousand log in magic numbers. That's actually totally what's [20:49.490 --> 20:56.230] happening. More recently, a few days ago, awesome attack. One [20:56.230 --> 21:00.390] of the ‑‑ so beautiful. A guy by the name of Dominique [21:00.390 --> 21:06.230] Bongard, reversity on Twitter, came up with an attack against a [21:06.230 --> 21:11.230] scheme called WPS. WPS exists so that you can relatively [21:12.110 --> 21:14.970] efficiently negotiate with an access point and find out what [21:14.970 --> 21:18.150] the passphrase is so you can log in and use the internet. And [21:18.150 --> 21:24.050] they made up this incredibly ill‑advised protocol for it. I [21:24.050 --> 21:29.450] mean, just like impressively. But the one part of the protocol [21:29.450 --> 21:33.710] that wasn't actually awful was this piece where at the [21:33.710 --> 21:38.870] beginning you have some value and it's encrypted with a 128 [21:38.870 --> 21:44.710] bit key. It's randomly generated but it's encrypted. And, you [21:44.710 --> 21:48.870] know, breaking a 128 bit key is not going to happen. Like, [21:48.870 --> 21:51.770] that's a 2 to the 128 work effort. That's going to take [21:51.770 --> 21:55.630] until the end of the universe. However, it requires you to [21:55.630 --> 22:01.450] actually have 128 bits of entropy. Which none of the [22:01.450 --> 22:06.510] devices did. Device one had what's called an LFSR, a linear [22:06.510 --> 22:09.890] feedback shift register. They keep showing up in this space [22:09.890 --> 22:13.670] because they're the quickest and easiest way to get this stream [22:13.670 --> 22:17.290] of numbers. You start with a seed value and it just keeps [22:17.290 --> 22:20.930] rolling and rolling and rolling. Well, the seed value in the [22:20.930 --> 22:25.230] first device was 32 bits long. So you just try all 32 bits [22:25.230 --> 22:29.990] combination. Second one, another 32 bits. The third one [22:29.990 --> 22:41.750] just encrypted with zero. Beautiful attack. So let's talk [22:41.750 --> 22:46.850] about why really we keep getting owned by random number [22:46.850 --> 22:50.650] generators. And the most important thing to realize is [22:50.650 --> 22:54.990] there's a huge amount of discussion in the cryptographic [22:54.990 --> 23:00.290] world about the absolute right way to build a cryptographically [23:00.290 --> 23:04.790] secure random number generator. And for the love of God, most of [23:04.790 --> 23:08.650] it doesn't matter. No one's getting owned because they use [23:08.650 --> 23:13.970] SHA-1 or SHA-256 or hell MD4. No one's getting owned because [23:13.970 --> 23:17.910] they use hash instead of HMAC DBRG. They're not getting owned [23:17.910 --> 23:20.710] because they used the same entropy for too long and didn't [23:20.710 --> 23:23.970] mix in new entropy. We're not getting owned because we had one [23:23.970 --> 23:28.990] pool instead of 32 pools. Like there's a disconnect between [23:28.990 --> 23:33.670] what's getting us owned and what we argue about. The fundamental [23:33.670 --> 23:39.230] truth is there's like a thousand different ways to build a [23:39.230 --> 23:44.790] cryptographically secure pseudo random number generator. And [23:44.790 --> 23:49.490] they all have an incredibly high security margin. That is the [23:49.490 --> 23:52.910] fundamental truth. When you actually look at the systems in [23:52.910 --> 23:57.350] the field that are breaking and they are all breaking, your two [23:57.350 --> 24:02.990] problems are one, there's no entropy at all. And two, we're [24:02.990 --> 24:06.290] not even using cryptographically secure pseudo random number [24:06.290 --> 24:11.150] generators. We're using LFSRs. We're using crap. This is what's [24:11.150 --> 24:16.590] actually happening. So let's talk about the no entropy [24:16.590 --> 24:20.810] problem. What does a cryptographically secure pseudo [24:20.810 --> 24:25.710] random number generator do? It takes a little bit of entropy. [24:25.730 --> 24:31.050] 128 values that are either 0 or 1 that have no particular [24:31.050 --> 24:36.250] pattern. It takes that little tiny chunk and spreads it out [24:36.250 --> 24:40.650] into number after number after number, gigabytes, hundreds of [24:40.650 --> 24:45.730] gigabytes, whatever. Your idea is from an attacker standpoint, [24:45.730 --> 24:49.690] you can look at as much of this output as possible. You learn [24:49.690 --> 24:56.250] nothing about the secret. Your best attack is unfortunately to [24:56.250 --> 25:02.450] guess what all 128 bits of that seed are and it's just not [25:02.450 --> 25:09.030] feasible. There's too many. Now, in order for this to be true, [25:09.030 --> 25:14.850] you actually need 128 bits. What killed WPS is there actually [25:14.850 --> 25:18.730] wasn't. Generally there was 32 bits which is a meaningful, [25:18.730 --> 25:23.470] which is a successful amount to break. One case there was 0. [25:23.530 --> 25:28.890] This isn't an obscure bug. Nadia Henninger did this incredibly [25:28.890 --> 25:33.490] beautiful attack a few years ago where she found 1 out of 200 [25:33.490 --> 25:38.510] RSA keys on the internet were actually badly generated. Now [25:38.510 --> 25:43.270] here's what's scary. If she finds that 1 out of 200 keys are [25:43.270 --> 25:47.690] identical, the method that she used doesn't actually tell her [25:48.270 --> 25:52.670] if the keys are almost identical. If there's a single [25:52.670 --> 25:57.690] bit of difference and otherwise everything is the same, Nadia's [25:57.690 --> 26:03.270] method wouldn't be able to find it. So unfortunately we have [26:03.270 --> 26:07.510] this really ugly situation where 1 out of 200 is a floor and [26:07.510 --> 26:10.930] really it's something like 1 out of 50 keys on the internet is [26:10.930 --> 26:15.870] bad. That's an incredible failure rate. Shouldn't DevRandom [26:15.870 --> 26:19.330] and DevUrandom have actually prevented this? Because these [26:19.330 --> 26:21.990] keys are actually being generated out of what are [26:21.990 --> 26:27.810] supposed to be well engineered kernel systems. Let's talk about [26:27.810 --> 26:32.530] why we actually really do like kernel random number generators. [26:33.390 --> 26:39.570] First off, when you have hardware in your computer, [26:39.570 --> 26:43.370] remember your biggest lie of a computer is just one computer. [26:43.570 --> 26:48.270] When one of the other pieces on the other computers talks to [26:48.270 --> 26:53.390] your CPU, literally what happens is a piece of the kernel is run. [26:53.470 --> 26:57.630] An interrupt is fired, the CPU jumps to a certain point, you [26:57.630 --> 27:03.650] get a time stamp at that. You now have an interaction of [27:03.650 --> 27:09.510] someone else's clock with yours. You ever wonder what it means to [27:09.510 --> 27:12.570] actually collect random information, what it means to [27:12.570 --> 27:16.970] collect entropy? What are you doing? At the end of the day, [27:16.970 --> 27:21.510] what you're doing is you're measuring a slow system with a [27:21.510 --> 27:25.150] fast system. You know, I can snap my fingers and I think I [27:25.290 --> 27:28.190] have a rhythm going. You think I have a rhythm going accurate to [27:28.190 --> 27:33.510] the nanosecond? No, I don't. Because that's not how accurate [27:33.510 --> 27:37.890] human systems are. We are at best accurate to the hundredth [27:37.890 --> 27:43.310] of a second. When you have a computer that says I'm going to [27:43.310 --> 27:45.610] watch your mouse movements, I'm going to watch your interkey [27:45.610 --> 27:49.390] stroke timings, you basically have a situation where a CPU [27:50.050 --> 27:54.430] that is running at billions and billions of cycles a second is [27:54.430 --> 27:57.490] measuring a system that's running at hundreds of times a [27:57.490 --> 28:00.050] second. And that's what's happening in this kernel [28:00.410 --> 28:03.330] situation. The kernel is seeing an event come in and it's [28:03.330 --> 28:05.310] hoping it's coming from some other computer that's running [28:05.310 --> 28:10.130] slower or at least out of its control. Another great thing [28:10.130 --> 28:13.330] about kernel RNGs is that there's just one kernel, at [28:13.330 --> 28:17.110] least ideally. So you don't have some situation where one process [28:17.110 --> 28:19.810] is doing something right and one process is doing something [28:19.810 --> 28:23.230] wrong. Every process benefits from whatever randomness is [28:23.230 --> 28:29.790] available. It's shared. Finally, this is tricky stuff. And one of [28:29.790 --> 28:34.170] the whole points of an operating system is to take tricky stuff [28:34.170 --> 28:39.230] and put it into a box that smart people build it and it is done [28:39.230 --> 28:45.550] right. So that was the idea. What went wrong? Well, all those [28:45.550 --> 28:49.210] devices that were going ahead and generating these random keys, [28:49.210 --> 28:54.710] all these devices were started up, there was nobody at the [28:54.710 --> 28:58.970] keyboard, there was nobody at the mouse, there was no hard [28:58.970 --> 29:03.710] drive to be getting friction from air. There were no events [29:03.710 --> 29:07.570] coming in from the hardware. It was just sitting there. And if [29:07.570 --> 29:11.290] you've got no events, you've got no entropy to operate on. Now, [29:11.290 --> 29:15.910] it would be nice if CPUs actually had hardware random [29:15.910 --> 29:20.230] number generation. But for whatever reason, that just [29:20.230 --> 29:24.370] consistently seems to be outside the purview of our modern CPU [29:24.370 --> 29:29.470] manufacturers. You just can't figure out how to do it. So how [29:29.470 --> 29:34.450] do you solve this problem? Like, really? The truth is, you don't [29:34.450 --> 29:38.030] have to be perfect. You could fail every once in a while and [29:38.030 --> 29:42.050] you're still going to beat the one nine of reliability that we [29:42.050 --> 29:49.510] got out of RSA. That really sucks. You've got to force the [29:49.510 --> 29:53.230] synthesis of events. You have to actually force a situation where [29:53.690 --> 29:58.390] the device, whatever device that it actually is, has something [29:58.390 --> 30:02.870] on a slower clock that's pinging the fast clock. And [30:02.870 --> 30:06.810] realistically what that means is using the real time clock, [30:06.810 --> 30:09.750] which tends to be a separate chip, tends to run at some [30:09.750 --> 30:14.530] amount of kilohertz and having that ping the CPU which tends to [30:14.530 --> 30:17.650] be running at some amount of hundreds of megahertz to [30:17.650 --> 30:23.730] gigahertz. This actually works. Now you can also go ahead and do [30:23.730 --> 30:26.450] some actions that take a hopefully non-deterministic [30:26.450 --> 30:30.430] amount of time. So reading values out of memory, causing [30:30.430 --> 30:34.610] contention for resources. You want to do what's called [30:34.610 --> 30:38.310] whitening. So that means you take any sequence of bits. If [30:38.310 --> 30:41.490] it's a zero zero, you throw it out. If it's a one one, you [30:41.490 --> 30:44.830] throw it out. The zero to one transition is considered a zero. [30:44.830 --> 30:47.630] The one to zero transition is considered a one. This is what's [30:47.630 --> 30:51.370] called de-biasing your data. I released a piece of code called [30:51.370 --> 30:55.330] docker RAND about two years ago. Docker RAND was based on [30:55.330 --> 30:59.630] true RAND by Matt Blaze from about ten years ago. I think [30:59.630 --> 31:07.450] actually about 1996. If we had followed Matt Blaze's guidance [31:07.450 --> 31:12.590] in 1996, we would not have a single nine of reliability for [31:12.590 --> 31:17.610] RSA in, you know, 2012. That wouldn't have happened. [31:18.310 --> 31:22.610] Part of security is accepting maybe there is some weird ass [31:22.610 --> 31:25.810] environment where docker RAND fails. But is it going to fail [31:25.810 --> 31:34.010] as much as status quo? No. No it's not. So let's talk about [31:34.010 --> 31:40.110] the larger issue. Even worse than the fact that we don't have [31:40.110 --> 31:43.170] true entropy to see this cryptographically secure pseudo [31:43.170 --> 31:47.450] random number generator, is the fact that we're not actually [31:47.450 --> 31:53.550] using the CSPRNGs at all. When you look at the languages that [31:53.550 --> 31:58.990] people use to write software, JavaScript has math random, LFSR. [31:58.990 --> 32:04.610] Ruby has Ruby RAND, LFSR. Java has Java util random, PHP RAND, [32:05.470 --> 32:14.870] it's all crap. Why? Why are we doing this? Well, what ends up [32:14.870 --> 32:19.410] happening is every time someone complains about the nature of [32:19.410 --> 32:22.830] the random number generator that we have, we end up making [32:23.610 --> 32:28.750] secure random. It's not fixing the old broken stuff. We make [32:28.750 --> 32:34.870] some new API. Then we make it weird. It's never just like [32:34.870 --> 32:39.530] math dot secure random. It's like bar A equals new UINT array [32:39.530 --> 32:45.450] one window crypto get random values. What? That wasn't what I [32:45.450 --> 32:50.190] was using when it was easy. Why are you making secure not easy [32:50.190 --> 32:58.370] and not default? Does that work anywhere else? No. So why not be [32:58.370 --> 33:03.270] secure by default? Why not instead of requiring some weird [33:03.270 --> 33:08.130] ass random API, why not take the broken APIs and make them not [33:08.130 --> 33:13.130] broken? So thus, we've actually been doing that. Ryan [33:13.130 --> 33:17.170] Castellucci works with me over at White Ops. And what we've [33:17.170 --> 33:21.070] been doing is systematically going through each and every one [33:21.070 --> 33:25.890] of the popular web programming environments and we're taking [33:25.890 --> 33:31.410] their crappy little math randoms and making them a shell for [33:31.410 --> 33:35.690] dev U random. So we've gotten JavaScript support for node in [33:35.690 --> 33:39.430] the browsers. We've gotten Ruby. We've actually made C's RAND [33:39.430 --> 33:46.510] function actually RAND. PHP, Python, OpenJDK. It's not like [33:46.510 --> 33:49.850] it's that hard to write this code. We actually just need to [33:49.850 --> 33:54.230] write it and get it something that people agree, hey, maybe we [33:54.230 --> 33:58.950] should just have an easy to use path here. Now there's going to [33:58.950 --> 34:02.510] be some run time feature support like being able to interrogate [34:02.510 --> 34:06.010] how good is this random number generator? Do we support fixed [34:06.010 --> 34:10.610] seeds? Do we support high speed? So I'm going to do something now [34:10.610 --> 34:14.310] which people tend to call, it's when I play chess against [34:14.310 --> 34:18.210] myself. Let's talk about what's wrong with what we've named lib [34:18.210 --> 34:26.510] U Randy besides the name. Ryan actually named it and I'm like, [34:26.510 --> 34:30.970] sorry I can't think of this code as any other name now. There are [34:30.970 --> 34:35.590] two reasons why generally you wouldn't use an approach like [34:35.590 --> 34:43.790] this. The first reason is testers tend to like predictable test [34:43.790 --> 34:47.670] results. So they tend to like situations where they can say I [34:47.670 --> 34:52.270] want it to be a random stream but I want it to be the same random [34:52.270 --> 34:56.170] stream. So the system will always behave in a predictable [34:56.170 --> 35:01.570] way that can be regression tested. Now I actually never, [35:01.570 --> 35:08.970] ever like this approach. Here's why. People say it's a two line [35:08.970 --> 35:13.630] change. Why do you need to go ahead and retest everything for a [35:13.630 --> 35:17.590] two line change? And here's the answer. It's because there's a [35:17.590 --> 35:23.150] bunch of bugs that don't show up in the field for, not because [35:23.150 --> 35:28.030] there isn't a bug, but because the house of cards fell in just [35:28.030 --> 35:32.110] the same precise way. So that when the memory corruption [35:32.110 --> 35:37.370] occurred, nothing bad visibly happened. And so when the house [35:37.370 --> 35:42.510] of cards falls the same way every time, you never discover [35:42.510 --> 35:47.050] the bug. And you only discover it when you do that two line [35:47.050 --> 35:50.650] change. That shouldn't break anything but now the house of [35:50.650 --> 35:54.570] cards falls like this and now everything blows up. I really [35:54.570 --> 35:59.490] don't like these sort of fixed seeds because they allow the [35:59.490 --> 36:04.590] ugly bugs to stay unfound unless you go ahead and do like a [36:04.590 --> 36:07.830] complete massive retest which then you now have to do every [36:07.830 --> 36:12.970] time because you keep getting burnt. It sucks. But people want [36:12.970 --> 36:15.230] it and so okay, we'll go ahead and we'll have a special mode [36:15.230 --> 36:19.310] for LibUrandy that allows you to say no, no, no, I intentionally [36:19.310 --> 36:21.670] want my randomness to suck. Okay, fine, we'll set an [36:21.670 --> 36:27.390] environment flag. More seriously, Urandom is actually [36:27.390 --> 36:33.070] kind of slower than LFSRs. So you do have a situation where [36:33.070 --> 36:38.550] it's 4 megabytes a second out of Urandom and 260 megabytes a [36:38.550 --> 36:44.430] second out of your crappy bad randomness. And when you [36:44.430 --> 36:51.570] actually look at the ‑‑ so I was interested. I believe in [36:51.570 --> 36:55.390] being historical. Let's look at the historical record and see [36:56.090 --> 36:59.030] why did these APIs get screwed up like this in the first [36:59.030 --> 37:02.810] place. And at least in the browser case, they realized they [37:02.810 --> 37:05.570] had a bad random number generator but they also had [37:05.570 --> 37:08.430] benchmarks and they really didn't want to lose at the [37:08.430 --> 37:11.790] benchmarks. It's like, well, we're not secure but we're not [37:11.790 --> 37:21.210] being benchmarked for security. So even at 4 megabytes a [37:21.210 --> 37:26.190] second, it's still like a million random numbers a second. [37:26.190 --> 37:32.090] It's generally fast enough for everything but not always. So [37:32.090 --> 37:36.090] this brings up the question, should we be using a user space [37:36.930 --> 37:39.870] scriptographically secure pseudo random number generator? Now, [37:39.870 --> 37:42.870] it doesn't mean that we don't use Urandom. We still mine it as [37:42.870 --> 37:46.190] frequently as we might like. If it happens to get some new bits [37:46.190 --> 37:49.290] of randomness from the kernel, great. Let's use them. Let's [37:49.290 --> 37:53.050] integrate them in. But like I said at the beginning, like a [37:53.050 --> 37:58.510] few minutes ago, pretty much every variant of a CSPRNG is [37:58.510 --> 38:01.710] still secure. So one of the fastest hashes out there is [38:01.710 --> 38:06.250] what's called sip hash. It comes from our buddy DJB. If you just [38:06.250 --> 38:08.490] sip hash seed with an incremented counter, this [38:08.490 --> 38:13.890] actually works. It's 20 times faster than dev Urandom on [38:13.890 --> 38:17.630] Linux. It's competitive with the non-cryptographically secure [38:17.630 --> 38:21.010] pseudo random number generators. I guess what I'm trying to tell [38:21.010 --> 38:26.750] you is there's no advantage to sucking. You can be fast and [38:26.750 --> 38:31.410] secure. It's okay. Now there is a possible improvement that we [38:31.410 --> 38:35.430] could do and that is the integration of time. Specifically [38:35.430 --> 38:41.050] what's called clock monotonic. Now while you can't get for [38:41.050 --> 38:46.290] whatever mysterious reasons NSA good hardware random number [38:46.290 --> 38:53.150] generator, you can at least get a time stamp. And it turns out [38:53.150 --> 38:57.730] you just need bits that are different. We've got this [38:57.730 --> 39:01.070] problem with what's called forking where you have a [39:01.070 --> 39:07.050] process, you make a copy of it, the copy has the same seed and [39:07.050 --> 39:10.470] the same counter value. Now you have the same entropy happening [39:10.470 --> 39:16.310] twice. And it sucks. If you integrate time, it turns out [39:17.190 --> 39:21.550] empirically it's a pain in the butt to get two things to happen [39:21.550 --> 39:26.090] at exactly the same CPU nanosecond. It's not that it [39:26.090 --> 39:32.150] can't, it's that it won't. That's a good thing. So you [39:32.150 --> 39:36.790] could actually have on a per query to the random interface [39:36.790 --> 39:42.270] basis, you could actually say give me this time stamp's view [39:42.270 --> 39:46.470] of the randomness. So my preferred CSPRNG looks [39:46.470 --> 39:50.170] something like SIP hashing the secret, a counter, the previous [39:50.170 --> 39:53.870] output and what I call the shifted time. So you don't just [39:53.870 --> 39:57.550] do the time directly, you shift it by some amount so the [39:57.550 --> 40:00.550] attacker can't just say, well I know according to NTP that this [40:00.550 --> 40:03.730] value is going to be almost zero. Force there to be some [40:03.730 --> 40:09.550] fixed offset. I'm not doing this yet in Lib U Randy. And here's [40:09.550 --> 40:14.970] why. Reasonable people can disagree about whether a CSPRNG [40:14.970 --> 40:19.450] should be in user space and kernel space. But we all hate [40:19.450 --> 40:24.570] LFSRs. So let's at least do something which causes those [40:24.570 --> 40:29.410] damn things to die. Another change is maybe we don't use SIP [40:29.410 --> 40:34.010] hash. SIP, it turns out because of quirks, you can do faster [40:34.010 --> 40:37.870] with Blake, you can really do faster with Skyn. So both of [40:37.870 --> 40:40.450] them are alternate hashing systems. We've found things [40:40.450 --> 40:44.870] where it's like twice as fast. So really the right answer at [40:44.870 --> 40:48.970] the end of the day may not be do a user space CSPRNG and maybe [40:49.570 --> 40:53.510] fix up the really weird one inside of Linux which is [40:53.510 --> 40:56.990] obsessed with mixing stuff in multiple poles, et cetera, et [40:56.990 --> 41:03.290] cetera. The problems we don't have. So that's kind of the [41:03.290 --> 41:07.470] souped nuts on what's going on with entropy generation. But [41:07.470 --> 41:13.830] there's another problem around representation. Apparently you [41:13.830 --> 41:24.790] are supposed to do something with D3B07384D1NGJU42MA1$JH89 and [41:24.790 --> 41:30.730] whatever the hell that is, squiggly stuff. What the hell is [41:30.730 --> 41:40.550] that? Stop puking bits. We are lying to ourselves if we think [41:40.550 --> 41:47.570] users can do anything with that. They are lost. The problem is [41:47.570 --> 41:52.230] is that computers actually need humans to recognize and to [41:52.230 --> 41:58.950] remember large amounts of bits and it's hopeless. Okay? We have [41:58.950 --> 42:05.150] hardware acceleration for human faces and even then we maybe can [42:05.150 --> 42:10.110] get about 16 bits. There may be, if we're absolutely at the edge [42:10.110 --> 42:14.970] of our capability, able to differentiate 65,000 people. It's [42:14.970 --> 42:19.170] not that much. And computers want more, so much more, 24 to [42:19.170 --> 42:24.650] 128 bits. They want recognition. Have you ever seen this before? [42:24.650 --> 42:28.150] And they want repetition. Hey, give me that long ass password. [42:28.890 --> 42:32.270] And the standard stuff doesn't work. We did not evolve to deal [42:32.270 --> 42:38.590] with hex or base 64 or base 58 or squiggly SSH art. It's just [42:38.590 --> 42:42.970] not how we're built. Now, I've looked at this problem before. I [42:42.970 --> 42:46.090] did some work. I called it crypto mnemonics. Went ahead and [42:46.090 --> 42:51.950] took 512 male names, 1,024 female names, 8,192 last names. I [42:51.950 --> 42:55.990] represented entropy by married couples. I'm sorry, totally [42:55.990 --> 43:00.150] heteronormative but actually really diverse. You know, Julio [43:00.150 --> 43:03.990] and Epifania, Dizuti and Luther, Roland, Dubros and Manuel and [43:03.990 --> 43:10.930] Twilight and Bessie. Definite range of people here. This [43:10.930 --> 43:15.590] actually works as a way to get yourself to be used to some [43:15.590 --> 43:20.170] pattern of bits. You do have to show it every single time you [43:20.170 --> 43:23.630] interact with something. You can't just show the entropy [43:23.630 --> 43:26.630] representation when there's a problem. It's like you only see [43:26.630 --> 43:29.510] someone's face when there's a problem. Otherwise they're in a [43:29.510 --> 43:32.450] mask. No, that doesn't work that way. It's not how the brain [43:32.450 --> 43:37.590] works. It needs spaced repetition to remember. Now can [43:37.590 --> 43:45.270] we do better? Humans do have memory capacity. It's just not [43:45.270 --> 43:49.170] for arbitrary bits. Like Homer's epics are enormous. There's like [43:49.170 --> 43:54.530] kilobytes of entropy in there. The deal is is that we remember [43:54.530 --> 43:59.990] objects. We remember stories. We remember narratives far more [43:59.990 --> 44:03.530] than we remember arbitrary ones and zeros. So if you can [44:03.530 --> 44:08.390] represent ones and zeros in these sort of narratives that [44:08.390 --> 44:13.230] humans are built to remember, you actually have something. [44:13.290 --> 44:18.170] Heck, maybe get like a password and like have it spell check. So [44:18.170 --> 44:22.570] what we've been exploring has been using triads of adjectives, [44:22.570 --> 44:27.390] nouns and verbs and having these be selected to be maximally [44:27.390 --> 44:32.410] distant from each other and to encode whatever entropy someone [44:32.410 --> 44:36.670] needs to recognize or repeat in these stories. I haven't been [44:36.670 --> 44:39.730] doing this work alone. I've been working with my co-worker Ryan [44:39.730 --> 44:45.410] Casalucci over at White Ops and it's his code, it's his work, [44:45.410 --> 44:48.450] he's the one who should be talking about it. So he's going [44:48.450 --> 44:50.890] to come on stage and we're going to talk about how he did this. [44:58.380 --> 45:00.840] So Ryan, pick up a mic. [45:02.600 --> 45:05.480] Hi, guys. How's it going? [45:07.740 --> 45:11.960] So I just have to say, I have known Ryan for many, many years. [45:11.960 --> 45:15.060] He recently started working with me at White Ops. I have never [45:15.060 --> 45:19.120] had a guest come up in the middle of my talk and there's no [45:19.120 --> 45:23.460] one I'd rather have be here. So thank you. So Ryan, tell me what [45:23.460 --> 45:24.420] we're looking at here. [45:24.420 --> 45:31.860] Okay. So we have up on the slide a randomly generated sample. [45:33.160 --> 45:36.280] It's like 5E4D, it's like a bunch of bits? [45:36.280 --> 45:39.360] Right. There's a couple algorithms that are combined [45:39.360 --> 45:43.440] together to generate the encoding we have there. As you [45:43.440 --> 45:47.640] can see, there's four groups of three words. Each one is an [45:47.640 --> 45:50.260] adjective, noun and verb. [45:51.040 --> 45:54.880] It's like macho acid answering, rustic cable fetching and [45:54.880 --> 45:55.000] something. [45:55.000 --> 46:00.780] Right. And we have a known amount of entropy there. So what [46:00.780 --> 46:05.240] we can do, spell check for passwords, well, pass phrases. [46:05.960 --> 46:11.380] So unfortunately we don't have a live demo to you. I could not [46:11.380 --> 46:17.000] get the code to work fast enough for that. I will fix that soon. [46:17.320 --> 46:19.700] The code will be released. It is awesome. [46:19.700 --> 46:23.200] But we actually do have sort of a view of what's going on here. [46:23.200 --> 46:28.980] That is, it can fix far worse than that. But as you can see, [46:29.800 --> 46:34.580] transpositions, deleted spaces, replaced characters, added [46:34.580 --> 46:38.720] letters, deleted letters, random garbage symbols, it can fix all [46:38.720 --> 46:39.640] of this. [46:39.640 --> 46:41.180] And the words are out of order even. [46:41.180 --> 46:46.800] Yes. It is also order insensitive because people will [46:46.800 --> 46:50.000] commonly mix up the order of words when they are trying to [46:50.000 --> 46:53.620] remember something like this. And we can fix it so we should. [46:54.120 --> 46:56.920] Interesting. So you don't have to remember if the acid is macho [46:56.920 --> 47:00.280] or rustic. You just have to know acid, macho, rustic or whatever [47:00.280 --> 47:00.560] order. [47:00.560 --> 47:01.380] Exactly. [47:01.380 --> 47:04.700] Okay. So let's talk about how you actually did this. [47:04.720 --> 47:08.780] Okay. It's kind of complicated. I have code implemented in [47:08.780 --> 47:12.640] JavaScript and Python. We will, it's on GitHub. The repo is [47:12.640 --> 47:18.300] currently private. That will be changed soon. So we have two [47:18.300 --> 47:22.840] major components. There's a combinatorial number system [47:22.840 --> 47:28.060] encoder. That is an obscure but really neat trick where you can [47:28.060 --> 47:34.220] take an arbitrary number and encode it as a series of [47:34.220 --> 47:39.360] non-repeating symbols. So as the example shows, if you have [47:40.780 --> 47:46.600] multiple A's, that's not going to work because you can't use [47:46.600 --> 47:48.260] the same symbol more than once. [47:48.280 --> 47:51.600] So this is like you have an encoding of possible letters [47:51.600 --> 47:55.240] from A to Z. You could have B, A, D, F, G, C. [47:55.240 --> 47:59.960] You're picking N of them where N might be 3 or 4 or 5 depending [47:59.960 --> 48:04.440] upon how large a range of numbers you want to encode. And [48:04.440 --> 48:08.540] this is fairly efficient. This is, you can do this fast. You [48:08.540 --> 48:12.560] don't have to walk through all possible combinations. You can [48:12.560 --> 48:16.680] generate a specific numbered combination and that's your [48:16.680 --> 48:17.500] encoding. [48:17.800 --> 48:21.640] And so you're actually able to take arbitrary bits of input and [48:21.640 --> 48:24.960] map them to this scheme that says it's these numbers and [48:24.960 --> 48:28.460] because the numbers are a combinatorial system, they can [48:28.460 --> 48:29.340] show up in any order. [48:29.340 --> 48:33.080] They can show up in any order, yes. For decode, we just have to [48:33.080 --> 48:33.840] sort them. [48:33.840 --> 48:36.200] All right. So talking about the decode, you're not having it be [48:36.200 --> 48:37.900] raw numbers, you're having it be words. [48:37.900 --> 48:43.300] Right. So there's another step here which is our word mapper. [48:43.620 --> 48:51.760] Our word mapper has a dictionary file. In the implementation we [48:51.760 --> 48:54.140] were showing in the last slide, we actually have three [48:54.140 --> 48:57.680] dictionaries, one for nouns, one for adjectives, one for verbs. [48:57.780 --> 49:02.120] And we actually include three values, one with X nouns, one [49:02.120 --> 49:05.460] with X verbs, one with X adjectives and interlace them. [49:05.910 --> 49:12.300] But it's a little messy. Anyway, so our dictionary has our words [49:12.300 --> 49:17.380] in it and variant forms of the words because it makes things [49:17.380 --> 49:21.820] easier for people. So for the verbs, for example, it doesn't [49:21.820 --> 49:30.220] matter if you say forbidding or forbidden or forbade or whatever, [49:30.220 --> 49:35.540] they're all forms of the same verb. We know that. We [49:35.540 --> 49:41.780] canonicalize them. And in coding we just pick the canonical form [49:41.780 --> 49:43.810] which in this case would be forbidding. [49:46.200 --> 49:51.820] So we're basically taking all the common errors of password [49:51.820 --> 49:55.780] input and we're saying those common errors no longer count. [49:55.780 --> 49:58.680] We're going to correct for them before we even let them get into [49:58.680 --> 49:59.340] the decoder. [49:59.340 --> 50:07.160] Exactly. And I've got some crazy Python code using I think [50:07.160 --> 50:11.140] something called node box which is a linguistics suite that we [50:11.140 --> 50:19.020] use to generate all the verb forms. And then we have a [50:19.540 --> 50:23.140] recursive algorithm that goes through and maximizes the edit [50:23.140 --> 50:24.680] distance between words. If you're not familiar with edit [50:24.680 --> 50:30.080] distance, I don't remember the specific one I'm using but each [50:31.480 --> 50:37.180] character insertion, deletion, alteration or transposition of [50:37.180 --> 50:41.400] adjacent characters counts as an edit. So we want to have at [50:41.400 --> 50:45.960] least two edits between any words possible so that a single [50:45.960 --> 50:52.460] typo cannot possibly result in a valid but wrong word. [50:53.280 --> 50:56.260] Basically computational linguistics as applied to [50:56.260 --> 51:05.830] security. Basically a path out of using lead speak as a [51:05.830 --> 51:10.470] security technology. There's no more of this like, I used an app [51:10.470 --> 51:14.010] sign, I'm secure. We all know exactly how well that works and [51:14.010 --> 51:17.010] if you don't, go talk to the core logic guys. I think they [51:17.130 --> 51:22.730] have a contest that might change your mind. Nice. So it seems [51:22.730 --> 51:25.830] pretty cool. You think this is going to let us have passwords [51:25.830 --> 51:30.410] be generated server side? That's the idea. We generate not [51:30.410 --> 51:33.930] necessarily server side but computer generated pass phrases [51:33.930 --> 51:39.050] that there's a reasonable hope of people understanding and [51:40.210 --> 51:43.550] remembering. It's always seemed to me like victim shaming. We [51:43.550 --> 51:46.310] make the user generate the password so we can blame them [51:46.310 --> 51:48.650] when their password sucks. Meanwhile we have no clue how to [51:48.650 --> 51:52.150] build them one. I remember when a few months ago when we first [51:52.150 --> 51:56.150] started working on this, Dan came up with some examples and I [51:56.150 --> 52:00.050] think there was, I still remember most of what we had. We [52:00.050 --> 52:05.370] had a flat monkey staring and we had a greenhouse jumping. There [52:05.370 --> 52:07.930] was another tuple which I have now forgotten. But the point is [52:07.930 --> 52:11.210] I looked at these maybe twice ever and I still remember them. [52:11.510 --> 52:15.650] So we were talking last night about what the implications are [52:15.650 --> 52:18.770] for allowing more key stretching. Can you explain what [52:18.770 --> 52:21.930] key stretching is and why this makes it a more feasible [52:21.930 --> 52:27.710] thing? This is really cool. So key stretching is the idea where [52:27.710 --> 52:33.370] in addition to randomness in the pass phrase as a source of [52:33.370 --> 52:37.270] difficulty to crack it, we also just make the hashing slow as [52:37.270 --> 52:44.630] hell. You've probably all heard of B crypt or PBKDF2 or S crypt. [52:44.930 --> 52:51.590] Yes, thank you. And this is somewhat limited because if [52:51.590 --> 52:55.790] you're spinning for five seconds and it takes you three times to [52:56.810 --> 52:59.810] get your password right, you're going to just throw the computer [52:59.810 --> 53:04.570] through the window. But if we have spell correct, even if you [53:04.570 --> 53:08.950] make a few small typos, it works the first time. It's fantastic. [53:09.270 --> 53:12.530] And people generally aren't going to mind newly so much [53:13.350 --> 53:18.030] waiting for their login to complete as they are waiting to [53:18.030 --> 53:20.810] see if they typed their password correctly and if not having to [53:20.810 --> 53:24.630] reenter it. I had a high security thing I built a while [53:24.630 --> 53:29.690] ago. It would spin the CPU for 60 seconds and it was a [53:29.690 --> 53:33.230] threshold scheme so we had five of us having to type passwords [53:33.230 --> 53:39.510] and when somebody mistyped it, it sucked. But if you knew it [53:39.510 --> 53:42.770] was going to be right, one minute wouldn't even be that bad [53:42.770 --> 53:49.110] for disk encryption. So we're basically dealing with a common [53:49.110 --> 53:52.490] failure mode of what would otherwise be a useful and [53:52.490 --> 53:55.670] effective security technology. The more effective a security [53:55.670 --> 53:59.550] technology works, the more we can use it. Cool. All right, [53:59.550 --> 54:02.170] Ryan, thank you much. I really appreciate you building this [54:02.170 --> 54:22.380] out. Do we have a drink? Someone bring a drink. All right. I [54:22.400 --> 54:31.580] will. So there's a major use case to be considered with a lot [54:31.580 --> 54:36.000] of this stuff. Speaking of work from a previous talk, a few [54:36.000 --> 54:39.360] years ago I did something called Fidelius. Fidelius is basically [54:39.720 --> 54:44.620] a trick that allows you to use a passphrase, any string of [54:44.620 --> 54:50.580] characters, and use that to seed any asymmetric system. So you [54:50.580 --> 54:54.980] can have a passphrase for an SSH key, SSL certificate. [54:56.200 --> 54:58.440] Basically what I did was say, you know, a passphrase will seed [54:58.560 --> 55:01.960] a pseudo random number generator and a random stream of bits is [55:01.960 --> 55:06.260] the input to all key generators. So you hook the two together, [55:06.260 --> 55:08.620] you guess what's called a password authenticated key [55:08.620 --> 55:14.140] exchange scheme. It always works. This was relatively [55:14.140 --> 55:20.120] obscure two years ago. This is becoming straight up mainstream [55:20.120 --> 55:23.360] now. There's a scheme called brain wallet that allows you to [55:23.360 --> 55:27.540] have a word or phrase going to a bitcoin address. There's a [55:27.540 --> 55:30.980] scheme called mini lock that has a word or phrase going to, you [55:30.980 --> 55:34.720] know, the rough equivalent of a PGP key. Not actually PGP but [55:34.720 --> 55:41.620] still. These systems are incredibly vulnerable to having a [55:41.620 --> 55:46.120] low amount of true entropy. Because by definition you're [55:46.120 --> 55:50.100] publishing your public key. It's almost like it's called a [55:50.100 --> 55:57.060] public key. So this has been a straight up expensive problem in [55:57.060 --> 56:00.520] brain wallet. Tens of thousands of dollars worth of bitcoin have [56:00.520 --> 56:04.960] been stolen. What we need is a way for people to be able to [56:04.960 --> 56:11.300] remember more entropy. The idea is that storing all these bits [56:11.300 --> 56:14.460] on a hard drive ends up being a screw up. People want something [56:14.460 --> 56:17.740] they can hold in their head. If we have these sorts of [56:17.740 --> 56:22.160] representation schemes that are self correcting, people can [56:22.160 --> 56:28.040] remember more. Stuff will work better. So the general idea, [56:28.040 --> 56:32.060] brain wallet and mini lock need human memorable entropy. Actual [56:32.060 --> 56:36.180] security needs more entropy. This story bit system increases [56:36.180 --> 56:40.780] memorable entropy. Now there is some interesting variations on [56:40.780 --> 56:43.520] the scheme. You can go ahead, you can have what we call split [56:43.520 --> 56:49.140] mode where you have a normal password you use. It allows [56:49.140 --> 56:53.260] things to work. It will take like two hours to crack a key. [56:53.500 --> 56:57.160] And then you have like a secondary password that's really [56:57.160 --> 57:01.400] there to allow for key exchange. So moving a key from one location [57:01.400 --> 57:06.020] to another. So that can be set to take a few seconds while the [57:06.020 --> 57:08.940] slow mode, the one that's really in your head, that one might [57:08.940 --> 57:13.020] take hours and hours. The general idea is that, yeah, it [57:13.020 --> 57:16.920] might take you hours and hours but the relative slow down to [57:16.920 --> 57:19.940] the attacker that's trying to brute force your keys from the [57:19.940 --> 57:23.140] public key, that guy is just screwed. Because he has to run [57:23.140 --> 57:26.660] an attempt only one every few hours, a couple of attempts a [57:26.660 --> 57:28.920] day. He can wait until the end of time and he's not going to [57:28.920 --> 57:34.040] get your money. Two more tricks that we can do. These aren't [57:35.180 --> 57:40.220] necessarily good ideas but we're hackers. Good ideas are not [57:40.220 --> 57:47.960] exactly required here. It is an argument that no matter how you [57:47.960 --> 57:53.200] slice it, at minimum it's easier to remember 24 bits than to [57:53.200 --> 58:00.460] remember 80 to 128 bits. So there has long been a desire on [58:00.460 --> 58:05.660] the part of software developers who are presenting a key for [58:05.660 --> 58:10.020] memory to have, here's the full fingerprint which we understand [58:10.020 --> 58:13.780] you can't remember and here's a shrunk down version of it. [58:13.780 --> 58:18.220] Here's the PGP key ID. Here's the RSA ID. Here's some smaller [58:18.220 --> 58:21.660] amount of bits. And the problem is, from the attacker's [58:21.660 --> 58:25.740] standpoint, they're like, great, I don't need to collide with the [58:25.740 --> 58:30.900] big thing. I just need to match this 24 bits. It will take me a [58:30.900 --> 58:35.380] little bit of math but it won't be that bad. So here's the [58:35.380 --> 58:40.580] scheme that you can do. If the user can remember even a small [58:40.580 --> 58:44.640] passphrase that is never submitted to the server, that [58:44.640 --> 58:49.420] passphrase can be a sort of shrinker or a bit limiter. So [58:49.420 --> 58:53.100] you take the full hash, you hash it with the passphrase, you [58:53.100 --> 58:58.780] truncate the results. So the attacker still has to match all [58:58.780 --> 59:04.900] 128 bits, doesn't know the passphrase. Doesn't know what [59:04.900 --> 59:08.280] the 24 bits are that he actually does need to collide [59:08.280 --> 59:13.800] with. So this is going ahead and creating a differential between [59:13.800 --> 59:17.680] the work effort of the bad guy and the work effort of the good [59:17.680 --> 59:22.580] guy. You want things to be easier for the good guy. He has [59:22.680 --> 59:26.660] a cost. Your legitimate user has to remember something. But the [59:26.660 --> 59:30.900] idea is ten people who are trying to remember the same key [59:30.900 --> 59:35.880] each have their own personal recognition appearance. It's [59:35.880 --> 59:40.380] like they see the same face but for themselves every time they [59:40.380 --> 59:43.360] see someone's face it's the same face. But ten people are seeing [59:43.360 --> 59:46.260] ten different faces. It doesn't matter. They just need to see [59:46.260 --> 59:51.360] the same face for themselves. Does that make sense? There's a [59:51.360 --> 59:54.600] way of doing this in the opposite direction called local [59:54.600 --> 01:00:00.080] stretching. There is a problem where you have some password [01:00:00.900 --> 01:00:07.320] server. It's not particularly doing any work to make it so [01:00:07.320 --> 01:00:10.200] when somebody compromises the password store, because we know [01:00:10.200 --> 01:00:15.360] it happens a lot, that the attacker can't go ahead and [01:00:15.360 --> 01:00:18.500] figure out, aha, I got the password store, now I've got the [01:00:18.500 --> 01:00:24.560] plain text password. What you could do is have the stretching, [01:00:24.560 --> 01:00:29.500] the complexifier of the password actually happen in the client. [01:00:29.500 --> 01:00:35.220] So it's like, yeah, the user is remembering ABC123 but it's [01:00:35.220 --> 01:00:39.460] being expanded out a billion times before it's ever sent to [01:00:39.460 --> 01:00:46.360] the server. Where things get messy in having basically [01:00:46.360 --> 01:00:50.600] software generate the passphrase, the one that is the [01:00:50.600 --> 01:00:55.540] actual password for a server, is every freaking website has its [01:00:55.540 --> 01:00:59.700] own rules for what a password has to look like. Oh, it has to [01:00:59.700 --> 01:01:04.140] have symbols. It must not have symbols. It has to have three [01:01:04.140 --> 01:01:08.440] numbers, two numbers, eight numbers. By the way, going from [01:01:08.600 --> 01:01:10.660] a scheme that has to have a letter to a scheme that has to [01:01:10.660 --> 01:01:13.680] have a number, you know there are more letters than numbers. [01:01:14.500 --> 01:01:21.800] You kind of just made things worse. What you can do is a kind [01:01:21.800 --> 01:01:26.540] of a cute trick. And that is you can examine the pattern of [01:01:26.540 --> 01:01:29.660] the passphrase that was provided by the user. So the user says [01:01:30.880 --> 01:01:34.980] ABC123 with a symbol. And that can be interpreted as requires [01:01:34.980 --> 01:01:37.980] three numbers and a symbol. And then that is what is actually [01:01:38.600 --> 01:01:44.180] stretched or expanded out. So it's inferred discovery of [01:01:44.180 --> 01:01:50.640] password policies. Kind of a neat trick. So now we've gone [01:01:50.640 --> 01:01:54.200] ahead and we've gone into pretty amount of detail on how [01:01:54.200 --> 01:01:57.820] we generate random numbers. And we've also talked about how we [01:01:57.820 --> 01:02:01.780] represent arbitrary data. Now let's talk about some ODA, okay? [01:02:02.980 --> 01:02:06.820] The other shoe has kind of dropped. IE had more attacks in [01:02:06.820 --> 01:02:10.520] 2013 than Java. And you know how much we love making fun of [01:02:10.520 --> 01:02:16.080] Java. How is this possible? IE at Microsoft has been working to [01:02:16.080 --> 01:02:22.980] secure IE for a decade. How is it that things have fallen so [01:02:22.980 --> 01:02:35.800] far? So, excuse me one sec. Got some water in me. Here's the [01:02:35.800 --> 01:02:42.280] deal, guys. Anyone remember way, way back in the day when [01:02:42.280 --> 01:02:45.800] Microsoft was just like, you know, Internet Explorer is just [01:02:45.800 --> 01:02:48.980] Windows. Like, they can't be separated. Are you crazy? [01:02:50.040 --> 01:02:54.100] Everyone thought that they were lying, they were full of it. And [01:02:54.100 --> 01:02:57.720] you actually look at Internet Explorer, that damn thing is [01:02:57.720 --> 01:03:01.700] Windows the remix featuring the Internet, okay? It really is [01:03:01.700 --> 01:03:06.000] Windows. You have this object model that was built back in the [01:03:06.000 --> 01:03:09.200] 90s called Calm. And they're like, hell, let's go put that on [01:03:09.200 --> 01:03:12.980] the Internet. It's like if you put mem copy on the Internet, [01:03:12.980 --> 01:03:15.440] okay? Like, hey, you know, we've got this API here. It takes [01:03:15.440 --> 01:03:21.240] bytes from somewhere and puts it somewhere else. What, you want [01:03:21.240 --> 01:03:27.740] it secure now? We barely have this working. And don't worry, [01:03:27.740 --> 01:03:30.680] because of the nature of browsers, because they're all [01:03:30.680 --> 01:03:34.600] implementing the same standards, everybody ended up with [01:03:34.600 --> 01:03:38.380] something that looked pretty much exactly like Calm. Like, [01:03:38.380 --> 01:03:43.200] for example, XP Calm from Firefox. It's not exactly [01:03:43.200 --> 01:03:45.760] subtle. I mean, it is literally what's called an interface [01:03:46.360 --> 01:03:50.260] description language literally built into the very standards of [01:03:50.260 --> 01:03:55.920] the web. This is how it would have to work. Yes, attackers [01:03:55.920 --> 01:03:58.960] loved attacking plug-ins. Because it didn't matter if you [01:03:58.960 --> 01:04:05.300] were attacking IE or Firefox or Chrome, it was still Java, write [01:04:05.300 --> 01:04:09.020] once, own everywhere. You didn't have to customize it at all. You [01:04:09.020 --> 01:04:12.280] even got to escape all these weird little sandboxes that the [01:04:12.280 --> 01:04:18.220] attackers were messing around with. And so, you know, as has [01:04:18.220 --> 01:04:23.960] finally come out, my Tor de-anonymization has a first [01:04:23.960 --> 01:04:32.840] name. It's Firefoxoday, as the gruk might sing. Vulnerabilities [01:04:32.840 --> 01:04:36.680] in the raw browsers have taken over vulnerabilities in their [01:04:36.680 --> 01:04:41.900] plug-ins. And that's because we've been exposing the [01:04:41.900 --> 01:04:44.140] underlying object model to something that it was never [01:04:44.140 --> 01:04:50.920] really designed to be exposed to from bad guys. Browsers, in [01:04:50.920 --> 01:04:56.000] their normal operation, are constantly allocating memory and [01:04:56.000 --> 01:05:00.760] associating a type with it. This pointer is to a table. This [01:05:00.760 --> 01:05:04.360] pointer is to an image. Now, if you're going to be constantly [01:05:04.360 --> 01:05:08.220] allocating memory, you've got to free it at some point, right? [01:05:08.220 --> 01:05:12.440] You've got to reuse that memory. So what happens is, a [01:05:12.440 --> 01:05:16.260] pointer starts out and it's pointing to a table. And [01:05:16.260 --> 01:05:19.720] eventually, the system says, user's moved on to a new web [01:05:19.720 --> 01:05:23.860] page. I don't need that table anymore. And so that pointer is [01:05:23.860 --> 01:05:28.560] free. And then later, it says, ah, I've got space. Let's go [01:05:28.560 --> 01:05:33.300] make an image. Let's put an image there. Problem is, if [01:05:33.300 --> 01:05:35.880] you've looked at JavaScript, there's like a million ways to [01:05:35.880 --> 01:05:40.040] have a pointer to a pointer to a pointer. This table has an [01:05:40.040 --> 01:05:42.980] image inside of it. This image has a CSS thing inside of it, [01:05:42.980 --> 01:05:46.420] which has a link back to another image. There's a billion ways [01:05:46.420 --> 01:05:50.180] for objects in HTML and JavaScript to point to another. [01:05:50.640 --> 01:05:55.200] And if you ever get the system screwing up, getting it to free [01:05:55.200 --> 01:05:59.920] memory, and it still has some pointer still pointing to it, [01:05:59.920 --> 01:06:05.440] you now have two object contexts, one pointer. And that [01:06:05.440 --> 01:06:10.000] also works about as well as you'd hope. So use after free, [01:06:10.000 --> 01:06:13.580] that's when you have two different contexts in one. Use [01:06:13.580 --> 01:06:16.980] after free is something like 90 to 98 percent of the [01:06:16.980 --> 01:06:21.660] undiscovered vulnerabilities in browsers today. And it's a real [01:06:21.660 --> 01:06:27.180] problem and it's not going away. Except that it kind of is. [01:06:27.380 --> 01:06:29.620] Google and Microsoft are actually doing some pretty [01:06:29.620 --> 01:06:34.660] serious things to deal with use after free. The Google solution [01:06:34.660 --> 01:06:38.840] is a typed heap. So what they're saying is, we're going to keep [01:06:38.840 --> 01:06:42.600] all the tables together. We're going to keep all the images [01:06:42.600 --> 01:06:46.880] together. So when you go back and make a second allocation, [01:06:46.880 --> 01:06:50.220] everything is with its peers. You don't get some situation [01:06:50.220 --> 01:06:54.740] where you use a method of an image on a table. You use a [01:06:54.740 --> 01:06:58.400] method of a table on an image. Because everything is sticking [01:06:58.400 --> 01:07:03.620] together. And this actually makes it incredibly harder to go [01:07:03.620 --> 01:07:07.600] ahead and exploit vulnerabilities. Microsoft as [01:07:07.600 --> 01:07:11.580] well is doing stuff. They're doing a lot of things. But the [01:07:11.580 --> 01:07:14.500] fundamental advantage of their approach is what's called [01:07:14.500 --> 01:07:19.260] non-deterministic fuzzing or freeing. They're making it so [01:07:19.260 --> 01:07:22.920] the attacker never quite knows if they go ahead and pull their [01:07:22.920 --> 01:07:28.280] stunt, it's going to work. It might work, it could work, but [01:07:28.280 --> 01:07:33.400] they don't know it will. This is great. This is attacking the [01:07:33.400 --> 01:07:38.280] unique needs of an exploit. This is counter exploitation. Sure, [01:07:38.280 --> 01:07:41.060] you have probabilistic likelihood, but your [01:07:41.060 --> 01:07:46.760] requirement, your need is guaranteed reliability. So [01:07:46.760 --> 01:07:52.400] Microsoft is playing that game. I got a trick. A trick called [01:07:52.400 --> 01:07:56.620] Iron Heap. Named by the inestimable Rob Graham. And the [01:07:56.620 --> 01:08:01.760] idea is really simple. You can't use after free if you just don't [01:08:01.760 --> 01:08:09.940] have free memory. Nope. That's not going to do it. There's a [01:08:09.940 --> 01:08:14.240] little bit of a problem with this, you might know. We don't [01:08:14.240 --> 01:08:16.740] actually have an infinite amount of physical memory. But you [01:08:16.740 --> 01:08:21.700] know, on 64 bit machines we have an awfully large amount of [01:08:21.700 --> 01:08:27.060] virtual memory. So the basic idea is we never reuse an [01:08:27.060 --> 01:08:32.060] allocation. Your virtual memory space is 64 bits long and is [01:08:32.060 --> 01:08:36.360] basically mapped. Say this chunk of the address space points to [01:08:36.360 --> 01:08:41.040] this page and this chunk points to that page. You keep reusing [01:08:41.040 --> 01:08:43.880] physical memory, but the pointers, the stuff that's [01:08:43.880 --> 01:08:47.920] actually exposed to user space, the addresses that are actually [01:08:48.840 --> 01:08:52.500] exploitable by the various use after free techniques, they're [01:08:52.500 --> 01:08:57.220] never reused. Because you just have so much room. Look, we've [01:08:57.220 --> 01:09:01.420] only had 64 bit browsers really for a very short amount of time. [01:09:01.420 --> 01:09:06.380] This is the best possible use of 64 bit space. So the idea is [01:09:06.380 --> 01:09:13.200] that 0x1234123412341234, once it's freed, that's it. It never [01:09:13.200 --> 01:09:18.700] points again to an image or a CSS script or a JavaScript. That [01:09:18.700 --> 01:09:26.900] page stays unmapped forever. Exploit that. So we've got to do [01:09:26.900 --> 01:09:32.420] some stuff to make this efficient. You can only have a [01:09:32.420 --> 01:09:35.680] finite number of active allocations. The reason this can [01:09:35.680 --> 01:09:39.920] work at all is because there's actually hardware acceleration. [01:09:39.920 --> 01:09:44.220] There's what's called a memory management unit that very [01:09:44.560 --> 01:09:48.460] quickly allows a process to say, hey, I'm accessing this virtual [01:09:48.460 --> 01:09:52.260] fake address, make it really quick for me to go ahead and [01:09:52.260 --> 01:09:56.500] figure out what page of memory has the real content. Make it [01:09:56.500 --> 01:10:00.920] really quick for me to find out there is no page. You can't have [01:10:00.920 --> 01:10:05.240] an infinite amount of these mappings. But you don't need an [01:10:05.240 --> 01:10:08.040] infinite amount of these mappings. You need to have like [01:10:08.040 --> 01:10:16.460] the top 10,000. The top 15,000. Anything else can swap. Guess [01:10:16.460 --> 01:10:23.480] what? Machines swap. Maybe to disk, maybe to more RAM. But the [01:10:23.480 --> 01:10:27.180] idea is you handle the case where it's the .01 percent of [01:10:27.180 --> 01:10:30.680] the time. The other trick you can of course do is what's [01:10:30.680 --> 01:10:34.660] called having guard pages. So that means you have unallocated [01:10:34.660 --> 01:10:39.400] space between allocations. This gets a little fat because now [01:10:39.400 --> 01:10:42.020] you have to have 8 kilobytes used every time even if you have [01:10:42.020 --> 01:10:45.980] like an 8 byte allocation. And that sort of sucks. But again, [01:10:45.980 --> 01:10:48.940] you can do this probabilistically. You don't [01:10:48.940 --> 01:10:52.360] always have to go ahead and make an exploit work. You just have [01:10:52.360 --> 01:10:55.380] to make it a nightmare enough so the attacker never really knows [01:10:55.380 --> 01:10:59.940] if this stuff is going to work or not. That is cheating. Good. [01:10:59.940 --> 01:11:04.640] We get to cheat. We're defenders. Implementation wise, [01:11:04.640 --> 01:11:09.000] this can be done entirely in user space. So, you know, you [01:11:09.000 --> 01:11:12.620] manage memory in user space. You handle the exception when it's [01:11:12.620 --> 01:11:16.560] unmapped. You populate it in the exception. It can be run in [01:11:16.560 --> 01:11:19.980] the kernel because kernels are already managing page tables. I [01:11:19.980 --> 01:11:22.180] don't object to doing this in the kernel. I don't object to [01:11:22.180 --> 01:11:25.540] kernel modules. I'm willing to say the operating system needs [01:11:25.540 --> 01:11:29.600] to adapt to the new needs of software. If I don't, you know, [01:11:29.600 --> 01:11:33.280] right now to figure out what permissions are on a page in [01:11:33.280 --> 01:11:36.100] Linux, you know, parse a freaking text file out of the [01:11:36.100 --> 01:11:42.180] proc file system. We can be more efficient than that. Downsides [01:11:42.180 --> 01:11:45.580] of Iron Heap. One, there's no code yet. Just some proof of [01:11:45.580 --> 01:11:50.920] concepts. And two, it really does lean on 64 bit. And [01:11:50.920 --> 01:11:55.580] browsers, particularly Flash, aren't entirely fantastic at 64 [01:11:55.580 --> 01:11:59.400] bit yet. This is true and it matters. People like their [01:11:59.400 --> 01:12:04.640] freaking Flash. So, what may work today is a piece of [01:12:04.640 --> 01:12:07.200] software that got really, I don't want to say popular, but [01:12:07.200 --> 01:12:12.200] was being developed around 2007, 2008. A piece of code [01:12:12.200 --> 01:12:15.000] called Die Hard. It's an interesting secure allocator [01:12:15.000 --> 01:12:18.780] from Emery Berger over at UMass. It was an advanced ASLR [01:12:18.780 --> 01:12:22.740] implementation without a band heat metadata. It's a long way [01:12:22.740 --> 01:12:26.220] of saying when you allocate memory, it goes to hard to [01:12:26.220 --> 01:12:28.200] predict pointers. You don't really know where it's going to [01:12:28.200 --> 01:12:31.500] be and you don't have obvious things for you to corrupt. [01:12:32.240 --> 01:12:35.060] Suppresses use after free in a way very similar to the [01:12:35.060 --> 01:12:40.180] Microsoft allocators. So, you don't know when the memory is [01:12:40.180 --> 01:12:43.720] actually free. It is eventually, but, you know, Internet [01:12:43.720 --> 01:12:46.360] Explorer actually has a command that says run the garbage [01:12:46.360 --> 01:12:55.000] collector now. Like, it's not so good. The big thing about Die [01:12:55.000 --> 01:12:58.860] Hard is that they're available today. There's code for [01:12:58.860 --> 01:13:03.340] Windows, there's code for Mac, there's code for Linux. Probably [01:13:03.340 --> 01:13:07.360] worth exploring for tails. There's something different [01:13:07.360 --> 01:13:12.520] about this stuff. So, when we have normal ASLR for like [01:13:12.520 --> 01:13:16.060] loading libraries, we have what's called NX which means you [01:13:16.060 --> 01:13:19.100] can't execute code that you throw into the stack or heap [01:13:19.100 --> 01:13:24.120] somewhere. A lot of other defenses assume the corruption [01:13:24.120 --> 01:13:28.800] has occurred and say now that it's occurred, let's make it [01:13:28.800 --> 01:13:34.080] really tough to figure out what to do. What the end game is [01:13:34.080 --> 01:13:36.880] that leads to arbitrary code execution. Yes, you've [01:13:36.880 --> 01:13:41.160] corrupted but you don't have a path. And this class of defense [01:13:41.160 --> 01:13:45.400] is different because you're actually preventing the initial [01:13:45.400 --> 01:13:51.800] corrupting moment. If you don't have the free complete, the use [01:13:51.800 --> 01:13:56.840] after free can never start. There is nothing going on in [01:13:56.840 --> 01:14:00.680] infosec that is killing more O day than use after free [01:14:00.680 --> 01:14:04.740] killers. You cannot imagine how many undiscovered bones are in [01:14:04.740 --> 01:14:07.500] this space. I still remember the first time I wrote a fuzzer that [01:14:07.500 --> 01:14:12.360] found these stuff. Come to work every morning, it's like, ooh, [01:14:12.360 --> 01:14:15.800] look at all these, like dozens. Can I just say by the way, [01:14:15.800 --> 01:14:18.640] whenever like people who actually write fuzzers hear [01:14:18.640 --> 01:14:24.500] things like, and they used four O days. It's like, dude, I found [01:14:24.500 --> 01:14:29.240] four O days at lunch. Like really, you get the pattern down [01:14:29.240 --> 01:14:36.840] in quantity. So here's the plan, okay? IE has got a story around [01:14:36.840 --> 01:14:41.420] use after free. Chrome has got a story around use after free. [01:14:43.080 --> 01:14:46.520] Firefox has got some O day. Firefox needs a story around [01:14:46.520 --> 01:14:51.260] memory hardening. So it's going to take some time and it's going [01:14:51.260 --> 01:14:53.740] to be hard to convince them to give up their beautiful memory [01:14:53.740 --> 01:14:59.700] allocator gem alloc. But we're going to put together an actual [01:15:01.240 --> 01:15:05.280] strong secure allocator for production Firefox in the field [01:15:05.280 --> 01:15:07.940] today. We're going to start by building this for the Tor [01:15:07.940 --> 01:15:11.980] browser combinations, for the tails environment. We're going [01:15:11.980 --> 01:15:14.440] to get it so that it is indistinguishable performance [01:15:14.440 --> 01:15:18.940] wise from real native Firefox. It's not going to be me alone [01:15:18.940 --> 01:15:21.880] doing this as a white ops project and I actually have [01:15:21.880 --> 01:15:26.560] managed to recruit Dr. Emery Berger, creator of DieHard. We're [01:15:26.560 --> 01:15:29.220] going to go ahead, we're going to get Firefox a heck of a lot [01:15:29.220 --> 01:15:41.070] safer. So that's what we're up to. Dr. Berger actually came on [01:15:41.070 --> 01:15:45.650] board about 80 minutes ago, so I'm really excited to be [01:15:45.650 --> 01:15:49.690] announcing this. I'm like, dude, you want to join us? He's like, [01:15:49.690 --> 01:15:57.030] hell yeah. So that's what we're going to do about browsers. Now [01:15:57.030 --> 01:16:00.830] we've got to talk about DDoS. We're almost there. A little bit [01:16:00.830 --> 01:16:04.950] left. Everyone having fun here? I know I'm nerding out like [01:16:04.950 --> 01:16:15.900] crazy. All right. So we've got to talk about DDoS here because [01:16:17.100 --> 01:16:21.480] the bad guys are filling up our pipes. Series of tubes getting [01:16:21.480 --> 01:16:29.240] clogged here. We had all of 100 gigabit flood in 2013. We've had [01:16:29.240 --> 01:16:35.940] like 114 in 2014, okay? Like the bad guys are making a mess of [01:16:35.940 --> 01:16:43.500] things. I had assumed that DDoS had just turned into botnets. You [01:16:43.500 --> 01:16:46.200] know, you've got millions of desktops, you fire them all on [01:16:46.200 --> 01:16:49.280] some website, they all have full stacks, there's millions of [01:16:49.280 --> 01:16:55.880] machines, life sucks. It turns out the biggest and ugliest of [01:16:55.880 --> 01:17:01.220] the DDoS's are actually something else. They're not [01:17:01.220 --> 01:17:06.120] using desktop machines, they're using DNS servers. That's my [01:17:06.120 --> 01:17:12.360] protocol, dammit. Using NTP servers. They're lying about [01:17:12.360 --> 01:17:15.480] their source address, they're pinging some machine on the [01:17:15.480 --> 01:17:18.540] internet, they're causing those machines to reply to some poor [01:17:18.540 --> 01:17:23.940] target and it is filling everything up. And I want to [01:17:23.940 --> 01:17:28.860] take a minute to explain why this variation is quite so [01:17:28.860 --> 01:17:37.340] damaging. So here's the deal. I am a terrible artist. But I've [01:17:37.340 --> 01:17:43.660] tried to draw the internet. So what we've got here is you've [01:17:43.660 --> 01:17:47.240] got some source and if you're going to go down one network [01:17:47.240 --> 01:17:49.420] path you'll take the left fork and the other one you'll take [01:17:49.420 --> 01:17:55.420] the right fork. It spreads out and eventually as you get closer [01:17:55.420 --> 01:17:58.240] and closer to the destination there are fewer and fewer paths [01:17:58.240 --> 01:18:00.980] and finally you're at the destination. Does that make [01:18:00.980 --> 01:18:05.420] sense? Depending on where you go, you have a fan out and then [01:18:05.540 --> 01:18:11.820] a fan in. Now if you're flooding a single destination, all your [01:18:11.820 --> 01:18:17.180] traffic takes pretty much one route. It goes down, down, up, [01:18:17.180 --> 01:18:23.040] up, down. And that's the one route 99.9% of your traffic is [01:18:23.040 --> 01:18:27.820] going to take. So the most bandwidth you can consume is the [01:18:27.820 --> 01:18:33.560] least bandwidth of any of these hops. But now, now let's say [01:18:33.560 --> 01:18:37.060] we're going to reflect off of machines all around the [01:18:37.060 --> 01:18:42.560] internet. What happens is, is that your traffic fans out in [01:18:42.560 --> 01:18:46.620] all possible directions, hits all of these various name [01:18:46.620 --> 01:18:52.020] servers, each of which has their own fastest route back to some [01:18:52.020 --> 01:18:55.660] poor network. And I don't know if you can see it, but the [01:18:55.660 --> 01:19:01.380] entire damn network is red. Boom. This is what's going on. [01:19:01.820 --> 01:19:05.680] And it's ugly and it's not going away. So what are we going to [01:19:05.680 --> 01:19:09.980] do? Are we going to lose our toy? I don't want to lose my [01:19:09.980 --> 01:19:14.740] toy. I like my toy. I like my kitties on Roombas, damn it. So [01:19:14.740 --> 01:19:19.360] what are we going to do? Ideally there's this thing called [01:19:19.360 --> 01:19:24.560] BCP38. Ideally there's a technology called URPF. Ideally [01:19:25.360 --> 01:19:29.080] networks couldn't lie. So you can't be in the middle of San [01:19:29.080 --> 01:19:34.380] Francisco and be like, hey, I'm poor schlub in London and I want [01:19:34.380 --> 01:19:43.360] this DNS supply. Yeah. I'm not saying that this is a bad idea. [01:19:43.360 --> 01:19:47.540] I'm just saying there's a heck of a lot of networks out there [01:19:47.540 --> 01:19:52.680] that don't give a crap about filtering routes. The [01:19:52.680 --> 01:19:56.580] technology, I'm not saying it doesn't scale, but it totally [01:19:56.580 --> 01:20:00.920] doesn't scale. Effectively the technology works by dropping [01:20:00.920 --> 01:20:04.580] traffic. You know what ISPs don't like doing? Dropping [01:20:04.580 --> 01:20:07.820] traffic. It fails once in the field. They're like, I'm never [01:20:07.820 --> 01:20:11.460] turning this back on again. I'm not saying we shouldn't continue [01:20:11.460 --> 01:20:15.760] to strive for BCP38 compliance. Some crazy paper came out a while [01:20:15.760 --> 01:20:20.320] ago. They found at least 2,300 networks that don't have it. You [01:20:20.320 --> 01:20:24.700] only get the real advantage of BCP38 when it's almost entirely [01:20:24.700 --> 01:20:29.900] universal. Now, it's been a tremendous success for cable [01:20:29.900 --> 01:20:33.580] modems, for DSL lines, even for a bunch of corporate [01:20:33.580 --> 01:20:39.300] environments. But the really big pipes that are really able to do [01:20:39.300 --> 01:20:42.860] huge reflection attacks, they're not getting secured anytime [01:20:42.860 --> 01:20:46.860] soon. At least not if we can't bust them a hell of a lot [01:20:46.860 --> 01:20:51.120] quicker. So, I'm going to bust them. Here's what we're going to [01:20:51.120 --> 01:20:56.140] do. We're going to bring back an old idea called stochastic [01:20:56.140 --> 01:21:00.520] tracing. I did not come up with this idea. Maybe I've refined it [01:21:00.600 --> 01:21:04.760] a bit. First heard this idea about 12 or 13 years ago. And [01:21:04.760 --> 01:21:09.340] the idea is you've got a router and one out of maybe a million [01:21:09.340 --> 01:21:14.340] packets, it says, hi, I'm this router and I routed some [01:21:14.340 --> 01:21:18.240] traffic to you. Doesn't do anything for your standard [01:21:18.240 --> 01:21:21.280] normal flows. But if you've got a router that's being made to [01:21:21.280 --> 01:21:24.200] move billions and billions of packets, you're going to end up [01:21:24.200 --> 01:21:28.260] with a nice stream of hundreds and hundreds of tracers. And [01:21:28.260 --> 01:21:32.580] these things actually incrementally improve the [01:21:32.580 --> 01:21:36.400] internet over time. Because there's more and more traces and [01:21:36.400 --> 01:21:39.420] it's harder and harder for an attacker to know whether or not [01:21:39.420 --> 01:21:42.640] their spoofed traffic is going to be quickly detected back to [01:21:42.640 --> 01:21:48.300] them. As it happens, routers have most of the technology [01:21:48.300 --> 01:21:51.830] necessary to already do this. It's very simple to configure a [01:21:51.830 --> 01:21:55.570] router to do what's called a GRE stream. To say, please send [01:21:55.570 --> 01:21:59.470] me one out of every million packets. That can go to an [01:22:00.010 --> 01:22:02.690] individual daemon, we don't need to patch the router for God's [01:22:02.690 --> 01:22:06.990] sake. We can go to a daemon, the daemon can go ahead and send [01:22:06.990 --> 01:22:10.250] this trace packet. What does it actually mean to send a trace? [01:22:10.410 --> 01:22:14.230] Because by the way, I don't want random people on the internet [01:22:14.710 --> 01:22:17.150] knowing all the traffic that I'm receiving. I don't even want [01:22:17.150 --> 01:22:21.750] them knowing my DDoFs. So the idea is the traces go to the [01:22:21.750 --> 01:22:27.810] destination of the flows. And maybe the source. There are only [01:22:27.810 --> 01:22:31.930] two IPs that are really supposed to be seeing traffic and it's [01:22:31.930 --> 01:22:35.850] the source and destination IP. So if you're spoofing traffic, I [01:22:35.850 --> 01:22:38.930] don't think you have an expectation of privacy for the [01:22:38.930 --> 01:22:42.690] network to hide that you are lying about being the guy in [01:22:42.690 --> 01:22:46.550] London. What does the payload actually look like? That's a [01:22:46.550 --> 01:22:49.870] good question. Do we encapsulate this in ICMP? Do we make an HTTP [01:22:49.870 --> 01:22:54.210] post? I don't know. All I know is if you're on the internet, [01:22:54.210 --> 01:22:57.390] you're already receiving crap. I know this because I'm sending [01:22:57.390 --> 01:23:05.790] you crap. And you haven't crashed yet, I think. There's an [01:23:05.790 --> 01:23:09.210] alternate option. This of course comes back to my own history in [01:23:09.210 --> 01:23:16.130] DNS. Sometimes it's a pain in the butt to hijack, say, all the [01:23:16.130 --> 01:23:19.590] trace traffic that's coming out of ICMP to an IP or HTTP to an [01:23:19.590 --> 01:23:24.530] IP. That might actually be hard. There's a space called reverse [01:23:24.530 --> 01:23:34.230] DNS. 4.3.2.1.inattr.arpa can say my DNS name is blahblah.foo.com [01:23:34.230 --> 01:23:39.470] with what's called a PTR record. You can actually host more than [01:23:39.470 --> 01:23:43.710] just PTR records inside of reverse DNS. So you could host [01:23:43.710 --> 01:23:47.730] something that actually says, yeah, I know you're trying to [01:23:47.730 --> 01:23:53.170] do tracing for 1.2.3.4. Here's the server that accepts those [01:23:53.170 --> 01:23:57.310] trace packets. And it's still trust associated with the IP. [01:23:57.310 --> 01:24:01.870] It's very nice. Obviously we want to assign trace payloads. [01:24:01.870 --> 01:24:04.330] Otherwise you can spoof a whole bunch of things and be like, [01:24:04.330 --> 01:24:08.410] yeah, I'm totally Verizon moving all this traffic. Go harass [01:24:08.410 --> 01:24:11.770] Verizon. So we've got to prevent that and we can do that with [01:24:11.770 --> 01:24:18.230] ED25519 keys. So that can work. The long term vision is to [01:24:18.230 --> 01:24:22.790] reduce the time between a DDoS and tracing the involved [01:24:22.790 --> 01:24:27.450] networks. We've got to make this stuff happen faster. Ultimately [01:24:27.450 --> 01:24:30.830] what we need to do is we need to get to the point where DDoS is [01:24:30.830 --> 01:24:35.210] automatically suppressed. Where there can be firewall rules that [01:24:35.210 --> 01:24:39.710] are automatically applied. Now this is rough. Because there's a [01:24:39.710 --> 01:24:42.950] lot of hops that are going to see enough to be able to request [01:24:42.950 --> 01:24:47.290] firewalling. So I don't know exactly how this works. But what [01:24:47.290 --> 01:24:51.530] I do know is that these floods are growing fast enough and nasty [01:24:51.530 --> 01:24:55.830] enough that we may actually get the greatly feared congestion [01:24:55.830 --> 01:25:00.950] collapse. There may actually be entire countries, entire regions [01:25:00.950 --> 01:25:04.310] of the globe that just have too much traffic for anything to [01:25:04.310 --> 01:25:08.670] work. And I think Paul Vixen would kill me if I didn't say, [01:25:08.670 --> 01:25:11.230] by the way, you know, we can, like, patch name servers. We [01:25:11.230 --> 01:25:15.090] don't participate in this anymore. Call RRD. But [01:25:15.090 --> 01:25:20.570] unfortunately it requires so many hosts to upgrade versus this [01:25:20.570 --> 01:25:25.550] kind of stuff which is just incrementally improving. So [01:25:25.550 --> 01:25:29.850] let's talk about practically the last thing I wanted to discuss [01:25:29.850 --> 01:25:33.350] in this epically long talk today. I don't know why I said I [01:25:33.350 --> 01:25:37.050] wanted a two-hour talk. Am I trying to kill myself here? All [01:25:37.050 --> 01:25:42.950] right. Can't just not talk about this whole NSA thing. Can't [01:25:42.950 --> 01:25:51.830] just leave it to Bruce Schneier. I love Bruce. I'm worried. I'm [01:25:51.830 --> 01:25:57.070] worried about the long-term reaction to the NSA revelations. [01:25:57.090 --> 01:26:03.230] See, there are two ways that you can win in technology. You can [01:26:03.230 --> 01:26:08.850] have the better technology or you can have FUD. Oh sure, you [01:26:08.850 --> 01:26:12.270] can go with that competitor. They're cheaper, faster, nicer, [01:26:12.270 --> 01:26:17.010] more powerful, but ooga booga nation state. This sounds [01:26:17.010 --> 01:26:20.930] ridiculous until you realize there really are proposals to go [01:26:20.930 --> 01:26:24.670] ahead and keep all traffic within a country within a [01:26:24.670 --> 01:26:28.930] country. This is really, sure BGP says this route is faster, [01:26:28.930 --> 01:26:31.750] better, easier, but the law says you have to keep it within our [01:26:31.750 --> 01:26:38.490] borders where we can monitor it all. Thank you very much. The [01:26:38.490 --> 01:26:41.690] Internet, again, was not the first time we tried to make the [01:26:41.690 --> 01:26:44.730] Internet. It was the first one that worked at large scale [01:26:44.730 --> 01:26:49.570] because you didn't have this sort of political interference. [01:26:49.950 --> 01:26:53.450] This was the network made by nerds who had one thing they [01:26:53.450 --> 01:26:57.010] wanted which was make this work, make this work as fast as [01:26:57.010 --> 01:27:00.970] possible. And a lot of these political actors have a [01:27:00.970 --> 01:27:05.330] different goal in mind. You know, we didn't want the [01:27:05.330 --> 01:27:10.090] Chinese Internet or the Iranian Internet before Snowden. I hope [01:27:10.090 --> 01:27:14.590] we don't want that now. But I look out there and I look at the [01:27:14.590 --> 01:27:21.350] reactions to the NSA and especially their manipulation of [01:27:21.350 --> 01:27:25.250] crypto standards and there really is only one thing I can [01:27:25.250 --> 01:27:33.010] think. You maniacs! You finally did it! You blew it all up! Damn [01:27:33.010 --> 01:27:50.070] you to hell! Let me tell you the honest truth about cryptography. [01:27:50.070 --> 01:27:54.410] And if you don't know, the NSA pushed and got a broken crypto [01:27:54.410 --> 01:27:58.890] standard into, well, they wanted to have everyone use it but [01:27:58.890 --> 01:28:07.390] really they only screwed other feds. There's a reason we were [01:28:07.390 --> 01:28:11.210] asking the NSA's advice for cryptographic vulnerabilities. [01:28:11.210 --> 01:28:17.290] Okay? Most crypto functions do not need the NSA's help to suck. [01:28:17.290 --> 01:28:25.690] They get that for free. Okay? It takes like 10 years to figure [01:28:25.690 --> 01:28:31.350] out that a cypher or a hash or whatever might actually be safe. [01:28:31.830 --> 01:28:37.810] And the NSA has actually been pretty good at saying, something's [01:28:37.810 --> 01:28:41.770] wrong here. This thing in Ness, it's not good. This thing in [01:28:41.770 --> 01:28:58.380] Shaw Zero, it's not good. Excuse me, I'm out. You know, it sucks. [01:28:58.380 --> 01:29:02.800] Wouldn't it be nice if we had like a department of the [01:29:02.800 --> 01:29:09.120] government that was dedicated to defense? Like a department of [01:29:09.120 --> 01:29:21.070] defense? They could have like a conference, like a DEF CON. What's [01:29:21.070 --> 01:29:25.570] happening is that even good advice is being treated with deep [01:29:25.570 --> 01:29:30.750] suspicion. NIST is like, hey, yeah, we standardized on this [01:29:30.750 --> 01:29:34.510] Kessack algorithm, but wow, Shaw 3 is slower than Shaw 256 in [01:29:34.510 --> 01:29:38.730] performance patterns. And, you know, this is not a [01:29:38.730 --> 01:29:44.370] controversial opinion. Zuko of Tahoe LFS is like, hey, Kessack [01:29:44.370 --> 01:29:48.290] is too slow in performance patterns. The community is like, [01:29:48.290 --> 01:29:53.170] NIST, NIST is evil. NIST is doing more evil. They got NSA pulling [01:29:53.170 --> 01:29:57.830] their strings. And what's the end result? We are totally [01:29:57.830 --> 01:30:06.890] replacing NIST with DJB. With some guy. Now, I want to be [01:30:06.890 --> 01:30:12.230] clear, I'm an enormous DJB fan. I've been advocating curve 25519 [01:30:12.590 --> 01:30:17.150] for using TLS replacing protocol for literally like half a [01:30:17.150 --> 01:30:22.190] decade. But fewer trusted resources in a time of great [01:30:22.190 --> 01:30:25.930] need, not actually helpful. There's that great quote, Linux [01:30:25.930 --> 01:30:34.770] scales, Linux does not scale. I have a graph. And this graph [01:30:34.770 --> 01:30:44.980] explains the problem very clearly. The NSA has two [01:30:44.980 --> 01:30:52.340] missions. DJB pretty sure only has one. This is what's going on [01:30:52.340 --> 01:30:58.000] here, okay? Like sometimes one of these guys finds a bug and [01:30:58.000 --> 01:31:06.700] says, cool. And it's not DJB. So we're all kind of waiting for [01:31:06.700 --> 01:31:11.860] the other shoe to drop. Not implementers. If you've noticed, [01:31:11.860 --> 01:31:16.200] pretty much everything new that comes out just uses DJB sec. Like [01:31:16.200 --> 01:31:21.580] his stuff is one. Everything new is, you know, 25519 or, you know, [01:31:21.580 --> 01:31:26.880] bad ass or libsodium. His stuff has won the day with implementers. [01:31:29.080 --> 01:31:32.780] There's what's called epistemology. There's how do you [01:31:32.780 --> 01:31:36.320] know what you know. Academics aren't really allowed to know [01:31:36.320 --> 01:31:39.440] things without some degree of evidence. This is kind of a [01:31:39.900 --> 01:31:43.980] barrier to a lot of FUD and BS. This is kind of the heart of [01:31:43.980 --> 01:31:48.660] science. We do know that dual ECDPRG is bad. We have hard [01:31:48.660 --> 01:31:53.300] evidence, we have math and so on. But there's another shoe. [01:31:53.300 --> 01:31:57.320] And that shoe is what's called the NIST P curves. There's this [01:31:57.320 --> 01:32:00.120] great technology, it's called elliptical curves. Elliptical [01:32:00.120 --> 01:32:04.320] curves requires parameters. There are two major sets of [01:32:04.320 --> 01:32:08.160] parameters that came out of NIST. The P curves and the K [01:32:08.160 --> 01:32:12.740] curves. We know exactly how the K curves were constructed. You [01:32:12.740 --> 01:32:16.020] take this value that comes from a mathematical function, you put [01:32:16.020 --> 01:32:18.840] it in what's called a nothing up your sleeve generator to show [01:32:18.840 --> 01:32:21.820] there's nothing up your sleeve. And now you have your [01:32:21.820 --> 01:32:25.060] parameters and everything is good. And then there's the P [01:32:25.060 --> 01:32:29.340] curves where that thing that's going into the nothing up your [01:32:29.340 --> 01:32:37.520] sleeve generator is C493608 dot, dot, dot. Every shirt has two [01:32:37.520 --> 01:32:44.480] sleeves. I'm not saying we know that the P curves are [01:32:44.480 --> 01:32:48.640] compromised. However, if you don't plan on the P curves being [01:32:48.640 --> 01:32:53.820] compromised, you're an idiot. And you should get fired. And in [01:32:53.820 --> 01:32:58.700] fact, that's pretty much what all implementers have realized. [01:32:58.700 --> 01:33:01.660] One of probably the most interesting things about [01:33:01.660 --> 01:33:06.660] Bitcoin is a long time ago they said, yeah, this P curve stuff [01:33:06.660 --> 01:33:11.000] is garbage, let's go with the K curves. So this is something [01:33:11.000 --> 01:33:15.760] that everyone is sort of waiting for. It's not like we know it. [01:33:15.780 --> 01:33:22.060] But we know it. The larger issue is it's not like crypto worked [01:33:22.060 --> 01:33:26.000] particularly well before the NSA con revelations, okay? The hard [01:33:26.000 --> 01:33:29.180] problems in crypto actually aren't the math. They're [01:33:29.180 --> 01:33:32.360] actually not even the implementations, although GPGG are [01:33:32.360 --> 01:33:37.320] gone inside. Key management is the hard part because this is [01:33:37.320 --> 01:33:41.240] what actually touches users and organizations. We keep modeling [01:33:41.240 --> 01:33:44.440] cryptography as math and implementation but there's a [01:33:44.440 --> 01:33:48.340] complexity that goes unnoticed and that's operations, okay? Every [01:33:48.680 --> 01:33:54.820] project in the real world, who here works in IT? Okay? Tell me [01:33:54.820 --> 01:33:59.480] I'm wrong when I say every project needs to be measured only [01:33:59.480 --> 01:34:01.960] in terms of how many god damn meetings you need to do in order [01:34:01.960 --> 01:34:12.050] to complete it. That is the metric. When is the last time [01:34:12.050 --> 01:34:15.350] you saw a meeting count measured in anything to do with [01:34:15.350 --> 01:34:19.010] cryptography? When's the last time you saw crypto work in the [01:34:19.010 --> 01:34:24.290] field? Not an unrelated thing. We have to learn to respect [01:34:24.290 --> 01:34:29.310] usability, we have to learn that this isn't the operational [01:34:29.310 --> 01:34:32.610] requirement. Over at Black Hat, one of the most significant [01:34:32.610 --> 01:34:36.790] announcements in some time happened. Somehow Alex Stamos, [01:34:36.790 --> 01:34:41.710] one of the founders of ISAC, got root at Yahoo. I don't know how [01:34:41.710 --> 01:34:45.070] he did it but he's like, you know what? We're going to do end [01:34:45.070 --> 01:34:56.420] to end PGP for Yahoo freaking mail. Sweet! Because you know [01:34:56.420 --> 01:35:00.740] what? Google might understand user experience but Yahoo really, [01:35:00.740 --> 01:35:06.020] really understands it. So, summary of what we've talked [01:35:06.020 --> 01:35:09.600] about today. We're almost done here. Don't let an attacker [01:35:09.600 --> 01:35:13.700] touch your storage. Let it store, let it execute, don't let [01:35:13.700 --> 01:35:18.560] it do both. Actively gather true entropy. Death to non [01:35:18.560 --> 01:35:23.260] cryptographically secure PRNGs. Please, for the love of God, [01:35:23.260 --> 01:35:27.820] represent entropy in a way other than bit vomit. Browsers become [01:35:27.820 --> 01:35:31.100] vastly more secure once use after free is prevented and we [01:35:31.100 --> 01:35:36.060] are going to fix this in Firefox. The NSA crypto fallout [01:35:36.060 --> 01:35:39.940] continues. It hasn't gone away. There's been a wholesale [01:35:39.940 --> 01:35:45.760] movement to, while I'm a fan of the guy, he's a guy. He's a [01:35:45.760 --> 01:35:50.520] professor at UIUC. Yahoo's PGP news is fantastic. One of the [01:35:50.520 --> 01:35:54.220] most significant things of the year. Maybe of a couple years. [01:35:54.220 --> 01:36:00.980] And, just because I can, just one more thing. I totally get [01:36:00.980 --> 01:36:08.180] to pull this. It's Apple related. Apple went ahead and [01:36:08.180 --> 01:36:12.900] put into their latest release notes for iOS 8, Safari now [01:36:12.900 --> 01:36:16.580] blocks ads from automatically redirecting to the app store [01:36:16.580 --> 01:36:20.380] without user interaction. If you still see the previous behavior [01:36:20.380 --> 01:36:23.080] or find legitimate redirection to the app store to be broken in [01:36:23.080 --> 01:36:31.100] some way, please file a bug. Yes. Okay? I am tired of [01:36:31.100 --> 01:36:34.640] browsing something on my phone and it's like, I know you're [01:36:34.640 --> 01:36:37.100] trying to browse this website but what I really think you [01:36:37.100 --> 01:36:43.800] want to do is pay money to Kim Kardashian. No. That is not what [01:36:43.800 --> 01:36:48.200] I want to do. Fuck those guys. Apple wants help, let's give it [01:36:48.200 --> 01:36:56.590] to them. Now, I talked about this on Twitter before and I [01:36:56.590 --> 01:37:00.090] said, hey, I'll give you 250 bucks. Screw that, I got a [01:37:00.090 --> 01:37:02.990] company. I'll give you five fricking grand for the first [01:37:02.990 --> 01:37:05.930] person to go ahead and give Apple some bugs they can fix. I [01:37:05.930 --> 01:37:10.550] want to see this dead off the mobile internet, okay? I've [01:37:10.950 --> 01:37:14.070] become a believer in bug bounties. This is a complete 180 [01:37:14.070 --> 01:37:18.350] on my old position. I used to think that bug bounties would [01:37:18.350 --> 01:37:22.790] lead to crappy bugs and people being idiots and demanding money [01:37:22.790 --> 01:37:27.550] anyway and it would just be cheaper to pay them off. You [01:37:27.550 --> 01:37:31.670] can't imagine how crappy bugs are that come in from the [01:37:31.670 --> 01:37:35.230] outside world sometimes. People have no idea how stuff works and [01:37:35.230 --> 01:37:41.410] they think they're geniuses. But I was wrong. I'm telling you [01:37:41.410 --> 01:37:45.870] this. I've seen the results firsthand. If you want richer [01:37:45.870 --> 01:37:49.570] bugs from the outside world, maybe you should make bug [01:37:49.570 --> 01:37:54.150] finders richer. Turns out that when you actually have a sample [01:37:54.150 --> 01:37:58.110] of good bugs you can pay for, you can now be like, yeah, we [01:37:58.110 --> 01:38:03.210] paid for the good bug, your thing is crap. So we're not just [01:38:03.210 --> 01:38:06.470] doing 250 bucks, we're going to give $5,000 to the first finder, [01:38:06.470 --> 01:38:10.610] 2,500 to the second, 1,000 to maybe the next five. If we get [01:38:10.610 --> 01:38:13.050] more, we might keep throwing more money at this. I don't know [01:38:13.050 --> 01:38:19.450] how many bugs there are. But we believe in A, this sort of [01:38:19.450 --> 01:38:23.090] behavior is toxic. It destroys the mobile web. It is some of [01:38:23.090 --> 01:38:25.330] the worst stuff we see in advertising. And I run a [01:38:25.330 --> 01:38:31.250] company that fixes advertising. This is still offensive. And I [01:38:31.250 --> 01:38:34.490] think hackers can fix things and I'm willing to put my money [01:38:34.490 --> 01:38:39.570] where my mouth is. So thank you all. This has been a blast.