1 00:00:00,000 --> 00:00:02,940 DEF CON, I missed you. 2 00:00:04,080 --> 00:00:05,200 Wow. 3 00:00:05,640 --> 00:00:11,680 So, show of hands, how many people are here for their absolute very first DEF CON? 4 00:00:13,060 --> 00:00:14,460 Thank you. 5 00:00:16,680 --> 00:00:21,840 You know, I've been doing DEF CON for a long time. 6 00:00:21,840 --> 00:00:23,740 This is about my 15th year. 7 00:00:23,780 --> 00:00:26,040 And I've watched it grow up. 8 00:00:26,040 --> 00:00:32,580 I've watched it grow from a tiny little thing at the Alexis Park to we've kind of overfilled the Rio. 9 00:00:32,580 --> 00:00:42,760 And the one thing that amazes me is just like, wow, people are just here having incredible amounts of just fun and joy. 10 00:00:43,020 --> 00:00:48,560 And you guys see this iHackPineapples guy? 11 00:00:49,100 --> 00:00:53,140 I don't know who you are, but you're my freaking hero. 12 00:00:55,200 --> 00:00:59,200 Basically this guy is like, you're going to come to DEF CON, you're going to hijack the Wi-Fi. 13 00:00:59,200 --> 00:01:02,460 Yeah, I'm going to take that really crappy piece of gear you bought and I'm going to break it. 14 00:01:02,460 --> 00:01:03,640 And if you're late, you can fix it. 15 00:01:03,640 --> 00:01:05,120 And if not, go get a refund. 16 00:01:06,680 --> 00:01:08,260 So, awesome. 17 00:01:08,640 --> 00:01:10,580 So what am I here to talk to you about? 18 00:01:11,180 --> 00:01:14,900 So I have a little bit of a tradition when it comes to my DEF CON talk. 19 00:01:14,900 --> 00:01:17,540 I never actually tell people what I'm going to talk about. 20 00:01:17,780 --> 00:01:18,420 Sorry. 21 00:01:18,660 --> 00:01:20,500 I don't know what I'm going to talk about. 22 00:01:20,720 --> 00:01:24,940 The subjects of my talk is a decent random number generator. 23 00:01:26,740 --> 00:01:31,000 So my talks are weird for DEF CON. 24 00:01:31,000 --> 00:01:33,880 Because, you know, we're hackers. 25 00:01:33,960 --> 00:01:36,000 We like to break things. 26 00:01:36,000 --> 00:01:40,400 But that's not really just what I do here. 27 00:01:40,800 --> 00:01:44,060 I like to show what's possible. 28 00:01:44,060 --> 00:01:49,120 And I like to show, hey, we can scan the entire Internet in a series of seconds. 29 00:01:49,120 --> 00:01:52,700 We can bust people who are doing violations of network neutrality. 30 00:01:52,700 --> 00:01:55,220 There's a few funny things we can do over DNS. 31 00:01:57,420 --> 00:01:58,420 Actually it was great. 32 00:01:58,420 --> 00:02:03,260 I once had like Darth Vader dancing on stage video streaming over DNS. 33 00:02:03,260 --> 00:02:06,040 Somebody told me you couldn't get high bandwidth over DNS. 34 00:02:06,040 --> 00:02:07,580 Somebody was wrong. 35 00:02:09,380 --> 00:02:11,280 But this is not the same thing. 36 00:02:11,280 --> 00:02:13,560 It's just showing what can be broken. 37 00:02:15,360 --> 00:02:20,500 So let's talk about why, what we're going to talk about today. 38 00:02:20,500 --> 00:02:25,580 Because we're going to be here for a few hours and you should have some idea that maybe there will be something you're interested in. 39 00:02:25,820 --> 00:02:27,640 We have a bunch of subjects. 40 00:02:27,760 --> 00:02:35,000 We are actually going to talk about why random number generation keeps getting things owned year after year. 41 00:02:35,160 --> 00:02:40,580 Have kind of a quote which is I would like to not be fixing the same bugs 15 years from now. 42 00:02:40,580 --> 00:02:42,460 I'd like to be fixing new bugs. 43 00:02:42,460 --> 00:02:45,840 But that would require dealing with the existing stuff. 44 00:02:46,520 --> 00:02:53,500 I want to talk about how we're sort of expecting users to recognize these huge strings of hex and it's bullshit. 45 00:02:55,200 --> 00:02:57,480 I want to talk about browser road day. 46 00:02:57,480 --> 00:03:04,520 There's a ton of vulnerabilities that are undiscovered and they all kind of follow the same form and we have to start dealing with them. 47 00:03:04,920 --> 00:03:06,720 I want to talk about DDoS. 48 00:03:08,020 --> 00:03:16,120 We really are getting distributed denial of service attacks that are scaling at a level where really it's an open question if the internet is going to keep working. 49 00:03:17,340 --> 00:03:21,560 So how much did the NSA shit the bed anyway? 50 00:03:22,860 --> 00:03:28,780 But before any of that, I want to talk about why hackers are useful. 51 00:03:28,840 --> 00:03:33,460 And I want to do that by discussing of all things, hard drives. 52 00:03:34,300 --> 00:03:36,260 So let me give you a scenario. 53 00:03:36,960 --> 00:03:42,340 An attacker has compromised a system and put something malicious on the hard drive. 54 00:03:42,580 --> 00:03:44,260 How bad could it be? 55 00:03:44,340 --> 00:03:46,380 What could possibly go wrong? 56 00:03:46,620 --> 00:03:50,080 Well, you know, they might have put in like an auto-launching daemon. 57 00:03:50,080 --> 00:03:52,240 You boot up your machine, it's got a root kit. 58 00:03:52,280 --> 00:03:55,120 You might have replaced some core operating system files. 59 00:03:55,120 --> 00:03:59,340 Maybe they got really, really clever and they like hit the master boot records. 60 00:03:59,340 --> 00:04:03,400 The first thing the computer does right when it turns on is load some piece of malware. 61 00:04:03,700 --> 00:04:11,660 And in all of these cases it sucks but at least you can like format the hard drive, the bad guy is gone, they are destroyed, right? 62 00:04:12,440 --> 00:04:18,500 Well, this funny thing happens when you start researching hard drives. 63 00:04:18,800 --> 00:04:21,000 So a little bit of a joke . 64 00:04:21,700 --> 00:04:26,480 What is the difference between a hard drive and a brick? 65 00:04:26,820 --> 00:04:34,020 The answer to this question is, given sufficient research, there is no difference. 66 00:04:35,300 --> 00:04:38,720 Never in my life have I done more expensive research. 67 00:04:38,720 --> 00:04:40,080 There goes 75 bucks. 68 00:04:40,080 --> 00:04:41,600 There it is gone again. 69 00:04:41,900 --> 00:04:45,000 See, here's the deal. 70 00:04:45,340 --> 00:04:50,760 In theory, a hard drive is a thing you put data on. 71 00:04:50,760 --> 00:04:54,960 Bits go in, bits come out, the bits stay the same. 72 00:04:55,040 --> 00:05:04,480 In reality, we have what I like to call exhibits iron law of computer architecture. 73 00:05:04,720 --> 00:05:07,860 Yo dog, I heard you like computers. 74 00:05:07,860 --> 00:05:13,060 So I put a computer in your computer so you can compute while you compute. 75 00:05:19,810 --> 00:05:28,910 Now what is great about this iron law is that the more you understand about computer architecture, the truer it gets. 76 00:05:28,910 --> 00:05:36,310 Pretty much everything that runs automatically is another little computer that is running on its own cycle that is going and doing stuff. 77 00:05:37,590 --> 00:05:43,890 And of course, it's doing it fast, it's doing it trusted, it's doing it insecurely. 78 00:05:44,130 --> 00:05:49,910 The reality is, is that everything in your computer has become very generic. 79 00:05:50,050 --> 00:05:53,890 Your iPhone has seven ARM chips. 80 00:05:54,010 --> 00:05:59,390 The biggest lie about a computer is that it's just one. 81 00:05:59,570 --> 00:06:00,230 Okay? 82 00:06:00,470 --> 00:06:09,750 Every device you have ever owned is a small network of mutually trusting, overly mutually trusting devices. 83 00:06:10,210 --> 00:06:18,410 A hard drive is really just another computer with direct access to your system memory via specially designed physical and logical protocols. 84 00:06:18,690 --> 00:06:20,070 Now maybe you doubt me . 85 00:06:20,070 --> 00:06:23,010 Maybe you think, oh, come on, Dan, you might be exaggerating . 86 00:06:23,010 --> 00:06:28,350 So let me actually show you what happens when you log into your hard drive. 87 00:06:28,950 --> 00:06:34,210 I did this project with Travis Goodspeed, probably the single most entertaining hardware hacker in the world. 88 00:06:34,210 --> 00:06:37,410 He's the guy behind POC, GTFO, proof of concept. 89 00:06:37,410 --> 00:06:38,770 Get the fuck out. 90 00:06:40,170 --> 00:06:48,150 And so we sit down one day, we buy a huge stack of hard drives and it turns out on the back of them there's a serial port. 91 00:06:48,330 --> 00:06:50,410 What happens when you go into the serial port ? 92 00:06:50,410 --> 00:06:53,210 Well, you know, there's like an entire shell. 93 00:06:53,210 --> 00:06:55,090 It has like documentation. 94 00:06:55,430 --> 00:06:58,070 It actually tells you what your commands are. 95 00:06:58,070 --> 00:07:00,290 Oh, really, edit processor memory. 96 00:07:00,290 --> 00:07:02,690 And here are my arguments that I need to know for that. 97 00:07:02,690 --> 00:07:03,470 Sweet. 98 00:07:03,790 --> 00:07:06,130 You get some internal drive metadata. 99 00:07:06,330 --> 00:07:07,250 Like there's no hacking here. 100 00:07:07,250 --> 00:07:09,130 It's like a straight up interface, right? 101 00:07:09,510 --> 00:07:14,010 You can go ahead, you can like learn about your main disk, the public one. 102 00:07:14,110 --> 00:07:15,330 There's a second one. 103 00:07:15,330 --> 00:07:16,910 There's an entire system partition. 104 00:07:16,910 --> 00:07:18,670 You can go ahead and scrape through that too. 105 00:07:19,190 --> 00:07:21,310 Read the data back out. 106 00:07:21,310 --> 00:07:23,370 Actually take a look at the data. 107 00:07:23,370 --> 00:07:27,950 You know, when your hard drive is initialized, they run a bunch of tests. 108 00:07:27,950 --> 00:07:29,470 This is a Seagate hard drive. 109 00:07:29,470 --> 00:07:32,270 It's actually Seagate's test output. 110 00:07:32,270 --> 00:07:35,670 My favorite part of course being WTF status. 111 00:07:35,770 --> 00:07:36,590 Sweet. 112 00:07:40,070 --> 00:07:46,050 Now you might be saying, but Dan, you had to like hook up special pins to the hard drive. 113 00:07:46,050 --> 00:07:48,890 What, an attacker is going to teleport to your home and do that ? 114 00:07:48,890 --> 00:07:49,970 No, no, no. 115 00:07:50,330 --> 00:07:56,610 An attacker is going to go ahead and there's a great command for messing with hard drives called HD parm. 116 00:07:56,610 --> 00:07:57,690 We're going to run help on it. 117 00:07:57,690 --> 00:08:03,150 We're going to grep for my favorite phrase in computer security, extremely dangerous. 118 00:08:10,320 --> 00:08:19,160 And you'll notice nowhere does it ask for a password but it totally wants the firmware to replace the system partition. 119 00:08:20,580 --> 00:08:24,860 So I'm not kidding about making bricks. 120 00:08:24,860 --> 00:08:32,620 I actually have my lab notes from this and it looks like a, I don't know, a wake. 121 00:08:32,620 --> 00:08:39,660 It's like this hard drive, fate, platters exposed, finger printed, and I think we actually have like our fingers on the platters. 122 00:08:40,100 --> 00:08:42,260 Firmware dump is 01 wrong. 123 00:08:42,300 --> 00:08:45,100 Brick by Dan when he wrote to the buffer, probably repairable. 124 00:08:45,100 --> 00:08:47,000 Brick by Dan with HD parm. 125 00:08:47,000 --> 00:08:50,960 Brick by Dan when he set the serial port to 62,500. 126 00:08:50,960 --> 00:08:55,200 You look at these things funny and they blow up. 127 00:08:55,780 --> 00:08:58,700 I tell you it's the most effective security technology of the hard drives. 128 00:09:01,060 --> 00:09:05,360 So this eventually became a paper with a somewhat predictable subject. 129 00:09:05,520 --> 00:09:09,600 Implementation and implications of a stealth hard drive back door. 130 00:09:10,320 --> 00:09:13,640 I'm kind of an unindicted co-conspirator on this. 131 00:09:13,640 --> 00:09:15,040 They did ten months of work. 132 00:09:15,040 --> 00:09:25,400 They actually built malicious firmware that hides on the hard drive, corrupts the surrounding operating system whether or not the drive has been formatted. 133 00:09:25,400 --> 00:09:27,400 It's owned forever. 134 00:09:27,580 --> 00:09:28,860 Kind of nice. 135 00:09:29,160 --> 00:09:31,500 Why do I tell you all of this? 136 00:09:32,280 --> 00:09:39,520 There is something which I have been discussing privately for some time called storage XOR execution. 137 00:09:39,520 --> 00:10:00,380 Which basically says from an architectural standpoint, if you have code you're running that you know is malicious, that you are completely aware is exposed to skilled attackers, at minimum separate the piece of the system that remembers, that persists, 138 00:10:00,380 --> 00:10:06,600 that stores from the piece of the system that computes, that operates, that parses. 139 00:10:06,660 --> 00:10:12,500 So sure, you can go ahead and provide some malicious input and own the machine. 140 00:10:12,500 --> 00:10:13,900 That might happen. 141 00:10:13,900 --> 00:10:20,660 But you can't keep your ownership without storing it somewhere where it might get discovered. 142 00:10:21,220 --> 00:10:23,760 You actually spend time with attackers. 143 00:10:23,760 --> 00:10:26,920 One of the things they tell you is it's not about ownage. 144 00:10:26,920 --> 00:10:28,180 It's about continued ownage. 145 00:10:28,180 --> 00:10:32,220 It's about coming back in a year and your root kit is still ready to go. 146 00:10:32,220 --> 00:10:34,360 You don't have to break your way back in. 147 00:10:34,940 --> 00:10:35,720 Okay? 148 00:10:36,220 --> 00:10:50,200 You can't even start discussing storage XOR execution if you don't have the paranoia of realizing all of these places to persist your attacks. 149 00:10:50,800 --> 00:10:59,040 You know, I'm one of these rare people in information security that is happy we are talking about APT, about advanced persistent threats. 150 00:10:59,040 --> 00:11:01,060 People say, how can we be discussing this? 151 00:11:01,060 --> 00:11:02,500 These attacks aren't very advanced. 152 00:11:02,500 --> 00:11:07,820 I'm like, holy hell, we have people admitting we have vulnerabilities we have no idea what to do about. 153 00:11:07,900 --> 00:11:08,860 Great. 154 00:11:08,860 --> 00:11:09,840 Stuff is not working. 155 00:11:09,840 --> 00:11:11,920 Let's at least talk about that. 156 00:11:13,880 --> 00:11:31,260 We aren't even having it as a basic part of discussion that maybe when you use resources in a cloud, the underlying hardware should only be shared with other people in your cloud, like in your organization. 157 00:11:31,260 --> 00:11:36,880 Perhaps there should not be one piece of hardware for two different customers. 158 00:11:36,880 --> 00:11:38,200 Two customers, one hardware. 159 00:11:41,640 --> 00:11:43,760 Works about as well as you think. 160 00:11:45,280 --> 00:11:50,840 This, this is the value of hacker engineering. 161 00:11:50,960 --> 00:11:55,460 See what I like about hacking is that we have no delusions, okay? 162 00:11:55,460 --> 00:12:02,080 We are willing to see what systems are actually capable of from first principles. 163 00:12:02,140 --> 00:12:05,620 In fact you say something is impossible and we get to work. 164 00:12:06,480 --> 00:12:07,760 We are needed. 165 00:12:07,960 --> 00:12:14,140 Let me tell you, there's a lot of people out there who want to modify the internet who have no idea how it works. 166 00:12:14,980 --> 00:12:17,000 At least we have a fighting chance. 167 00:12:17,460 --> 00:12:18,600 You know what? 168 00:12:18,840 --> 00:12:22,400 I got to say, I like hacking all the things. 169 00:12:23,180 --> 00:12:25,260 But I also like all the things. 170 00:12:25,800 --> 00:12:30,160 Let me show you something very near and dear to my heart. 171 00:12:31,040 --> 00:12:39,380 This is a cat in a shark costume on a Roomba chasing a duck. 172 00:12:40,220 --> 00:12:41,800 Fuck yeah! 173 00:12:48,690 --> 00:12:50,870 The internet has changed things. 174 00:12:50,870 --> 00:12:52,310 I get this cat. 175 00:12:52,310 --> 00:12:53,990 There's no Bob Saget. 176 00:12:53,990 --> 00:12:55,970 There's no America's Funniest Home Videos. 177 00:12:55,970 --> 00:12:59,050 There's no Wiffle Ball hitting some kid in the nuts. 178 00:13:00,030 --> 00:13:02,390 There's just the kitty, okay? 179 00:13:02,390 --> 00:13:06,030 And that, that is awesome, okay? 180 00:13:06,030 --> 00:13:12,710 One of my favorite artists, she goes on television, she's told, your music sounds like a rat being strangled. 181 00:13:12,710 --> 00:13:15,970 She goes, why yes, there's a market for dubstep. 182 00:13:15,970 --> 00:13:19,230 I should play violin while playing dubstep. 183 00:13:19,230 --> 00:13:22,890 She gets a half billion views on YouTube. 184 00:13:22,890 --> 00:13:24,890 She's a big deal now. 185 00:13:24,970 --> 00:13:31,070 And yeah, she does it with playing songs from Skyrim and Halo and Zelda. 186 00:13:31,070 --> 00:13:34,670 This appeals to my interest, okay? 187 00:13:34,770 --> 00:13:36,390 Lindsay Stolle has rocked it. 188 00:13:36,390 --> 00:13:42,590 We live in a world that sucks less because of the internet. 189 00:13:43,010 --> 00:13:44,570 I believe in email. 190 00:13:45,150 --> 00:13:51,010 I have never in my life received an inter-office memo and I hope I never do. 191 00:13:51,110 --> 00:13:57,910 I prefer Skype over plain old telephone, plain owned telephone service. 192 00:13:58,430 --> 00:14:03,710 I prefer online banking over having to sit for hours in a line in a bank. 193 00:14:04,530 --> 00:14:08,290 The internet has changed how things work. 194 00:14:08,770 --> 00:14:10,930 We could lose it. 195 00:14:10,990 --> 00:14:17,810 Like there's a level of compromise out there where we don't get all these nice things. 196 00:14:17,890 --> 00:14:20,470 And there are some people who even prefer that. 197 00:14:21,890 --> 00:14:28,410 Got to remember, the internet was not the first time we tried to create the internet. 198 00:14:28,410 --> 00:14:30,390 It's very matrixed like that. 199 00:14:30,390 --> 00:14:32,470 This is like the eighth attempt. 200 00:14:33,010 --> 00:14:37,490 Who here is on like Prodigy or Minitel or AOL? 201 00:14:38,230 --> 00:14:42,810 Like, we tried this a bunch of times. 202 00:14:42,810 --> 00:14:46,950 AOL spent like a billion dollars on modems one year . 203 00:14:47,170 --> 00:14:48,290 Turned out it was a good investment. 204 00:14:48,290 --> 00:14:51,210 They're still making $160 million a year off that stuff. 205 00:14:52,150 --> 00:14:54,130 Grandma loves her dial up. 206 00:14:55,990 --> 00:15:02,190 The reason the internet worked is because it was ours. 207 00:15:02,190 --> 00:15:02,670 Okay? 208 00:15:02,670 --> 00:15:05,190 This was the playground of nerds. 209 00:15:05,190 --> 00:15:08,970 This wasn't biz dudes who made something for biz reasons. 210 00:15:08,970 --> 00:15:13,130 This was nerds who were like, I got to send me some e-mail. 211 00:15:13,830 --> 00:15:19,650 And the key is, my God, it was cheap. 212 00:15:19,650 --> 00:15:24,610 No one on the internet ever said that you had to pay some portion of your revenues. 213 00:15:24,830 --> 00:15:27,730 People complain about paying for DNS names. 214 00:15:27,770 --> 00:15:34,090 What is the ratio between how much money Google makes and how much they pay for Google.com? 215 00:15:34,090 --> 00:15:36,410 I don't think there's a smaller number. 216 00:15:39,710 --> 00:15:41,510 One over Google. 217 00:15:44,950 --> 00:15:47,910 Contrast that with the Apple situation. 218 00:15:47,910 --> 00:15:49,370 Oh, you would like to be on our device. 219 00:15:49,370 --> 00:15:52,010 30% gross, please. 220 00:15:52,530 --> 00:15:56,390 You know, it's a very, very different model. 221 00:15:57,090 --> 00:16:01,390 And the free internet has disrupted so much. 222 00:16:01,530 --> 00:16:04,370 And there are those who would like to disrupt it back. 223 00:16:04,710 --> 00:16:06,790 So, here's the challenge. 224 00:16:06,910 --> 00:16:10,470 We are the guys who actually know how this damn thing works. 225 00:16:10,470 --> 00:16:14,490 We are the people who know that breaking everything is possible. 226 00:16:14,890 --> 00:16:19,290 We don't know that fixing everything is impossible. 227 00:16:19,730 --> 00:16:25,210 Now, you know, technically it's a bit of a game but technically correct is the best kind of correct. 228 00:16:26,090 --> 00:16:27,990 So why do I do this? 229 00:16:27,990 --> 00:16:29,270 Why am I here? 230 00:16:29,270 --> 00:16:32,950 Because I see openness to the possibilities. 231 00:16:33,430 --> 00:16:39,970 I see that there's sheer joy in this community for understanding how things work. 232 00:16:40,090 --> 00:16:43,430 I see people willing to call bullshit on everything. 233 00:16:43,510 --> 00:16:48,310 Especially the parts of security theory that are just clearly wrong. 234 00:16:48,310 --> 00:16:55,690 Because, what, you think everyone else in engineering can screw up and we in security are infallible? 235 00:16:55,690 --> 00:16:57,330 We screw things up all the time. 236 00:16:57,330 --> 00:16:59,390 We just have way more attitude about it. 237 00:17:01,390 --> 00:17:04,150 So, that's kind of my world. 238 00:17:04,150 --> 00:17:06,030 Whoa, why did everything just go dark? 239 00:17:06,650 --> 00:17:07,690 Get back here. 240 00:17:08,290 --> 00:17:09,130 Come back. 241 00:17:09,130 --> 00:17:10,330 I believe in you. 242 00:17:15,670 --> 00:17:16,890 All right. 243 00:17:17,470 --> 00:17:22,730 So that's the grand world vision kiddies on Roombas. 244 00:17:23,250 --> 00:17:24,670 Let's nerd out a bit. 245 00:17:25,090 --> 00:17:28,410 I want to talk to you guys about random number generators. 246 00:17:28,670 --> 00:17:32,430 Generation of random numbers is indeed too important to be left to chance. 247 00:17:42,270 --> 00:17:45,910 What does it actually mean to need a random number generator? 248 00:17:46,070 --> 00:17:50,550 Many processes require a generator of unpredictable numbers. 249 00:17:50,550 --> 00:17:55,690 That means if you get the last thousand, you can't figure out what the next one is going to be. 250 00:17:55,690 --> 00:17:59,910 You can't go back and figure out what some of the older ones were that you missed. 251 00:18:00,010 --> 00:18:09,430 Now, just because we require a strong random number generator doesn't mean we're actually getting strong random number generators. 252 00:18:09,430 --> 00:18:10,910 Here's a couple of various talks. 253 00:18:10,910 --> 00:18:14,170 How I Met Your Girlfriend by the great Sammy Kamkar. 254 00:18:15,670 --> 00:18:19,310 Many web applications are failing for session management. 255 00:18:19,370 --> 00:18:21,010 Exploit information for Python. 256 00:18:21,010 --> 00:18:23,090 Exploit information for Ruby. 257 00:18:23,410 --> 00:18:26,090 What the hell is going on? 258 00:18:26,250 --> 00:18:32,890 Well, the deal is that all these various web frameworks, you don't actually log into them that frequently. 259 00:18:32,890 --> 00:18:38,090 One of my friends was an admin at a major e-commerce site. 260 00:18:38,090 --> 00:18:39,170 He's like, yeah. 261 00:18:39,170 --> 00:18:39,870 Oh, wait, wait. 262 00:18:39,870 --> 00:18:41,090 We have an interruption. 263 00:18:41,090 --> 00:18:41,910 Excuse me. 264 00:18:42,370 --> 00:18:47,450 So as you all know, we have a tradition here at DEF CON with new speakers. 265 00:18:47,790 --> 00:18:49,670 We have a new speaker with us this year. 266 00:18:49,670 --> 00:18:53,930 His name is Kaminskow? 267 00:18:54,710 --> 00:18:55,450 Kaminskow? 268 00:18:55,450 --> 00:18:57,650 I think that's the right way to pronounce this. 269 00:18:57,650 --> 00:18:59,130 No, I think you messed it up. 270 00:18:59,590 --> 00:19:00,530 Try again. 271 00:19:01,110 --> 00:19:01,990 Kamikow? 272 00:19:02,310 --> 00:19:02,830 Kamikow. 273 00:19:02,830 --> 00:19:03,690 Yeah, it's Kamikow. 274 00:19:03,690 --> 00:19:04,470 Anyway. 275 00:19:07,050 --> 00:19:08,010 Come here. 276 00:19:08,550 --> 00:19:09,530 It's good to be back. 277 00:19:09,530 --> 00:19:11,090 Good to see you. 278 00:19:15,830 --> 00:19:17,390 Magnificent bastards. 279 00:19:20,110 --> 00:19:23,070 New speakers and really fucking old speakers. 280 00:19:23,070 --> 00:19:24,550 Oh, snap. 281 00:19:24,770 --> 00:19:26,470 It overflows back to zero. 282 00:19:33,860 --> 00:19:35,880 Actually, I missed the year or so. 283 00:19:37,820 --> 00:19:39,840 So the deal is this. 284 00:19:40,340 --> 00:19:44,900 You have literally one of the largest e-commerce sites in the world. 285 00:19:45,400 --> 00:19:47,080 We found a phone. 286 00:19:47,260 --> 00:19:49,580 Does anybody have one? 287 00:19:50,540 --> 00:19:57,850 I'd say drink but I just did. 288 00:19:59,790 --> 00:20:06,970 Yeah, so you've got one of the largest e-commerce sites in the world and you'd be like, how many logins per second do you process? 289 00:20:07,070 --> 00:20:10,970 You think it's like tens of thousands or thousands? 290 00:20:11,050 --> 00:20:11,950 Hundreds? 291 00:20:12,310 --> 00:20:15,490 They're like, yeah, seven. 292 00:20:15,630 --> 00:20:19,210 Seven times a second we have to accept a password. 293 00:20:19,810 --> 00:20:29,310 And it's surprising but when you actually think about what happens, you put in your password, you get a cookie, that is now password equivalent. 294 00:20:29,310 --> 00:20:33,730 That's the thing that's shoved into the web app every single time you visit. 295 00:20:34,390 --> 00:20:39,310 That value ideally is a random value. 296 00:20:39,370 --> 00:20:46,910 Man, it would suck if you could go ahead and log in a thousand times and predict the next thousand log in magic numbers. 297 00:20:47,670 --> 00:20:50,370 That's actually totally what's happening. 298 00:20:51,750 --> 00:20:56,230 More recently, a few days ago, awesome attack. 299 00:20:56,230 --> 00:20:58,910 One of the ‑‑ so beautiful. 300 00:20:58,930 --> 00:21:07,770 A guy by the name of Dominique Bongard, reversity on Twitter, came up with an attack against a scheme called WPS. 301 00:21:07,930 --> 00:21:17,630 WPS exists so that you can relatively efficiently negotiate with an access point and find out what the passphrase is so you can log in and use the internet. 302 00:21:17,710 --> 00:21:23,770 And they made up this incredibly ill‑advised protocol for it. 303 00:21:23,770 --> 00:21:26,130 I mean , just like impressively. 304 00:21:26,810 --> 00:21:41,250 But the one part of the protocol that wasn't actually awful was this piece where at the beginning you have some value and it's encrypted with a 128 bit key. 305 00:21:41,250 --> 00:21:43,810 It's randomly generated but it's encrypted. 306 00:21:44,550 --> 00:21:48,570 And, you know, breaking a 128 bit key is not going to happen. 307 00:21:48,630 --> 00:21:50,990 Like, that's a 2 to the 128 work effort. 308 00:21:51,050 --> 00:21:53,270 That's going to take until the end of the universe. 309 00:21:53,730 --> 00:21:59,670 However, it requires you to actually have 128 bits of entropy. 310 00:22:00,390 --> 00:22:02,970 Which none of the devices did. 311 00:22:03,410 --> 00:22:08,110 Device one had what's called an LFSR, a linear feedback shift register. 312 00:22:08,110 --> 00:22:14,690 They keep showing up in this space because they're the quickest and easiest way to get this stream of numbers. 313 00:22:14,690 --> 00:22:19,530 You start with a seed value and it just keeps rolling and rolling and rolling. 314 00:22:19,550 --> 00:22:23,670 Well, the seed value in the first device was 32 bits long. 315 00:22:23,670 --> 00:22:26,210 So you just try all 32 bits combination. 316 00:22:26,210 --> 00:22:29,030 Second one, another 32 bits. 317 00:22:29,210 --> 00:22:32,010 The third one just encrypted with zero. 318 00:22:37,010 --> 00:22:39,050 Beautiful attack. 319 00:22:39,890 --> 00:22:48,210 So let's talk about why really we keep getting owned by random number generators. 320 00:22:48,430 --> 00:23:02,270 And the most important thing to realize is there's a huge amount of discussion in the cryptographic world about the absolute right way to build a cryptographically secure random number generator. 321 00:23:02,270 --> 00:23:06,410 And for the love of God, most of it doesn't matter. 322 00:23:06,770 --> 00:23:12,710 No one's getting owned because they use SHA-1 or SHA-256 or hell MD4. 323 00:23:12,710 --> 00:23:17,150 No one's getting owned because they use hash instead of HMAC DBRG. 324 00:23:17,150 --> 00:23:22,090 They're not getting owned because they used the same entropy for too long and didn't mix in new entropy. 325 00:23:22,090 --> 00:23:25,950 We're not getting owned because we had one pool instead of 32 pools. 326 00:23:25,950 --> 00:23:32,870 Like there's a disconnect between what's getting us owned and what we argue about. 327 00:23:32,870 --> 00:23:42,310 The fundamental truth is there's like a thousand different ways to build a cryptographically secure pseudo random number generator. 328 00:23:42,310 --> 00:23:46,990 And they all have an incredibly high security margin. 329 00:23:46,990 --> 00:23:49,490 That is the fundamental truth. 330 00:23:49,490 --> 00:24:01,670 When you actually look at the systems in the field that are breaking and they are all breaking, your two problems are one, there's no entropy at all. 331 00:24:01,670 --> 00:24:07,430 And two, we're not even using cryptographically secure pseudo random number generators. 332 00:24:07,430 --> 00:24:09,250 We're using LFSRs. 333 00:24:09,250 --> 00:24:10,430 We're using crap. 334 00:24:10,430 --> 00:24:13,150 This is what's actually happening. 335 00:24:13,670 --> 00:24:17,570 So let's talk about the no entropy problem. 336 00:24:17,570 --> 00:24:22,630 What does a cryptographically secure pseudo random number generator do? 337 00:24:22,630 --> 00:24:25,710 It takes a little bit of entropy. 338 00:24:25,730 --> 00:24:31,910 128 values that are either 0 or 1 that have no particular pattern. 339 00:24:31,910 --> 00:24:42,250 It takes that little tiny chunk and spreads it out into number after number after number, gigabytes, hundreds of gigabytes, whatever. 340 00:24:42,830 --> 00:24:49,150 Your idea is from an attacker standpoint, you can look at as much of this output as possible. 341 00:24:49,150 --> 00:24:52,850 You learn nothing about the secret. 342 00:24:52,850 --> 00:25:03,250 Your best attack is unfortunately to guess what all 128 bits of that seed are and it's just not feasible. 343 00:25:03,250 --> 00:25:05,570 There's too many. 344 00:25:06,550 --> 00:25:12,290 Now, in order for this to be true, you actually need 128 bits. 345 00:25:12,290 --> 00:25:15,690 What killed WPS is there actually wasn't. 346 00:25:15,690 --> 00:25:21,590 Generally there was 32 bits which is a meaningful, which is a successful amount to break. 347 00:25:21,590 --> 00:25:23,470 One case there was 0. 348 00:25:23,530 --> 00:25:26,730 This isn't an obscure bug. 349 00:25:27,050 --> 00:25:38,350 Nadia Henninger did this incredibly beautiful attack a few years ago where she found 1 out of 200 RSA keys on the internet were actually badly generated. 350 00:25:38,350 --> 00:25:39,830 Now here's what's scary. 351 00:25:39,830 --> 00:25:51,650 If she finds that 1 out of 200 keys are identical, the method that she used doesn't actually tell her if the keys are almost identical. 352 00:25:51,650 --> 00:26:00,610 If there's a single bit of difference and otherwise everything is the same, Nadia's method wouldn't be able to find it. 353 00:26:00,890 --> 00:26:12,090 So unfortunately we have this really ugly situation where 1 out of 200 is a floor and really it's something like 1 out of 50 keys on the internet is bad. 354 00:26:12,270 --> 00:26:14,490 That's an incredible failure rate. 355 00:26:14,490 --> 00:26:18,830 Shouldn't DevRandom and DevUrandom have actually prevented this? 356 00:26:18,830 --> 00:26:26,370 Because these keys are actually being generated out of what are supposed to be well engineered kernel systems. 357 00:26:26,490 --> 00:26:32,530 Let's talk about why we actually really do like kernel random number generators. 358 00:26:33,390 --> 00:26:43,370 First off, when you have hardware in your computer, remember your biggest lie of a computer is just one computer. 359 00:26:43,570 --> 00:26:53,390 When one of the other pieces on the other computers talks to your CPU, literally what happens is a piece of the kernel is run. 360 00:26:53,470 --> 00:26:59,390 An interrupt is fired, the CPU jumps to a certain point, you get a time stamp at that. 361 00:27:01,330 --> 00:27:06,570 You now have an interaction of someone else's clock with yours. 362 00:27:07,550 --> 00:27:13,650 You ever wonder what it means to actually collect random information, what it means to collect entropy? 363 00:27:13,730 --> 00:27:15,170 What are you doing? 364 00:27:15,990 --> 00:27:22,410 At the end of the day, what you're doing is you're measuring a slow system with a fast system. 365 00:27:22,550 --> 00:27:26,290 You know, I can snap my fingers and I think I have a rhythm going. 366 00:27:26,470 --> 00:27:29,050 You think I have a rhythm going accurate to the nanosecond? 367 00:27:29,050 --> 00:27:30,910 No, I don't. 368 00:27:30,950 --> 00:27:34,590 Because that's not how accurate human systems are. 369 00:27:34,590 --> 00:27:38,870 We are at best accurate to the hundredth of a second. 370 00:27:40,970 --> 00:27:57,970 When you have a computer that says I'm going to watch your mouse movements, I'm going to watch your interkey stroke timings, you basically have a situation where a CPU that is running at billions and billions of cycles a second is measuring a system that's running at hundreds of times a second . 371 00:27:58,190 --> 00:28:00,690 And that's what's happening in this kernel situation . 372 00:28:00,690 --> 00:28:08,510 The kernel is seeing an event come in and it's hoping it's coming from some other computer that's running slower or at least out of its control. 373 00:28:09,230 --> 00:28:14,190 Another great thing about kernel RNGs is that there's just one kernel, at least ideally. 374 00:28:14,190 --> 00:28:20,490 So you don't have some situation where one process is doing something right and one process is doing something wrong. 375 00:28:20,490 --> 00:28:24,010 Every process benefits from whatever randomness is available. 376 00:28:24,010 --> 00:28:25,270 It's shared. 377 00:28:25,910 --> 00:28:29,390 Finally, this is tricky stuff. 378 00:28:29,390 --> 00:28:40,410 And one of the whole points of an operating system is to take tricky stuff and put it into a box that smart people build it and it is done right. 379 00:28:40,730 --> 00:28:42,590 So that was the idea. 380 00:28:42,690 --> 00:28:43,870 What went wrong? 381 00:28:44,050 --> 00:29:02,110 Well, all those devices that were going ahead and generating these random keys, all these devices were started up, there was nobody at the keyboard, there was nobody at the mouse, there was no hard drive to be getting friction from air. 382 00:29:02,610 --> 00:29:05,710 There were no events coming in from the hardware. 383 00:29:05,710 --> 00:29:07,290 It was just sitting there. 384 00:29:07,370 --> 00:29:10,630 And if you've got no events, you've got no entropy to operate on. 385 00:29:10,690 --> 00:29:17,310 Now, it would be nice if CPUs actually had hardware random number generation. 386 00:29:17,790 --> 00:29:25,330 But for whatever reason, that just consistently seems to be outside the purview of our modern CPU manufacturers. 387 00:29:25,330 --> 00:29:27,290 You just can't figure out how to do it. 388 00:29:28,770 --> 00:29:30,830 So how do you solve this problem? 389 00:29:30,830 --> 00:29:31,650 Like, really? 390 00:29:32,330 --> 00:29:35,990 The truth is, you don't have to be perfect. 391 00:29:35,990 --> 00:29:43,350 You could fail every once in a while and you're still going to beat the one nine of reliability that we got out of RSA. 392 00:29:44,690 --> 00:29:46,530 That really sucks. 393 00:29:48,430 --> 00:29:50,530 You've got to force the synthesis of events. 394 00:29:50,530 --> 00:30:02,730 You have to actually force a situation where the device, whatever device that it actually is, has something on a slower clock that's pinging the fast clock. 395 00:30:02,730 --> 00:30:18,590 And realistically what that means is using the real time clock, which tends to be a separate chip, tends to run at some amount of kilohertz and having that ping the CPU which tends to be running at some amount of hundreds of megahertz to gigahertz. 396 00:30:18,730 --> 00:30:21,610 This actually works. 397 00:30:21,830 --> 00:30:27,770 Now you can also go ahead and do some actions that take a hopefully non-deterministic amount of time. 398 00:30:28,010 --> 00:30:32,370 So reading values out of memory, causing contention for resources. 399 00:30:33,670 --> 00:30:35,530 You want to do what's called whitening. 400 00:30:35,710 --> 00:30:38,170 So that means you take any sequence of bits. 401 00:30:38,170 --> 00:30:40,230 If it's a zero zero, you throw it out. 402 00:30:40,230 --> 00:30:42,430 If it's a one one, you throw it out. 403 00:30:42,430 --> 00:30:44,830 The zero to one transition is considered a zero. 404 00:30:44,830 --> 00:30:47,030 The one to zero transition is considered a one. 405 00:30:47,030 --> 00:30:49,770 This is what's called de-biasing your data. 406 00:30:49,950 --> 00:30:53,910 I released a piece of code called docker RAND about two years ago. 407 00:30:54,130 --> 00:30:58,510 Docker RAND was based on true RAND by Matt Blaze from about ten years ago. 408 00:30:58,970 --> 00:31:02,990 I think actually about 1996. 409 00:31:04,910 --> 00:31:15,610 If we had followed Matt Blaze's guidance in 1996, we would not have a single nine of reliability for RSA in, you know, 2012. 410 00:31:15,610 --> 00:31:17,610 That wouldn't have happened. 411 00:31:18,310 --> 00:31:24,950 Part of security is accepting maybe there is some weird ass environment where docker RAND fails. 412 00:31:24,950 --> 00:31:27,490 But is it going to fail as much as status quo? 413 00:31:27,530 --> 00:31:28,430 No. 414 00:31:28,430 --> 00:31:29,730 No it's not. 415 00:31:30,770 --> 00:31:36,030 So let's talk about the larger issue. 416 00:31:36,710 --> 00:31:51,690 Even worse than the fact that we don't have true entropy to see this cryptographically secure pseudo random number generator, is the fact that we're not actually using the CSPRNGs at all. 417 00:31:51,750 --> 00:31:58,990 When you look at the languages that people use to write software, JavaScript has math random, LFSR. 418 00:31:58,990 --> 00:32:01,690 Ruby has Ruby RAND, LFSR. 419 00:32:01,690 --> 00:32:08,310 Java has Java util random, PHP RAND, it's all crap. 420 00:32:08,490 --> 00:32:09,850 Why? 421 00:32:09,930 --> 00:32:12,150 Why are we doing this? 422 00:32:13,450 --> 00:32:25,510 Well, what ends up happening is every time someone complains about the nature of the random number generator that we have, we end up making secure random. 423 00:32:25,730 --> 00:32:28,230 It's not fixing the old broken stuff. 424 00:32:28,230 --> 00:32:30,690 We make some new API. 425 00:32:30,810 --> 00:32:33,690 Then we make it weird. 426 00:32:33,910 --> 00:32:36,630 It's never just like math dot secure random. 427 00:32:36,630 --> 00:32:41,950 It's like bar A equals new UINT array one window crypto get random values. 428 00:32:41,950 --> 00:32:43,070 What? 429 00:32:44,070 --> 00:32:47,210 That wasn't what I was using when it was easy. 430 00:32:47,210 --> 00:32:51,830 Why are you making secure not easy and not default? 431 00:32:51,830 --> 00:32:53,970 Does that work anywhere else? 432 00:32:53,970 --> 00:32:55,230 No. 433 00:32:56,670 --> 00:33:00,650 So why not be secure by default? 434 00:33:00,650 --> 00:33:09,210 Why not instead of requiring some weird ass random API, why not take the broken APIs and make them not broken? 435 00:33:09,450 --> 00:33:12,830 So thus, we've actually been doing that. 436 00:33:12,830 --> 00:33:16,050 Ryan Castellucci works with me over at White Ops. 437 00:33:16,650 --> 00:33:32,610 And what we've been doing is systematically going through each and every one of the popular web programming environments and we're taking their crappy little math randoms and making them a shell for dev U random. 438 00:33:32,890 --> 00:33:36,290 So we've gotten JavaScript support for node in the browsers. 439 00:33:36,290 --> 00:33:37,490 We've gotten Ruby. 440 00:33:37,790 --> 00:33:41,770 We've actually made C's RAND function actually RAND. 441 00:33:42,610 --> 00:33:45,630 PHP, Python, OpenJDK. 442 00:33:45,630 --> 00:33:48,870 It's not like it's that hard to write this code. 443 00:33:48,910 --> 00:33:57,290 We actually just need to write it and get it something that people agree, hey, maybe we should just have an easy to use path here. 444 00:33:58,190 --> 00:34:05,070 Now there's going to be some run time feature support like being able to interrogate how good is this random number generator? 445 00:34:05,190 --> 00:34:06,730 Do we support fixed seeds? 446 00:34:06,730 --> 00:34:08,270 Do we support high speed? 447 00:34:08,810 --> 00:34:15,230 So I'm going to do something now which people tend to call, it's when I play chess against myself. 448 00:34:15,230 --> 00:34:21,470 Let's talk about what's wrong with what we've named lib U Randy besides the name. 449 00:34:24,410 --> 00:34:29,990 Ryan actually named it and I'm like, sorry I can't think of this code as any other name now. 450 00:34:30,170 --> 00:34:36,570 There are two reasons why generally you wouldn't use an approach like this. 451 00:34:36,570 --> 00:34:44,830 The first reason is testers tend to like predictable test results. 452 00:34:44,830 --> 00:34:53,210 So they tend to like situations where they can say I want it to be a random stream but I want it to be the same random stream. 453 00:34:53,210 --> 00:34:59,330 So the system will always behave in a predictable way that can be regression tested. 454 00:34:59,330 --> 00:35:03,070 Now I actually never, ever like this approach. 455 00:35:03,070 --> 00:35:04,490 Here's why. 456 00:35:05,850 --> 00:35:09,910 People say it's a two line change. 457 00:35:09,910 --> 00:35:15,030 Why do you need to go ahead and retest everything for a two line change? 458 00:35:15,210 --> 00:35:16,690 And here's the answer. 459 00:35:16,690 --> 00:35:30,130 It's because there's a bunch of bugs that don't show up in the field for, not because there isn't a bug, but because the house of cards fell in just the same precise way. 460 00:35:30,130 --> 00:35:35,610 So that when the memory corruption occurred, nothing bad visibly happened. 461 00:35:35,610 --> 00:35:43,670 And so when the house of cards falls the same way every time, you never discover the bug. 462 00:35:43,670 --> 00:35:47,830 And you only discover it when you do that two line change. 463 00:35:47,830 --> 00:35:53,210 That shouldn't break anything but now the house of cards falls like this and now everything blows up. 464 00:35:53,910 --> 00:36:09,230 I really don't like these sort of fixed seeds because they allow the ugly bugs to stay unfound unless you go ahead and do like a complete massive retest which then you now have to do every time because you keep getting burnt. 465 00:36:09,410 --> 00:36:10,410 It sucks. 466 00:36:11,030 --> 00:36:20,850 But people want it and so okay, we'll go ahead and we'll have a special mode for LibUrandy that allows you to say no, no, no, I intentionally want my randomness to suck. 467 00:36:20,850 --> 00:36:22,890 Okay, fine, we'll set an environment flag. 468 00:36:23,590 --> 00:36:31,090 More seriously, Urandom is actually kind of slower than LFSRs. 469 00:36:31,090 --> 00:36:41,990 So you do have a situation where it's 4 megabytes a second out of Urandom and 260 megabytes a second out of your crappy bad randomness. 470 00:36:43,550 --> 00:36:49,790 And when you actually look at the ‑‑ so I was interested. 471 00:36:50,430 --> 00:36:53,450 I believe in being historical. 472 00:36:53,610 --> 00:36:59,850 Let's look at the historical record and see why did these APIs get screwed up like this in the first place. 473 00:36:59,850 --> 00:37:09,290 And at least in the browser case, they realized they had a bad random number generator but they also had benchmarks and they really didn't want to lose at the benchmarks. 474 00:37:09,290 --> 00:37:13,890 It's like, well, we're not secure but we're not being benchmarked for security. 475 00:37:18,850 --> 00:37:24,930 So even at 4 megabytes a second , it's still like a million random numbers a second. 476 00:37:25,710 --> 00:37:30,230 It's generally fast enough for everything but not always. 477 00:37:30,550 --> 00:37:39,250 So this brings up the question, should we be using a user space scriptographically secure pseudo random number generator? 478 00:37:39,250 --> 00:37:41,170 Now, it doesn't mean that we don't use Urandom. 479 00:37:41,170 --> 00:37:44,470 We still mine it as frequently as we might like. 480 00:37:44,470 --> 00:37:48,250 If it happens to get some new bits of randomness from the kernel, great. 481 00:37:48,250 --> 00:37:49,150 Let's use them. 482 00:37:49,150 --> 00:37:50,470 Let's integrate them in. 483 00:37:50,750 --> 00:37:59,390 But like I said at the beginning, like a few minutes ago, pretty much every variant of a CSPRNG is still secure. 484 00:37:59,390 --> 00:38:02,590 So one of the fastest hashes out there is what's called sip hash. 485 00:38:02,590 --> 00:38:04,390 It comes from our buddy DJB. 486 00:38:04,810 --> 00:38:09,690 If you just sip hash seed with an incremented counter, this actually works. 487 00:38:09,690 --> 00:38:14,510 It's 20 times faster than dev Urandom on Linux. 488 00:38:14,510 --> 00:38:19,750 It's competitive with the non-cryptographically secure pseudo random number generators. 489 00:38:19,830 --> 00:38:24,870 I guess what I'm trying to tell you is there's no advantage to sucking. 490 00:38:24,870 --> 00:38:27,630 You can be fast and secure. 491 00:38:27,630 --> 00:38:28,850 It's okay. 492 00:38:29,090 --> 00:38:35,050 Now there is a possible improvement that we could do and that is the integration of time. 493 00:38:35,050 --> 00:38:38,070 Specifically what's called clock monotonic. 494 00:38:38,070 --> 00:38:52,130 Now while you can't get for whatever mysterious reasons NSA good hardware random number generator, you can at least get a time stamp. 495 00:38:52,130 --> 00:38:56,690 And it turns out you just need bits that are different. 496 00:38:56,690 --> 00:39:08,550 We've got this problem with what's called forking where you have a process, you make a copy of it, the copy has the same seed and the same counter value. 497 00:39:08,550 --> 00:39:11,270 Now you have the same entropy happening twice. 498 00:39:11,270 --> 00:39:12,870 And it sucks. 499 00:39:12,950 --> 00:39:25,190 If you integrate time, it turns out empirically it's a pain in the butt to get two things to happen at exactly the same CPU nanosecond. 500 00:39:25,190 --> 00:39:28,970 It's not that it can't, it's that it won't. 501 00:39:29,470 --> 00:39:31,450 That's a good thing. 502 00:39:31,530 --> 00:39:43,730 So you could actually have on a per query to the random interface basis, you could actually say give me this time stamp's view of the randomness. 503 00:39:43,730 --> 00:39:53,310 So my preferred CSPRNG looks something like SIP hashing the secret, a counter, the previous output and what I call the shifted time. 504 00:39:53,310 --> 00:40:02,270 So you don't just do the time directly, you shift it by some amount so the attacker can't just say, well I know according to NTP that this value is going to be almost zero. 505 00:40:02,630 --> 00:40:04,830 Force there to be some fixed offset. 506 00:40:05,290 --> 00:40:09,030 I'm not doing this yet in Lib U Randy. 507 00:40:09,110 --> 00:40:10,550 And here's why. 508 00:40:10,790 --> 00:40:17,950 Reasonable people can disagree about whether a CSPRNG should be in user space and kernel space. 509 00:40:17,990 --> 00:40:20,790 But we all hate LFSRs. 510 00:40:20,790 --> 00:40:26,050 So let's at least do something which causes those damn things to die. 511 00:40:26,590 --> 00:40:30,290 Another change is maybe we don't use SIP hash. 512 00:40:30,290 --> 00:40:36,790 SIP, it turns out because of quirks, you can do faster with Blake, you can really do faster with Skyn. 513 00:40:36,790 --> 00:40:39,650 So both of them are alternate hashing systems. 514 00:40:39,650 --> 00:40:42,270 We've found things where it's like twice as fast. 515 00:40:42,550 --> 00:40:57,850 So really the right answer at the end of the day may not be do a user space CSPRNG and maybe fix up the really weird one inside of Linux which is obsessed with mixing stuff in multiple poles, et cetera, et cetera. 516 00:40:57,850 --> 00:40:59,990 The problems we don't have. 517 00:41:01,010 --> 00:41:07,210 So that's kind of the souped nuts on what's going on with entropy generation. 518 00:41:07,310 --> 00:41:11,490 But there's another problem around representation. 519 00:41:12,550 --> 00:41:29,330 Apparently you are supposed to do something with D3B07384D1NGJU42MA1$JH89 and whatever the hell that is, squiggly stuff. 520 00:41:29,830 --> 00:41:32,010 What the hell is that? 521 00:41:32,030 --> 00:41:35,370 Stop puking bits. 522 00:41:37,990 --> 00:41:42,590 We are lying to ourselves if we think users can do anything with that. 523 00:41:42,590 --> 00:41:44,930 They are lost. 524 00:41:46,050 --> 00:41:57,810 The problem is is that computers actually need humans to recognize and to remember large amounts of bits and it's hopeless. 525 00:41:57,810 --> 00:41:58,370 Okay? 526 00:41:58,370 --> 00:42:06,810 We have hardware acceleration for human faces and even then we maybe can get about 16 bits. 527 00:42:06,810 --> 00:42:14,270 There may be, if we're absolutely at the edge of our capability, able to differentiate 65,000 people. 528 00:42:14,550 --> 00:42:16,330 It's not that much. 529 00:42:16,530 --> 00:42:21,070 And computers want more, so much more, 24 to 128 bits. 530 00:42:21,070 --> 00:42:22,650 They want recognition. 531 00:42:22,790 --> 00:42:24,650 Have you ever seen this before? 532 00:42:24,650 --> 00:42:26,170 And they want repetition. 533 00:42:26,210 --> 00:42:28,150 Hey, give me that long ass password. 534 00:42:28,890 --> 00:42:30,710 And the standard stuff doesn't work. 535 00:42:30,710 --> 00:42:38,230 We did not evolve to deal with hex or base 64 or base 58 or squiggly SSH art. 536 00:42:38,230 --> 00:42:39,810 It's just not how we're built. 537 00:42:40,230 --> 00:42:42,390 Now, I've looked at this problem before. 538 00:42:42,850 --> 00:42:43,550 I did some work. 539 00:42:43,550 --> 00:42:45,310 I called it crypto mnemonics. 540 00:42:45,570 --> 00:42:51,790 Went ahead and took 512 male names, 1,024 female names, 8,192 last names. 541 00:42:51,790 --> 00:42:54,730 I represented entropy by married couples. 542 00:42:54,730 --> 00:42:58,770 I'm sorry, totally heteronormative but actually really diverse. 543 00:42:59,290 --> 00:43:05,550 You know, Julio and Epifania, Dizuti and Luther, Roland, Dubros and Manuel and Twilight and Bessie. 544 00:43:06,710 --> 00:43:08,930 Definite range of people here. 545 00:43:10,410 --> 00:43:16,870 This actually works as a way to get yourself to be used to some pattern of bits. 546 00:43:16,870 --> 00:43:21,610 You do have to show it every single time you interact with something. 547 00:43:21,610 --> 00:43:25,670 You can't just show the entropy representation when there's a problem. 548 00:43:25,670 --> 00:43:28,310 It's like you only see someone's face when there's a problem. 549 00:43:28,310 --> 00:43:30,030 Otherwise they're in a mask . 550 00:43:30,070 --> 00:43:31,790 No, that doesn't work that way. 551 00:43:31,790 --> 00:43:32,810 It's not how the brain works. 552 00:43:32,810 --> 00:43:36,270 It needs spaced repetition to remember. 553 00:43:36,930 --> 00:43:40,670 Now can we do better? 554 00:43:41,110 --> 00:43:44,770 Humans do have memory capacity. 555 00:43:44,770 --> 00:43:46,470 It's just not for arbitrary bits. 556 00:43:46,470 --> 00:43:48,730 Like Homer's epics are enormous. 557 00:43:48,730 --> 00:43:51,650 There's like kilobytes of entropy in there. 558 00:43:51,650 --> 00:43:55,370 The deal is is that we remember objects. 559 00:43:55,370 --> 00:43:56,630 We remember stories. 560 00:43:56,630 --> 00:44:02,710 We remember narratives far more than we remember arbitrary ones and zeros. 561 00:44:02,710 --> 00:44:13,230 So if you can represent ones and zeros in these sort of narratives that humans are built to remember, you actually have something. 562 00:44:13,290 --> 00:44:17,610 Heck, maybe get like a password and like have it spell check. 563 00:44:17,850 --> 00:44:35,970 So what we've been exploring has been using triads of adjectives, nouns and verbs and having these be selected to be maximally distant from each other and to encode whatever entropy someone needs to recognize or repeat in these stories. 564 00:44:36,070 --> 00:44:37,990 I haven't been doing this work alone. 565 00:44:37,990 --> 00:44:47,130 I've been working with my co-worker Ryan Casalucci over at White Ops and it's his code, it's his work, he's the one who should be talking about it. 566 00:44:47,270 --> 00:44:50,890 So he's going to come on stage and we're going to talk about how he did this. 567 00:44:58,380 --> 00:45:00,840 So Ryan, pick up a mic. 568 00:45:02,600 --> 00:45:03,720 Hi, guys. 569 00:45:04,340 --> 00:45:05,480 How's it going? 570 00:45:07,740 --> 00:45:11,960 So I just have to say, I have known Ryan for many, many years. 571 00:45:11,960 --> 00:45:14,320 He recently started working with me at White Ops. 572 00:45:14,320 --> 00:45:20,900 I have never had a guest come up in the middle of my talk and there's no one I'd rather have be here. 573 00:45:20,900 --> 00:45:22,020 So thank you. 574 00:45:22,340 --> 00:45:24,420 So Ryan, tell me what we're looking at here. 575 00:45:24,420 --> 00:45:25,100 Okay. 576 00:45:25,100 --> 00:45:31,860 So we have up on the slide a randomly generated sample. 577 00:45:33,160 --> 00:45:36,280 It's like 5E4D, it's like a bunch of bits? 578 00:45:36,280 --> 00:45:37,200 Right. 579 00:45:37,380 --> 00:45:43,120 There's a couple algorithms that are combined together to generate the encoding we have there. 580 00:45:43,120 --> 00:45:46,480 As you can see, there's four groups of three words. 581 00:45:46,480 --> 00:45:50,260 Each one is an adjective, noun and verb. 582 00:45:51,040 --> 00:45:55,000 It's like macho acid answering, rustic cable fetching and something. 583 00:45:55,000 --> 00:45:55,700 Right. 584 00:45:56,080 --> 00:46:00,380 And we have a known amount of entropy there. 585 00:46:00,380 --> 00:46:05,240 So what we can do, spell check for passwords, well, pass phrases. 586 00:46:05,960 --> 00:46:10,720 So unfortunately we don't have a live demo to you. 587 00:46:10,720 --> 00:46:14,320 I could not get the code to work fast enough for that. 588 00:46:15,040 --> 00:46:17,000 I will fix that soon. 589 00:46:17,320 --> 00:46:18,520 The code will be released. 590 00:46:18,520 --> 00:46:19,700 It is awesome. 591 00:46:19,700 --> 00:46:23,200 But we actually do have sort of a view of what's going on here. 592 00:46:23,200 --> 00:46:27,860 That is, it can fix far worse than that. 593 00:46:27,860 --> 00:46:39,640 But as you can see, transpositions, deleted spaces, replaced characters, added letters, deleted letters, random garbage symbols, it can fix all of this. 594 00:46:39,640 --> 00:46:41,180 And the words are out of order even. 595 00:46:41,180 --> 00:46:41,640 Yes. 596 00:46:41,640 --> 00:46:51,620 It is also order insensitive because people will commonly mix up the order of words when they are trying to remember something like this. 597 00:46:51,620 --> 00:46:53,620 And we can fix it so we should. 598 00:46:54,120 --> 00:46:54,780 Interesting. 599 00:46:54,780 --> 00:46:57,800 So you don't have to remember if the acid is macho or rustic. 600 00:46:57,800 --> 00:47:00,560 You just have to know acid, macho, rustic or whatever order. 601 00:47:00,560 --> 00:47:01,380 Exactly. 602 00:47:01,380 --> 00:47:02,140 Okay. 603 00:47:02,140 --> 00:47:04,700 So let's talk about how you actually did this. 604 00:47:04,720 --> 00:47:05,560 Okay. 605 00:47:05,560 --> 00:47:07,120 It's kind of complicated. 606 00:47:07,420 --> 00:47:10,220 I have code implemented in JavaScript and Python. 607 00:47:10,400 --> 00:47:12,180 We will, it's on GitHub. 608 00:47:12,180 --> 00:47:14,740 The repo is currently private. 609 00:47:14,740 --> 00:47:16,780 That will be changed soon. 610 00:47:17,540 --> 00:47:19,900 So we have two major components. 611 00:47:19,900 --> 00:47:24,020 There's a combinatorial number system encoder. 612 00:47:24,060 --> 00:47:36,140 That is an obscure but really neat trick where you can take an arbitrary number and encode it as a series of non-repeating symbols. 613 00:47:36,720 --> 00:47:48,260 So as the example shows, if you have multiple A's, that's not going to work because you can't use the same symbol more than once. 614 00:47:48,280 --> 00:47:52,720 So this is like you have an encoding of possible letters from A to Z. 615 00:47:52,720 --> 00:47:55,240 You could have B, A, D, F, G, C. 616 00:47:55,240 --> 00:48:04,080 You're picking N of them where N might be 3 or 4 or 5 depending upon how large a range of numbers you want to encode. 617 00:48:04,080 --> 00:48:05,860 And this is fairly efficient. 618 00:48:06,480 --> 00:48:08,480 This is, you can do this fast. 619 00:48:08,480 --> 00:48:11,120 You don't have to walk through all possible combinations. 620 00:48:11,920 --> 00:48:17,500 You can generate a specific numbered combination and that's your encoding. 621 00:48:17,800 --> 00:48:29,340 And so you're actually able to take arbitrary bits of input and map them to this scheme that says it's these numbers and because the numbers are a combinatorial system, they can show up in any order. 622 00:48:29,340 --> 00:48:31,000 They can show up in any order, yes. 623 00:48:31,540 --> 00:48:33,840 For decode, we just have to sort them. 624 00:48:33,840 --> 00:48:34,200 All right. 625 00:48:34,200 --> 00:48:37,900 So talking about the decode, you're not having it be raw numbers, you're having it be words. 626 00:48:37,900 --> 00:48:38,400 Right. 627 00:48:38,400 --> 00:48:43,300 So there's another step here which is our word mapper. 628 00:48:43,620 --> 00:48:48,040 Our word mapper has a dictionary file. 629 00:48:48,620 --> 00:48:57,680 In the implementation we were showing in the last slide, we actually have three dictionaries, one for nouns, one for adjectives, one for verbs. 630 00:48:57,780 --> 00:49:05,460 And we actually include three values, one with X nouns, one with X verbs, one with X adjectives and interlace them. 631 00:49:05,910 --> 00:49:08,440 But it's a little messy. 632 00:49:08,440 --> 00:49:18,600 Anyway, so our dictionary has our words in it and variant forms of the words because it makes things easier for people. 633 00:49:18,600 --> 00:49:34,120 So for the verbs, for example, it doesn't matter if you say forbidding or forbidden or forbade or whatever, they're all forms of the same verb. 634 00:49:34,120 --> 00:49:35,420 We know that. 635 00:49:35,420 --> 00:49:37,100 We canonicalize them. 636 00:49:38,120 --> 00:49:43,810 And in coding we just pick the canonical form which in this case would be forbidding. 637 00:49:46,200 --> 00:49:55,780 So we're basically taking all the common errors of password input and we're saying those common errors no longer count. 638 00:49:55,780 --> 00:49:59,340 We're going to correct for them before we even let them get into the decoder. 639 00:49:59,340 --> 00:50:00,400 Exactly. 640 00:50:00,900 --> 00:50:13,540 And I've got some crazy Python code using I think something called node box which is a linguistics suite that we use to generate all the verb forms. 641 00:50:13,540 --> 00:50:23,600 And then we have a recursive algorithm that goes through and maximizes the edit distance between words. 642 00:50:23,600 --> 00:50:39,720 If you're not familiar with edit distance, I don't remember the specific one I'm using but each character insertion, deletion, alteration or transposition of adjacent characters counts as an edit. 643 00:50:39,720 --> 00:50:52,460 So we want to have at least two edits between any words possible so that a single typo cannot possibly result in a valid but wrong word. 644 00:50:53,280 --> 00:50:57,120 Basically computational linguistics as applied to security. 645 00:51:01,890 --> 00:51:07,050 Basically a path out of using lead speak as a security technology. 646 00:51:07,590 --> 00:51:11,610 There's no more of this like, I used an app sign , I'm secure. 647 00:51:11,610 --> 00:51:16,270 We all know exactly how well that works and if you don't, go talk to the core logic guys. 648 00:51:16,270 --> 00:51:18,870 I think they have a contest that might change your mind. 649 00:51:20,170 --> 00:51:20,970 Nice. 650 00:51:20,970 --> 00:51:23,290 So it seems pretty cool. 651 00:51:23,290 --> 00:51:27,390 You think this is going to let us have passwords be generated server side? 652 00:51:27,730 --> 00:51:28,710 That's the idea. 653 00:51:28,710 --> 00:51:41,150 We generate not necessarily server side but computer generated pass phrases that there's a reasonable hope of people understanding and remembering. 654 00:51:41,350 --> 00:51:43,510 It's always seemed to me like victim shaming. 655 00:51:43,510 --> 00:51:47,510 We make the user generate the password so we can blame them when their password sucks. 656 00:51:47,510 --> 00:51:49,250 Meanwhile we have no clue how to build them one. 657 00:51:49,250 --> 00:51:59,970 I remember when a few months ago when we first started working on this, Dan came up with some examples and I think there was, I still remember most of what we had. 658 00:51:59,970 --> 00:52:03,910 We had a flat monkey staring and we had a greenhouse jumping. 659 00:52:05,050 --> 00:52:07,490 There was another tuple which I have now forgotten. 660 00:52:07,490 --> 00:52:11,210 But the point is I looked at these maybe twice ever and I still remember them. 661 00:52:11,510 --> 00:52:17,750 So we were talking last night about what the implications are for allowing more key stretching. 662 00:52:17,750 --> 00:52:22,490 Can you explain what key stretching is and why this makes it a more feasible thing? 663 00:52:22,490 --> 00:52:23,810 This is really cool. 664 00:52:23,810 --> 00:52:38,190 So key stretching is the idea where in addition to randomness in the pass phrase as a source of difficulty to crack it, we also just make the hashing slow as hell. 665 00:52:39,270 --> 00:52:44,630 You've probably all heard of B crypt or PBKDF2 or S crypt. 666 00:52:44,930 --> 00:52:46,070 Yes, thank you. 667 00:52:47,670 --> 00:53:00,950 And this is somewhat limited because if you're spinning for five seconds and it takes you three times to get your password right, you're going to just throw the computer through the window. 668 00:53:01,470 --> 00:53:07,690 But if we have spell correct, even if you make a few small typos, it works the first time. 669 00:53:07,690 --> 00:53:08,950 It's fantastic. 670 00:53:09,270 --> 00:53:21,490 And people generally aren't going to mind newly so much waiting for their login to complete as they are waiting to see if they typed their password correctly and if not having to reenter it. 671 00:53:21,490 --> 00:53:25,150 I had a high security thing I built a while ago. 672 00:53:25,150 --> 00:53:37,530 It would spin the CPU for 60 seconds and it was a threshold scheme so we had five of us having to type passwords and when somebody mistyped it, it sucked. 673 00:53:37,970 --> 00:53:43,890 But if you knew it was going to be right, one minute wouldn't even be that bad for disk encryption. 674 00:53:46,670 --> 00:53:53,990 So we're basically dealing with a common failure mode of what would otherwise be a useful and effective security technology. 675 00:53:54,630 --> 00:53:57,830 The more effective a security technology works, the more we can use it. 676 00:53:58,370 --> 00:53:58,990 Cool. 677 00:53:59,270 --> 00:54:01,030 All right, Ryan, thank you much. 678 00:54:01,030 --> 00:54:02,790 I really appreciate you building this out. 679 00:54:08,620 --> 00:54:14,260 Do we have a drink? 680 00:54:14,460 --> 00:54:15,660 Someone bring a drink. 681 00:54:17,980 --> 00:54:19,080 All right. 682 00:54:21,940 --> 00:54:22,400 I will . 683 00:54:24,780 --> 00:54:32,760 So there's a major use case to be considered with a lot of this stuff. 684 00:54:33,260 --> 00:54:38,120 Speaking of work from a previous talk, a few years ago I did something called Fidelius. 685 00:54:38,160 --> 00:54:49,880 Fidelius is basically a trick that allows you to use a passphrase, any string of characters, and use that to seed any asymmetric system. 686 00:54:49,880 --> 00:54:54,980 So you can have a passphrase for an SSH key, SSL certificate. 687 00:54:56,200 --> 00:55:04,840 Basically what I did was say, you know, a passphrase will seed a pseudo random number generator and a random stream of bits is the input to all key generators. 688 00:55:04,840 --> 00:55:09,800 So you hook the two together, you guess what's called a password authenticated key exchange scheme. 689 00:55:09,800 --> 00:55:11,280 It always works. 690 00:55:12,260 --> 00:55:16,940 This was relatively obscure two years ago. 691 00:55:17,060 --> 00:55:21,020 This is becoming straight up mainstream now. 692 00:55:21,020 --> 00:55:26,820 There's a scheme called brain wallet that allows you to have a word or phrase going to a bitcoin address. 693 00:55:26,820 --> 00:55:32,960 There's a scheme called mini lock that has a word or phrase going to, you know , the rough equivalent of a PGP key. 694 00:55:32,960 --> 00:55:35,360 Not actually PGP but still . 695 00:55:36,040 --> 00:55:43,660 These systems are incredibly vulnerable to having a low amount of true entropy. 696 00:55:43,660 --> 00:55:47,920 Because by definition you're publishing your public key. 697 00:55:47,980 --> 00:55:51,860 It's almost like it's called a public key. 698 00:55:53,620 --> 00:55:57,980 So this has been a straight up expensive problem in brain wallet. 699 00:55:57,980 --> 00:56:01,740 Tens of thousands of dollars worth of bitcoin have been stolen. 700 00:56:01,740 --> 00:56:07,580 What we need is a way for people to be able to remember more entropy. 701 00:56:07,580 --> 00:56:13,640 The idea is that storing all these bits on a hard drive ends up being a screw up. 702 00:56:13,640 --> 00:56:16,060 People want something they can hold in their head. 703 00:56:16,060 --> 00:56:23,800 If we have these sorts of representation schemes that are self correcting, people can remember more. 704 00:56:23,800 --> 00:56:25,360 Stuff will work better. 705 00:56:26,140 --> 00:56:31,660 So the general idea, brain wallet and mini lock need human memorable entropy. 706 00:56:31,660 --> 00:56:33,820 Actual security needs more entropy. 707 00:56:33,820 --> 00:56:38,220 This story bit system increases memorable entropy. 708 00:56:38,300 --> 00:56:41,700 Now there is some interesting variations on the scheme. 709 00:56:41,700 --> 00:56:47,620 You can go ahead, you can have what we call split mode where you have a normal password you use. 710 00:56:47,920 --> 00:56:49,980 It allows things to work. 711 00:56:49,980 --> 00:56:53,260 It will take like two hours to crack a key. 712 00:56:53,500 --> 00:56:59,600 And then you have like a secondary password that's really there to allow for key exchange. 713 00:56:59,600 --> 00:57:02,300 So moving a key from one location to another. 714 00:57:02,480 --> 00:57:10,860 So that can be set to take a few seconds while the slow mode, the one that's really in your head, that one might take hours and hours. 715 00:57:10,860 --> 00:57:22,240 The general idea is that, yeah, it might take you hours and hours but the relative slow down to the attacker that's trying to brute force your keys from the public key, that guy is just screwed. 716 00:57:22,240 --> 00:57:26,900 Because he has to run an attempt only one every few hours, a couple of attempts a day . 717 00:57:26,900 --> 00:57:29,720 He can wait until the end of time and he's not going to get your money. 718 00:57:31,120 --> 00:57:33,340 Two more tricks that we can do. 719 00:57:33,340 --> 00:57:37,720 These aren't necessarily good ideas but we're hackers. 720 00:57:37,820 --> 00:57:42,220 Good ideas are not exactly required here. 721 00:57:43,560 --> 00:57:56,140 It is an argument that no matter how you slice it, at minimum it's easier to remember 24 bits than to remember 80 to 128 bits. 722 00:57:56,300 --> 00:58:13,780 So there has long been a desire on the part of software developers who are presenting a key for memory to have, here's the full fingerprint which we understand you can't remember and here's a shrunk down version of it. 723 00:58:13,780 --> 00:58:15,540 Here's the PGP key ID. 724 00:58:15,540 --> 00:58:17,160 Here's the RSA ID. 725 00:58:17,160 --> 00:58:19,440 Here's some smaller amount of bits. 726 00:58:19,540 --> 00:58:26,960 And the problem is, from the attacker's standpoint, they're like, great, I don't need to collide with the big thing. 727 00:58:26,960 --> 00:58:30,100 I just need to match this 24 bits. 728 00:58:30,100 --> 00:58:33,700 It will take me a little bit of math but it won't be that bad. 729 00:58:34,200 --> 00:58:37,240 So here's the scheme that you can do. 730 00:58:37,360 --> 00:58:49,220 If the user can remember even a small passphrase that is never submitted to the server, that passphrase can be a sort of shrinker or a bit limiter. 731 00:58:49,220 --> 00:58:55,140 So you take the full hash, you hash it with the passphrase, you truncate the results. 732 00:58:55,160 --> 00:59:03,440 So the attacker still has to match all 128 bits, doesn't know the passphrase. 733 00:59:03,440 --> 00:59:08,980 Doesn't know what the 24 bits are that he actually does need to collide with. 734 00:59:08,980 --> 00:59:18,120 So this is going ahead and creating a differential between the work effort of the bad guy and the work effort of the good guy. 735 00:59:18,120 --> 00:59:21,780 You want things to be easier for the good guy. 736 00:59:22,200 --> 00:59:23,380 He has a cost. 737 00:59:23,380 --> 00:59:26,100 Your legitimate user has to remember something. 738 00:59:26,260 --> 00:59:35,760 But the idea is ten people who are trying to remember the same key each have their own personal recognition appearance. 739 00:59:35,760 --> 00:59:42,320 It's like they see the same face but for themselves every time they see someone's face it's the same face. 740 00:59:42,320 --> 00:59:44,720 But ten people are seeing ten different faces. 741 00:59:44,720 --> 00:59:45,620 It doesn't matter. 742 00:59:45,620 --> 00:59:48,540 They just need to see the same face for themselves. 743 00:59:48,540 --> 00:59:49,780 Does that make sense? 744 00:59:50,520 --> 00:59:55,160 There's a way of doing this in the opposite direction called local stretching . 745 00:59:55,740 --> 01:00:01,820 There is a problem where you have some password server. 746 01:00:02,480 --> 01:00:19,800 It's not particularly doing any work to make it so when somebody compromises the password store, because we know it happens a lot, that the attacker can't go ahead and figure out, aha, I got the password store, now I've got the plain text password. 747 01:00:20,020 --> 01:00:29,500 What you could do is have the stretching, the complexifier of the password actually happen in the client. 748 01:00:29,500 --> 01:00:40,620 So it's like, yeah, the user is remembering ABC123 but it's being expanded out a billion times before it's ever sent to the server. 749 01:00:41,220 --> 01:00:58,740 Where things get messy in having basically software generate the passphrase, the one that is the actual password for a server, is every freaking website has its own rules for what a password has to look like. 750 01:00:58,820 --> 01:01:01,680 Oh, it has to have symbols. 751 01:01:01,680 --> 01:01:03,300 It must not have symbols. 752 01:01:03,300 --> 01:01:06,220 It has to have three numbers, two numbers, eight numbers. 753 01:01:06,840 --> 01:01:13,680 By the way, going from a scheme that has to have a letter to a scheme that has to have a number, you know there are more letters than numbers. 754 01:01:14,500 --> 01:01:16,660 You kind of just made things worse. 755 01:01:19,760 --> 01:01:23,120 What you can do is a kind of a cute trick. 756 01:01:23,240 --> 01:01:28,920 And that is you can examine the pattern of the passphrase that was provided by the user. 757 01:01:28,920 --> 01:01:32,700 So the user says ABC123 with a symbol. 758 01:01:32,740 --> 01:01:36,500 And that can be interpreted as requires three numbers and a symbol. 759 01:01:36,500 --> 01:01:40,320 And then that is what is actually stretched or expanded out. 760 01:01:40,320 --> 01:01:45,720 So it's inferred discovery of password policies. 761 01:01:45,720 --> 01:01:47,000 Kind of a neat trick. 762 01:01:48,480 --> 01:01:55,980 So now we've gone ahead and we've gone into pretty amount of detail on how we generate random numbers. 763 01:01:56,080 --> 01:01:59,520 And we've also talked about how we represent arbitrary data. 764 01:01:59,700 --> 01:02:01,780 Now let's talk about some ODA, okay? 765 01:02:02,980 --> 01:02:05,160 The other shoe has kind of dropped. 766 01:02:05,220 --> 01:02:08,820 IE had more attacks in 2013 than Java. 767 01:02:08,820 --> 01:02:11,300 And you know how much we love making fun of Java. 768 01:02:12,200 --> 01:02:14,120 How is this possible? 769 01:02:14,180 --> 01:02:19,180 IE at Microsoft has been working to secure IE for a decade. 770 01:02:19,180 --> 01:02:23,880 How is it that things have fallen so far? 771 01:02:25,960 --> 01:02:28,580 So, excuse me one sec. 772 01:02:28,580 --> 01:02:30,140 Got some water in me. 773 01:02:35,120 --> 01:02:36,920 Here's the deal, guys. 774 01:02:38,200 --> 01:02:46,480 Anyone remember way, way back in the day when Microsoft was just like, you know, Internet Explorer is just Windows. 775 01:02:46,480 --> 01:02:48,060 Like, they can't be separated. 776 01:02:48,060 --> 01:02:48,980 Are you crazy? 777 01:02:50,040 --> 01:02:53,260 Everyone thought that they were lying, they were full of it. 778 01:02:53,960 --> 01:03:00,240 And you actually look at Internet Explorer, that damn thing is Windows the remix featuring the Internet, okay? 779 01:03:00,240 --> 01:03:02,500 It really is Windows. 780 01:03:03,040 --> 01:03:07,680 You have this object model that was built back in the 90s called Calm. 781 01:03:07,700 --> 01:03:09,960 And they're like, hell, let's go put that on the Internet. 782 01:03:10,540 --> 01:03:13,260 It's like if you put mem copy on the Internet, okay? 783 01:03:13,260 --> 01:03:15,080 Like, hey, you know, we've got this API here. 784 01:03:15,080 --> 01:03:17,880 It takes bytes from somewhere and puts it somewhere else. 785 01:03:20,260 --> 01:03:22,720 What, you want it secure now? 786 01:03:22,720 --> 01:03:24,780 We barely have this working. 787 01:03:26,020 --> 01:03:38,000 And don't worry, because of the nature of browsers, because they're all implementing the same standards, everybody ended up with something that looked pretty much exactly like Calm. 788 01:03:38,000 --> 01:03:42,060 Like, for example, XP Calm from Firefox. 789 01:03:42,360 --> 01:03:43,700 It's not exactly subtle. 790 01:03:43,700 --> 01:03:51,180 I mean, it is literally what's called an interface description language literally built into the very standards of the web. 791 01:03:51,180 --> 01:03:53,440 This is how it would have to work. 792 01:03:54,400 --> 01:03:57,880 Yes, attackers loved attacking plug-ins. 793 01:03:57,880 --> 01:04:06,860 Because it didn't matter if you were attacking IE or Firefox or Chrome, it was still Java, write once, own everywhere. 794 01:04:06,860 --> 01:04:08,860 You didn't have to customize it at all. 795 01:04:08,860 --> 01:04:13,660 You even got to escape all these weird little sandboxes that the attackers were messing around with. 796 01:04:14,220 --> 01:04:24,520 And so, you know, as has finally come out, my Tor de-anonymization has a first name. 797 01:04:24,520 --> 01:04:30,640 It's Firefoxoday, as the gruk might sing. 798 01:04:32,200 --> 01:04:37,840 Vulnerabilities in the raw browsers have taken over vulnerabilities in their plug-ins. 799 01:04:39,580 --> 01:04:47,420 And that's because we've been exposing the underlying object model to something that it was never really designed to be exposed to from bad guys. 800 01:04:49,960 --> 01:04:57,860 Browsers, in their normal operation, are constantly allocating memory and associating a type with it. 801 01:04:58,060 --> 01:05:00,440 This pointer is to a table. 802 01:05:00,440 --> 01:05:02,520 This pointer is to an image. 803 01:05:02,580 --> 01:05:08,220 Now, if you're going to be constantly allocating memory, you've got to free it at some point, right? 804 01:05:08,220 --> 01:05:09,980 You've got to reuse that memory. 805 01:05:10,220 --> 01:05:15,120 So what happens is, a pointer starts out and it's pointing to a table. 806 01:05:15,520 --> 01:05:19,820 And eventually , the system says, user's moved on to a new web page . 807 01:05:19,820 --> 01:05:22,480 I don't need that table anymore. 808 01:05:22,720 --> 01:05:24,300 And so that pointer is free . 809 01:05:24,860 --> 01:05:28,100 And then later, it says, ah, I've got space. 810 01:05:28,100 --> 01:05:29,020 Let's go make an image. 811 01:05:29,020 --> 01:05:30,220 Let's put an image there. 812 01:05:30,920 --> 01:05:38,100 Problem is, if you've looked at JavaScript, there's like a million ways to have a pointer to a pointer to a pointer. 813 01:05:38,560 --> 01:05:40,880 This table has an image inside of it. 814 01:05:40,880 --> 01:05:44,720 This image has a CSS thing inside of it, which has a link back to another image. 815 01:05:44,720 --> 01:05:50,180 There's a billion ways for objects in HTML and JavaScript to point to another. 816 01:05:50,640 --> 01:06:05,140 And if you ever get the system screwing up, getting it to free memory, and it still has some pointer still pointing to it, you now have two object contexts, one pointer. 817 01:06:05,140 --> 01:06:07,500 And that also works about as well as you'd hope. 818 01:06:08,180 --> 01:06:12,580 So use after free, that's when you have two different contexts in one. 819 01:06:13,240 --> 01:06:20,480 Use after free is something like 90 to 98 percent of the undiscovered vulnerabilities in browsers today. 820 01:06:20,740 --> 01:06:24,080 And it's a real problem and it's not going away. 821 01:06:25,120 --> 01:06:27,180 Except that it kind of is. 822 01:06:27,380 --> 01:06:33,480 Google and Microsoft are actually doing some pretty serious things to deal with use after free. 823 01:06:33,560 --> 01:06:36,540 The Google solution is a typed heap. 824 01:06:36,540 --> 01:06:40,880 So what they're saying is, we're going to keep all the tables together. 825 01:06:40,880 --> 01:06:43,460 We're going to keep all the images together. 826 01:06:43,460 --> 01:06:48,920 So when you go back and make a second allocation, everything is with its peers. 827 01:06:48,920 --> 01:06:54,240 You don't get some situation where you use a method of an image on a table. 828 01:06:54,240 --> 01:06:56,080 You use a method of a table on an image. 829 01:06:56,080 --> 01:06:58,960 Because everything is sticking together . 830 01:06:59,060 --> 01:07:05,480 And this actually makes it incredibly harder to go ahead and exploit vulnerabilities. 831 01:07:06,660 --> 01:07:09,220 Microsoft as well is doing stuff. 832 01:07:09,220 --> 01:07:11,220 They're doing a lot of things. 833 01:07:11,220 --> 01:07:17,660 But the fundamental advantage of their approach is what's called non-deterministic fuzzing or freeing. 834 01:07:17,960 --> 01:07:25,220 They're making it so the attacker never quite knows if they go ahead and pull their stunt, it's going to work. 835 01:07:25,340 --> 01:07:29,860 It might work, it could work, but they don't know it will. 836 01:07:30,180 --> 01:07:31,660 This is great. 837 01:07:31,660 --> 01:07:35,540 This is attacking the unique needs of an exploit. 838 01:07:35,540 --> 01:07:37,700 This is counter exploitation. 839 01:07:37,700 --> 01:07:45,640 Sure, you have probabilistic likelihood, but your requirement, your need is guaranteed reliability. 840 01:07:46,380 --> 01:07:48,900 So Microsoft is playing that game. 841 01:07:49,520 --> 01:07:51,080 I got a trick. 842 01:07:51,800 --> 01:07:53,640 A trick called Iron Heap. 843 01:07:53,640 --> 01:07:56,420 Named by the inestimable Rob Graham. 844 01:07:56,420 --> 01:07:58,220 And the idea is really simple. 845 01:07:58,220 --> 01:08:03,120 You can't use after free if you just don't have free memory. 846 01:08:04,960 --> 01:08:06,100 Nope. 847 01:08:06,540 --> 01:08:08,000 That's not going to do it. 848 01:08:09,020 --> 01:08:12,280 There's a little bit of a problem with this, you might know. 849 01:08:13,100 --> 01:08:16,140 We don't actually have an infinite amount of physical memory. 850 01:08:16,140 --> 01:08:22,900 But you know , on 64 bit machines we have an awfully large amount of virtual memory. 851 01:08:23,560 --> 01:08:28,240 So the basic idea is we never reuse an allocation. 852 01:08:28,280 --> 01:08:33,600 Your virtual memory space is 64 bits long and is basically mapped. 853 01:08:33,600 --> 01:08:39,160 Say this chunk of the address space points to this page and this chunk points to that page. 854 01:08:39,460 --> 01:08:54,180 You keep reusing physical memory, but the pointers, the stuff that's actually exposed to user space, the addresses that are actually exploitable by the various use after free techniques, they're never reused. 855 01:08:54,200 --> 01:08:56,780 Because you just have so much room. 856 01:08:56,780 --> 01:09:01,420 Look, we've only had 64 bit browsers really for a very short amount of time. 857 01:09:01,420 --> 01:09:05,640 This is the best possible use of 64 bit space. 858 01:09:05,660 --> 01:09:12,540 So the idea is that 0x1234123412341234, once it's freed, that's it. 859 01:09:12,540 --> 01:09:18,220 It never points again to an image or a CSS script or a JavaScript. 860 01:09:18,240 --> 01:09:21,980 That page stays unmapped forever. 861 01:09:22,400 --> 01:09:24,420 Exploit that. 862 01:09:25,680 --> 01:09:28,980 So we've got to do some stuff to make this efficient. 863 01:09:30,120 --> 01:09:34,560 You can only have a finite number of active allocations. 864 01:09:34,560 --> 01:09:39,840 The reason this can work at all is because there's actually hardware acceleration. 865 01:09:39,840 --> 01:09:55,960 There's what's called a memory management unit that very quickly allows a process to say, hey, I'm accessing this virtual fake address, make it really quick for me to go ahead and figure out what page of memory has the real content. 866 01:09:56,100 --> 01:09:59,820 Make it really quick for me to find out there is no page. 867 01:10:00,080 --> 01:10:03,440 You can't have an infinite amount of these mappings. 868 01:10:03,440 --> 01:10:07,100 But you don't need an infinite amount of these mappings. 869 01:10:07,180 --> 01:10:10,300 You need to have like the top 10,000. 870 01:10:10,300 --> 01:10:12,500 The top 15,000. 871 01:10:12,660 --> 01:10:15,860 Anything else can swap. 872 01:10:16,200 --> 01:10:17,140 Guess what? 873 01:10:17,440 --> 01:10:19,100 Machines swap. 874 01:10:19,840 --> 01:10:23,140 Maybe to disk, maybe to more RAM. 875 01:10:23,240 --> 01:10:28,100 But the idea is you handle the case where it's the .01 percent of the time. 876 01:10:28,900 --> 01:10:32,660 The other trick you can of course do is what's called having guard pages. 877 01:10:32,740 --> 01:10:37,100 So that means you have unallocated space between allocations. 878 01:10:37,260 --> 01:10:44,000 This gets a little fat because now you have to have 8 kilobytes used every time even if you have like an 8 byte allocation. 879 01:10:44,000 --> 01:10:45,420 And that sort of sucks. 880 01:10:45,420 --> 01:10:48,540 But again, you can do this probabilistically. 881 01:10:48,540 --> 01:10:51,520 You don't always have to go ahead and make an exploit work. 882 01:10:51,520 --> 01:10:57,260 You just have to make it a nightmare enough so the attacker never really knows if this stuff is going to work or not. 883 01:10:57,280 --> 01:10:58,860 That is cheating. 884 01:10:59,120 --> 01:10:59,940 Good. 885 01:10:59,940 --> 01:11:00,960 We get to cheat. 886 01:11:00,960 --> 01:11:01,920 We're defenders. 887 01:11:03,240 --> 01:11:07,080 Implementation wise, this can be done entirely in user space. 888 01:11:07,240 --> 01:11:10,780 So, you know, you manage memory in user space. 889 01:11:10,780 --> 01:11:13,360 You handle the exception when it's unmapped. 890 01:11:13,360 --> 01:11:15,320 You populate it in the exception. 891 01:11:16,020 --> 01:11:19,620 It can be run in the kernel because kernels are already managing page tables. 892 01:11:19,760 --> 01:11:21,520 I don't object to doing this in the kernel. 893 01:11:21,520 --> 01:11:22,960 I don't object to kernel modules. 894 01:11:22,960 --> 01:11:28,340 I'm willing to say the operating system needs to adapt to the new needs of software. 895 01:11:28,700 --> 01:11:37,480 If I don't, you know, right now to figure out what permissions are on a page in Linux, you know, parse a freaking text file out of the proc file system. 896 01:11:37,640 --> 01:11:39,960 We can be more efficient than that. 897 01:11:41,700 --> 01:11:43,260 Downsides of Iron Heap. 898 01:11:43,260 --> 01:11:45,040 One, there's no code yet. 899 01:11:45,040 --> 01:11:46,480 Just some proof of concepts. 900 01:11:46,760 --> 01:11:50,640 And two, it really does lean on 64 bit. 901 01:11:50,780 --> 01:11:56,460 And browsers, particularly Flash, aren't entirely fantastic at 64 bit yet. 902 01:11:56,460 --> 01:11:58,720 This is true and it matters. 903 01:11:58,720 --> 01:12:00,660 People like their freaking Flash. 904 01:12:01,380 --> 01:12:11,560 So, what may work today is a piece of software that got really, I don't want to say popular, but was being developed around 2007, 2008. 905 01:12:11,580 --> 01:12:13,460 A piece of code called Die Hard. 906 01:12:13,600 --> 01:12:17,080 It's an interesting secure allocator from Emery Berger over at UMass. 907 01:12:17,680 --> 01:12:21,840 It was an advanced ASLR implementation without a band heat metadata. 908 01:12:22,040 --> 01:12:26,980 It's a long way of saying when you allocate memory, it goes to hard to predict pointers. 909 01:12:26,980 --> 01:12:31,500 You don't really know where it's going to be and you don't have obvious things for you to corrupt. 910 01:12:32,240 --> 01:12:36,520 Suppresses use after free in a way very similar to the Microsoft allocators. 911 01:12:36,640 --> 01:12:40,960 So, you don't know when the memory is actually free. 912 01:12:40,960 --> 01:12:47,680 It is eventually, but, you know, Internet Explorer actually has a command that says run the garbage collector now. 913 01:12:48,300 --> 01:12:50,740 Like, it's not so good. 914 01:12:53,280 --> 01:12:58,240 The big thing about Die Hard is that they're available today. 915 01:12:58,240 --> 01:13:01,540 There's code for Windows, there's code for Mac, there's code for Linux. 916 01:13:02,880 --> 01:13:05,260 Probably worth exploring for tails. 917 01:13:05,740 --> 01:13:09,120 There's something different about this stuff. 918 01:13:09,120 --> 01:13:20,160 So, when we have normal ASLR for like loading libraries, we have what's called NX which means you can't execute code that you throw into the stack or heap somewhere. 919 01:13:20,540 --> 01:13:32,180 A lot of other defenses assume the corruption has occurred and say now that it's occurred, let's make it really tough to figure out what to do. 920 01:13:32,180 --> 01:13:36,220 What the end game is that leads to arbitrary code execution. 921 01:13:36,220 --> 01:13:39,660 Yes, you've corrupted but you don't have a path. 922 01:13:39,660 --> 01:13:47,060 And this class of defense is different because you're actually preventing the initial corrupting moment. 923 01:13:47,060 --> 01:13:54,000 If you don't have the free complete, the use after free can never start. 924 01:13:54,440 --> 01:14:01,340 There is nothing going on in infosec that is killing more O day than use after free killers. 925 01:14:01,340 --> 01:14:05,700 You cannot imagine how many undiscovered bones are in this space. 926 01:14:05,820 --> 01:14:08,760 I still remember the first time I wrote a fuzzer that found these stuff. 927 01:14:10,660 --> 01:14:13,880 Come to work every morning, it's like, ooh, look at all these, like dozens. 928 01:14:14,720 --> 01:14:22,780 Can I just say by the way, whenever like people who actually write fuzzers hear things like, and they used four O days. 929 01:14:23,260 --> 01:14:26,000 It's like, dude, I found four O days at lunch. 930 01:14:27,280 --> 01:14:31,160 Like really, you get the pattern down in quantity. 931 01:14:32,000 --> 01:14:34,140 So here's the plan, okay? 932 01:14:35,160 --> 01:14:38,020 IE has got a story around use after free. 933 01:14:38,660 --> 01:14:41,420 Chrome has got a story around use after free. 934 01:14:43,080 --> 01:14:45,160 Firefox has got some O day. 935 01:14:45,420 --> 01:14:47,560 Firefox needs a story around memory hardening. 936 01:14:47,900 --> 01:14:55,400 So it's going to take some time and it's going to be hard to convince them to give up their beautiful memory allocator gem alloc. 937 01:14:56,020 --> 01:15:05,900 But we're going to put together an actual strong secure allocator for production Firefox in the field today. 938 01:15:05,900 --> 01:15:11,400 We're going to start by building this for the Tor browser combinations, for the tails environment. 939 01:15:11,660 --> 01:15:17,500 We're going to get it so that it is indistinguishable performance wise from real native Firefox. 940 01:15:17,680 --> 01:15:23,700 It's not going to be me alone doing this as a white ops project and I actually have managed to recruit Dr. 941 01:15:23,700 --> 01:15:26,220 Emery Berger, creator of DieHard. 942 01:15:26,220 --> 01:15:29,880 We're going to go ahead, we're going to get Firefox a heck of a lot safer. 943 01:15:30,180 --> 01:15:31,460 So that's what we're up to. 944 01:15:39,510 --> 01:15:40,010 Dr. 945 01:15:40,010 --> 01:15:46,710 Berger actually came on board about 80 minutes ago, so I'm really excited to be announcing this. 946 01:15:47,870 --> 01:15:49,370 I'm like, dude, you want to join us? 947 01:15:49,370 --> 01:15:50,530 He's like, hell yeah. 948 01:15:52,970 --> 01:15:55,830 So that's what we're going to do about browsers. 949 01:15:56,850 --> 01:15:58,730 Now we've got to talk about DDoS. 950 01:15:58,970 --> 01:16:00,370 We're almost there. 951 01:16:00,370 --> 01:16:01,690 A little bit left. 952 01:16:02,330 --> 01:16:03,670 Everyone having fun here? 953 01:16:03,670 --> 01:16:05,690 I know I'm nerding out like crazy. 954 01:16:11,220 --> 01:16:12,680 All right. 955 01:16:13,180 --> 01:16:19,720 So we've got to talk about DDoS here because the bad guys are filling up our pipes. 956 01:16:20,460 --> 01:16:22,880 Series of tubes getting clogged here. 957 01:16:23,520 --> 01:16:28,280 We had all of 100 gigabit flood in 2013. 958 01:16:28,600 --> 01:16:33,340 We've had like 114 in 2014, okay? 959 01:16:33,340 --> 01:16:36,760 Like the bad guys are making a mess of things. 960 01:16:38,040 --> 01:16:43,380 I had assumed that DDoS had just turned into botnets. 961 01:16:43,380 --> 01:16:50,820 You know, you've got millions of desktops, you fire them all on some website, they all have full stacks, there's millions of machines, life sucks. 962 01:16:52,160 --> 01:17:00,660 It turns out the biggest and ugliest of the DDoS's are actually something else. 963 01:17:00,780 --> 01:17:05,660 They're not using desktop machines, they're using DNS servers. 964 01:17:05,660 --> 01:17:07,720 That's my protocol, dammit. 965 01:17:08,060 --> 01:17:10,480 Using NTP servers. 966 01:17:10,560 --> 01:17:23,080 They're lying about their source address, they're pinging some machine on the internet, they're causing those machines to reply to some poor target and it is filling everything up. 967 01:17:23,360 --> 01:17:29,980 And I want to take a minute to explain why this variation is quite so damaging. 968 01:17:30,400 --> 01:17:31,920 So here's the deal. 969 01:17:32,320 --> 01:17:35,740 I am a terrible artist. 970 01:17:36,080 --> 01:17:39,860 But I've tried to draw the internet. 971 01:17:41,400 --> 01:17:50,300 So what we've got here is you've got some source and if you're going to go down one network path you'll take the left fork and the other one you'll take the right fork. 972 01:17:50,420 --> 01:18:00,140 It spreads out and eventually as you get closer and closer to the destination there are fewer and fewer paths and finally you're at the destination. 973 01:18:00,600 --> 01:18:01,660 Does that make sense? 974 01:18:01,660 --> 01:18:06,480 Depending on where you go, you have a fan out and then a fan in. 975 01:18:07,180 --> 01:18:14,600 Now if you're flooding a single destination, all your traffic takes pretty much one route. 976 01:18:14,640 --> 01:18:19,200 It goes down, down, up, up, down. 977 01:18:19,200 --> 01:18:23,940 And that's the one route 99.9% of your traffic is going to take. 978 01:18:23,940 --> 01:18:30,680 So the most bandwidth you can consume is the least bandwidth of any of these hops. 979 01:18:31,180 --> 01:18:38,060 But now, now let's say we're going to reflect off of machines all around the internet. 980 01:18:38,140 --> 01:18:53,220 What happens is, is that your traffic fans out in all possible directions, hits all of these various name servers, each of which has their own fastest route back to some poor network. 981 01:18:53,560 --> 01:18:58,040 And I don't know if you can see it, but the entire damn network is red. 982 01:18:58,740 --> 01:18:59,660 Boom. 983 01:18:59,660 --> 01:19:01,380 This is what's going on. 984 01:19:01,820 --> 01:19:04,480 And it's ugly and it's not going away. 985 01:19:04,900 --> 01:19:05,980 So what are we going to do? 986 01:19:05,980 --> 01:19:08,340 Are we going to lose our toy? 987 01:19:08,920 --> 01:19:10,220 I don't want to lose my toy. 988 01:19:10,220 --> 01:19:11,200 I like my toy. 989 01:19:11,200 --> 01:19:13,260 I like my kitties on Roombas, damn it. 990 01:19:14,220 --> 01:19:15,800 So what are we going to do? 991 01:19:16,800 --> 01:19:20,760 Ideally there's this thing called BCP38. 992 01:19:21,100 --> 01:19:23,920 Ideally there's a technology called URPF. 993 01:19:24,080 --> 01:19:27,360 Ideally networks couldn't lie. 994 01:19:27,360 --> 01:19:36,040 So you can't be in the middle of San Francisco and be like, hey, I'm poor schlub in London and I want this DNS supply. 995 01:19:36,240 --> 01:19:37,220 Yeah. 996 01:19:39,820 --> 01:19:43,360 I'm not saying that this is a bad idea. 997 01:19:43,360 --> 01:19:52,540 I'm just saying there's a heck of a lot of networks out there that don't give a crap about filtering routes. 998 01:19:52,540 --> 01:19:57,780 The technology, I'm not saying it doesn't scale, but it totally doesn't scale. 999 01:19:57,860 --> 01:20:01,660 Effectively the technology works by dropping traffic. 1000 01:20:01,660 --> 01:20:03,800 You know what ISPs don't like doing? 1001 01:20:04,020 --> 01:20:05,700 Dropping traffic. 1002 01:20:05,940 --> 01:20:07,180 It fails once in the field. 1003 01:20:07,180 --> 01:20:09,380 They're like, I'm never turning this back on again. 1004 01:20:09,880 --> 01:20:14,300 I'm not saying we shouldn't continue to strive for BCP38 compliance. 1005 01:20:14,300 --> 01:20:16,000 Some crazy paper came out a while ago. 1006 01:20:16,000 --> 01:20:19,740 They found at least 2,300 networks that don't have it. 1007 01:20:20,100 --> 01:20:25,740 You only get the real advantage of BCP38 when it's almost entirely universal. 1008 01:20:25,760 --> 01:20:34,780 Now, it's been a tremendous success for cable modems, for DSL lines, even for a bunch of corporate environments. 1009 01:20:35,260 --> 01:20:43,720 But the really big pipes that are really able to do huge reflection attacks, they're not getting secured anytime soon. 1010 01:20:43,720 --> 01:20:47,780 At least not if we can't bust them a hell of a lot quicker. 1011 01:20:48,020 --> 01:20:50,680 So, I'm going to bust them. 1012 01:20:50,680 --> 01:20:51,680 Here's what we're going to do. 1013 01:20:51,680 --> 01:20:57,100 We're going to bring back an old idea called stochastic tracing. 1014 01:20:57,560 --> 01:20:59,660 I did not come up with this idea. 1015 01:20:59,660 --> 01:21:01,200 Maybe I've refined it a bit. 1016 01:21:01,240 --> 01:21:04,240 First heard this idea about 12 or 13 years ago. 1017 01:21:04,480 --> 01:21:15,600 And the idea is you've got a router and one out of maybe a million packets, it says, hi, I'm this router and I routed some traffic to you. 1018 01:21:15,920 --> 01:21:19,540 Doesn't do anything for your standard normal flows. 1019 01:21:19,540 --> 01:21:27,900 But if you've got a router that's being made to move billions and billions of packets, you're going to end up with a nice stream of hundreds and hundreds of tracers. 1020 01:21:28,100 --> 01:21:33,740 And these things actually incrementally improve the internet over time. 1021 01:21:33,740 --> 01:21:43,460 Because there's more and more traces and it's harder and harder for an attacker to know whether or not their spoofed traffic is going to be quickly detected back to them. 1022 01:21:44,720 --> 01:21:50,240 As it happens, routers have most of the technology necessary to already do this. 1023 01:21:50,240 --> 01:21:54,430 It's very simple to configure a router to do what's called a GRE stream. 1024 01:21:54,430 --> 01:21:57,590 To say, please send me one out of every million packets. 1025 01:21:57,790 --> 01:22:03,350 That can go to an individual daemon, we don't need to patch the router for God's sake. 1026 01:22:03,370 --> 01:22:08,310 We can go to a daemon, the daemon can go ahead and send this trace packet. 1027 01:22:08,310 --> 01:22:10,250 What does it actually mean to send a trace? 1028 01:22:10,410 --> 01:22:16,670 Because by the way, I don't want random people on the internet knowing all the traffic that I'm receiving. 1029 01:22:16,670 --> 01:22:18,590 I don't even want them knowing my DDoFs. 1030 01:22:18,750 --> 01:22:25,210 So the idea is the traces go to the destination of the flows. 1031 01:22:25,270 --> 01:22:26,970 And maybe the source. 1032 01:22:27,030 --> 01:22:33,950 There are only two IPs that are really supposed to be seeing traffic and it's the source and destination IP. 1033 01:22:34,130 --> 01:22:43,570 So if you're spoofing traffic, I don't think you have an expectation of privacy for the network to hide that you are lying about being the guy in London. 1034 01:22:44,590 --> 01:22:46,170 What does the payload actually look like? 1035 01:22:46,170 --> 01:22:47,310 That's a good question. 1036 01:22:47,310 --> 01:22:49,030 Do we encapsulate this in ICMP? 1037 01:22:49,030 --> 01:22:50,670 Do we make an HTTP post? 1038 01:22:50,670 --> 01:22:51,650 I don't know. 1039 01:22:51,650 --> 01:22:55,870 All I know is if you're on the internet, you're already receiving crap. 1040 01:22:55,870 --> 01:22:58,490 I know this because I'm sending you crap. 1041 01:23:00,190 --> 01:23:03,310 And you haven't crashed yet, I think. 1042 01:23:04,910 --> 01:23:07,270 There's an alternate option. 1043 01:23:07,350 --> 01:23:10,050 This of course comes back to my own history in DNS. 1044 01:23:11,470 --> 01:23:20,210 Sometimes it's a pain in the butt to hijack, say, all the trace traffic that's coming out of ICMP to an IP or HTTP to an IP. 1045 01:23:20,210 --> 01:23:22,530 That might actually be hard. 1046 01:23:22,830 --> 01:23:25,670 There's a space called reverse DNS. 1047 01:23:26,170 --> 01:23:36,850 4.3.2.1.inattr.arpa can say my DNS name is blahblah.foo.com with what's called a PTR record. 1048 01:23:36,950 --> 01:23:42,690 You can actually host more than just PTR records inside of reverse DNS. 1049 01:23:42,690 --> 01:23:51,470 So you could host something that actually says, yeah, I know you're trying to do tracing for 1.2.3.4. 1050 01:23:51,470 --> 01:23:54,150 Here's the server that accepts those trace packets. 1051 01:23:54,150 --> 01:23:57,310 And it's still trust associated with the IP. 1052 01:23:57,310 --> 01:23:58,390 It's very nice. 1053 01:23:59,450 --> 01:24:01,870 Obviously we want to assign trace payloads. 1054 01:24:01,870 --> 01:24:08,030 Otherwise you can spoof a whole bunch of things and be like, yeah, I'm totally Verizon moving all this traffic. 1055 01:24:08,030 --> 01:24:09,230 Go harass Verizon. 1056 01:24:09,750 --> 01:24:13,730 So we've got to prevent that and we can do that with ED25519 keys. 1057 01:24:13,730 --> 01:24:15,430 So that can work. 1058 01:24:15,730 --> 01:24:24,050 The long term vision is to reduce the time between a DDoS and tracing the involved networks. 1059 01:24:24,210 --> 01:24:26,930 We've got to make this stuff happen faster. 1060 01:24:26,930 --> 01:24:32,650 Ultimately what we need to do is we need to get to the point where DDoS is automatically suppressed. 1061 01:24:32,650 --> 01:24:37,330 Where there can be firewall rules that are automatically applied. 1062 01:24:37,330 --> 01:24:39,010 Now this is rough. 1063 01:24:39,010 --> 01:24:44,410 Because there's a lot of hops that are going to see enough to be able to request firewalling. 1064 01:24:44,410 --> 01:24:46,950 So I don't know exactly how this works. 1065 01:24:46,950 --> 01:24:57,010 But what I do know is that these floods are growing fast enough and nasty enough that we may actually get the greatly feared congestion collapse. 1066 01:24:57,010 --> 01:25:05,150 There may actually be entire countries, entire regions of the globe that just have too much traffic for anything to work. 1067 01:25:05,950 --> 01:25:11,170 And I think Paul Vixen would kill me if I didn't say, by the way, you know, we can, like, patch name servers. 1068 01:25:11,170 --> 01:25:12,950 We don't participate in this anymore. 1069 01:25:13,070 --> 01:25:14,190 Call RRD. 1070 01:25:14,750 --> 01:25:23,350 But unfortunately it requires so many hosts to upgrade versus this kind of stuff which is just incrementally improving. 1071 01:25:25,070 --> 01:25:32,490 So let's talk about practically the last thing I wanted to discuss in this epically long talk today. 1072 01:25:32,490 --> 01:25:34,410 I don't know why I said I wanted a two-hour talk. 1073 01:25:34,410 --> 01:25:35,950 Am I trying to kill myself here? 1074 01:25:36,810 --> 01:25:37,830 All right. 1075 01:25:38,910 --> 01:25:42,350 Can't just not talk about this whole NSA thing. 1076 01:25:42,670 --> 01:25:44,570 Can't just leave it to Bruce Schneier. 1077 01:25:46,170 --> 01:25:47,830 I love Bruce. 1078 01:25:49,990 --> 01:25:51,110 I'm worried. 1079 01:25:51,270 --> 01:25:57,070 I'm worried about the long-term reaction to the NSA revelations. 1080 01:25:57,090 --> 01:26:02,650 See, there are two ways that you can win in technology. 1081 01:26:02,890 --> 01:26:07,750 You can have the better technology or you can have FUD. 1082 01:26:07,790 --> 01:26:10,150 Oh sure, you can go with that competitor. 1083 01:26:10,150 --> 01:26:15,350 They're cheaper, faster, nicer, more powerful, but ooga booga nation state. 1084 01:26:16,130 --> 01:26:25,190 This sounds ridiculous until you realize there really are proposals to go ahead and keep all traffic within a country within a country . 1085 01:26:25,350 --> 01:26:35,070 This is really, sure BGP says this route is faster, better , easier, but the law says you have to keep it within our borders where we can monitor it all. 1086 01:26:35,070 --> 01:26:36,250 Thank you very much. 1087 01:26:38,010 --> 01:26:42,470 The Internet, again, was not the first time we tried to make the Internet. 1088 01:26:42,510 --> 01:26:49,570 It was the first one that worked at large scale because you didn't have this sort of political interference. 1089 01:26:49,950 --> 01:26:57,910 This was the network made by nerds who had one thing they wanted which was make this work, make this work as fast as possible. 1090 01:26:58,650 --> 01:27:02,550 And a lot of these political actors have a different goal in mind. 1091 01:27:02,730 --> 01:27:09,590 You know, we didn't want the Chinese Internet or the Iranian Internet before Snowden. 1092 01:27:09,690 --> 01:27:11,950 I hope we don't want that now. 1093 01:27:12,310 --> 01:27:26,170 But I look out there and I look at the reactions to the NSA and especially their manipulation of crypto standards and there really is only one thing I can think. 1094 01:27:27,990 --> 01:27:29,470 You maniacs! 1095 01:27:29,470 --> 01:27:30,810 You finally did it! 1096 01:27:30,810 --> 01:27:32,630 You blew it all up! 1097 01:27:32,630 --> 01:27:34,470 Damn you to hell! 1098 01:27:45,770 --> 01:27:50,070 Let me tell you the honest truth about cryptography. 1099 01:27:50,070 --> 01:28:01,890 And if you don't know, the NSA pushed and got a broken crypto standard into, well, they wanted to have everyone use it but really they only screwed other feds. 1100 01:28:05,210 --> 01:28:11,210 There's a reason we were asking the NSA's advice for cryptographic vulnerabilities. 1101 01:28:11,210 --> 01:28:11,810 Okay? 1102 01:28:11,810 --> 01:28:17,290 Most crypto functions do not need the NSA's help to suck. 1103 01:28:17,290 --> 01:28:19,470 They get that for free. 1104 01:28:21,370 --> 01:28:22,730 Okay? 1105 01:28:22,730 --> 01:28:31,350 It takes like 10 years to figure out that a cypher or a hash or whatever might actually be safe. 1106 01:28:31,830 --> 01:28:38,990 And the NSA has actually been pretty good at saying, something's wrong here. 1107 01:28:38,990 --> 01:28:41,330 This thing in Ness, it's not good. 1108 01:28:41,330 --> 01:28:44,030 This thing in Shaw Zero, it's not good. 1109 01:28:44,030 --> 01:28:45,010 Excuse me, I'm out. 1110 01:28:46,450 --> 01:28:47,090 You 1111 01:28:52,580 --> 01:28:58,380 know, it sucks. 1112 01:28:58,380 --> 01:29:06,500 Wouldn't it be nice if we had like a department of the government that was dedicated to defense? 1113 01:29:06,780 --> 01:29:10,460 Like a department of defense? 1114 01:29:10,840 --> 01:29:16,600 They could have like a conference, like a DEF CON. 1115 01:29:20,230 --> 01:29:27,090 What's happening is that even good advice is being treated with deep suspicion. 1116 01:29:27,330 --> 01:29:35,810 NIST is like, hey, yeah, we standardized on this Kessack algorithm, but wow, Shaw 3 is slower than Shaw 256 in performance patterns. 1117 01:29:36,250 --> 01:29:39,790 And, you know, this is not a controversial opinion. 1118 01:29:39,870 --> 01:29:46,630 Zuko of Tahoe LFS is like, hey, Kessack is too slow in performance patterns. 1119 01:29:46,930 --> 01:29:49,630 The community is like, NIST , NIST is evil. 1120 01:29:49,630 --> 01:29:50,770 NIST is doing more evil. 1121 01:29:50,770 --> 01:29:53,730 They got NSA pulling their strings . 1122 01:29:54,290 --> 01:29:56,230 And what's the end result? 1123 01:29:56,790 --> 01:30:01,070 We are totally replacing NIST with DJB. 1124 01:30:01,210 --> 01:30:03,490 With some guy. 1125 01:30:04,490 --> 01:30:10,010 Now, I want to be clear, I'm an enormous DJB fan. 1126 01:30:10,010 --> 01:30:17,950 I've been advocating curve 25519 for using TLS replacing protocol for literally like half a decade . 1127 01:30:18,090 --> 01:30:24,770 But fewer trusted resources in a time of great need , not actually helpful. 1128 01:30:24,770 --> 01:30:29,270 There's that great quote, Linux scales, Linux does not scale. 1129 01:30:30,970 --> 01:30:33,130 I have a graph. 1130 01:30:33,770 --> 01:30:38,070 And this graph explains the problem very clearly. 1131 01:30:42,640 --> 01:30:46,180 The NSA has two missions. 1132 01:30:46,380 --> 01:30:50,020 DJB pretty sure only has one. 1133 01:30:51,220 --> 01:30:53,280 This is what's going on here, okay? 1134 01:30:53,280 --> 01:31:00,120 Like sometimes one of these guys finds a bug and says, cool. 1135 01:31:00,700 --> 01:31:02,920 And it's not DJB. 1136 01:31:05,180 --> 01:31:08,040 So we're all kind of waiting for the other shoe to drop. 1137 01:31:09,480 --> 01:31:10,940 Not implementers. 1138 01:31:10,940 --> 01:31:15,940 If you've noticed, pretty much everything new that comes out just uses DJB sec. 1139 01:31:15,940 --> 01:31:18,020 Like his stuff is one. 1140 01:31:18,060 --> 01:31:23,320 Everything new is, you know, 25519 or, you know, bad ass or libsodium. 1141 01:31:23,320 --> 01:31:26,880 His stuff has won the day with implementers. 1142 01:31:29,080 --> 01:31:31,580 There's what's called epistemology. 1143 01:31:31,580 --> 01:31:34,200 There's how do you know what you know. 1144 01:31:34,500 --> 01:31:38,240 Academics aren't really allowed to know things without some degree of evidence. 1145 01:31:38,240 --> 01:31:42,540 This is kind of a barrier to a lot of FUD and BS. 1146 01:31:42,620 --> 01:31:44,500 This is kind of the heart of science . 1147 01:31:45,180 --> 01:31:48,200 We do know that dual ECDPRG is bad. 1148 01:31:48,200 --> 01:31:50,920 We have hard evidence, we have math and so on. 1149 01:31:51,380 --> 01:31:53,300 But there's another shoe. 1150 01:31:53,300 --> 01:31:56,120 And that shoe is what's called the NIST P curves. 1151 01:31:56,360 --> 01:31:59,740 There's this great technology, it's called elliptical curves. 1152 01:31:59,740 --> 01:32:01,980 Elliptical curves requires parameters. 1153 01:32:02,340 --> 01:32:06,580 There are two major sets of parameters that came out of NIST. 1154 01:32:06,640 --> 01:32:09,060 The P curves and the K curves. 1155 01:32:09,100 --> 01:32:12,560 We know exactly how the K curves were constructed. 1156 01:32:12,580 --> 01:32:20,780 You take this value that comes from a mathematical function, you put it in what's called a nothing up your sleeve generator to show there's nothing up your sleeve. 1157 01:32:20,980 --> 01:32:23,680 And now you have your parameters and everything is good. 1158 01:32:24,160 --> 01:32:35,100 And then there's the P curves where that thing that's going into the nothing up your sleeve generator is C493608 dot, dot, dot. 1159 01:32:36,440 --> 01:32:38,380 Every shirt has two sleeves. 1160 01:32:41,140 --> 01:32:45,360 I'm not saying we know that the P curves are compromised. 1161 01:32:45,540 --> 01:32:50,880 However, if you don't plan on the P curves being compromised, you're an idiot. 1162 01:32:51,600 --> 01:32:53,080 And you should get fired. 1163 01:32:53,360 --> 01:32:58,700 And in fact, that's pretty much what all implementers have realized. 1164 01:32:58,700 --> 01:33:08,740 One of probably the most interesting things about Bitcoin is a long time ago they said, yeah, this P curve stuff is garbage, let's go with the K curves. 1165 01:33:09,040 --> 01:33:12,920 So this is something that everyone is sort of waiting for. 1166 01:33:12,920 --> 01:33:15,760 It's not like we know it. 1167 01:33:15,780 --> 01:33:17,080 But we know it. 1168 01:33:18,520 --> 01:33:25,400 The larger issue is it's not like crypto worked particularly well before the NSA con revelations, okay? 1169 01:33:25,400 --> 01:33:28,920 The hard problems in crypto actually aren't the math. 1170 01:33:28,960 --> 01:33:33,460 They're actually not even the implementations, although GPGG are gone inside. 1171 01:33:34,500 --> 01:33:40,360 Key management is the hard part because this is what actually touches users and organizations. 1172 01:33:40,380 --> 01:33:47,460 We keep modeling cryptography as math and implementation but there's a complexity that goes unnoticed and that's operations, okay? 1173 01:33:47,560 --> 01:33:51,500 Every project in the real world, who here works in IT? 1174 01:33:52,980 --> 01:33:53,820 Okay? 1175 01:33:54,040 --> 01:34:03,080 Tell me I'm wrong when I say every project needs to be measured only in terms of how many god damn meetings you need to do in order to complete it. 1176 01:34:05,710 --> 01:34:07,350 That is the metric. 1177 01:34:10,850 --> 01:34:16,390 When is the last time you saw a meeting count measured in anything to do with cryptography? 1178 01:34:17,210 --> 01:34:19,710 When's the last time you saw crypto work in the field? 1179 01:34:20,370 --> 01:34:22,290 Not an unrelated thing. 1180 01:34:22,390 --> 01:34:30,370 We have to learn to respect usability, we have to learn that this isn't the operational requirement. 1181 01:34:30,590 --> 01:34:34,790 Over at Black Hat, one of the most significant announcements in some time happened. 1182 01:34:34,910 --> 01:34:40,450 Somehow Alex Stamos, one of the founders of ISAC, got root at Yahoo. 1183 01:34:40,930 --> 01:34:44,410 I don't know how he did it but he's like, you know what? 1184 01:34:44,410 --> 01:34:48,910 We're going to do end to end PGP for Yahoo freaking mail. 1185 01:34:49,950 --> 01:34:51,150 Sweet! 1186 01:34:55,520 --> 01:34:56,700 Because you know what? 1187 01:34:56,700 --> 01:35:02,320 Google might understand user experience but Yahoo really, really understands it. 1188 01:35:03,480 --> 01:35:06,900 So, summary of what we've talked about today. 1189 01:35:06,900 --> 01:35:08,320 We're almost done here. 1190 01:35:08,600 --> 01:35:11,140 Don't let an attacker touch your storage. 1191 01:35:11,140 --> 01:35:14,840 Let it store, let it execute, don't let it do both. 1192 01:35:15,320 --> 01:35:17,520 Actively gather true entropy. 1193 01:35:17,560 --> 01:35:21,020 Death to non cryptographically secure PRNGs. 1194 01:35:21,480 --> 01:35:26,160 Please, for the love of God, represent entropy in a way other than bit vomit. 1195 01:35:26,980 --> 01:35:33,140 Browsers become vastly more secure once use after free is prevented and we are going to fix this in Firefox. 1196 01:35:34,020 --> 01:35:37,080 The NSA crypto fallout continues. 1197 01:35:37,080 --> 01:35:38,680 It hasn't gone away. 1198 01:35:38,680 --> 01:35:45,200 There's been a wholesale movement to, while I'm a fan of the guy, he's a guy. 1199 01:35:45,220 --> 01:35:46,940 He's a professor at UIUC. 1200 01:35:47,800 --> 01:35:49,900 Yahoo's PGP news is fantastic. 1201 01:35:49,900 --> 01:35:52,660 One of the most significant things of the year. 1202 01:35:52,760 --> 01:35:54,220 Maybe of a couple years. 1203 01:35:54,220 --> 01:35:58,860 And, just because I can, just one more thing. 1204 01:35:59,940 --> 01:36:02,140 I totally get to pull this. 1205 01:36:03,820 --> 01:36:05,640 It's Apple related. 1206 01:36:06,520 --> 01:36:18,520 Apple went ahead and put into their latest release notes for iOS 8, Safari now blocks ads from automatically redirecting to the app store without user interaction. 1207 01:36:18,520 --> 01:36:26,500 If you still see the previous behavior or find legitimate redirection to the app store to be broken in some way, please file a bug. 1208 01:36:28,200 --> 01:36:29,120 Yes. 1209 01:36:29,120 --> 01:36:29,900 Okay? 1210 01:36:29,900 --> 01:36:40,300 I am tired of browsing something on my phone and it's like, I know you're trying to browse this website but what I really think you want to do is pay money to Kim Kardashian. 1211 01:36:41,980 --> 01:36:42,900 No. 1212 01:36:42,900 --> 01:36:44,660 That is not what I want to do. 1213 01:36:44,660 --> 01:36:46,260 Fuck those guys. 1214 01:36:46,720 --> 01:36:48,940 Apple wants help, let's give it to them. 1215 01:36:53,450 --> 01:36:58,570 Now, I talked about this on Twitter before and I said, hey, I'll give you 250 bucks. 1216 01:36:58,630 --> 01:37:00,570 Screw that, I got a company . 1217 01:37:00,730 --> 01:37:05,410 I'll give you five fricking grand for the first person to go ahead and give Apple some bugs they can fix. 1218 01:37:05,410 --> 01:37:09,630 I want to see this dead off the mobile internet, okay? 1219 01:37:09,630 --> 01:37:12,330 I've become a believer in bug bounties. 1220 01:37:12,330 --> 01:37:15,330 This is a complete 180 on my old position. 1221 01:37:15,350 --> 01:37:26,370 I used to think that bug bounties would lead to crappy bugs and people being idiots and demanding money anyway and it would just be cheaper to pay them off. 1222 01:37:26,970 --> 01:37:33,210 You can't imagine how crappy bugs are that come in from the outside world sometimes. 1223 01:37:33,210 --> 01:37:36,970 People have no idea how stuff works and they think they're geniuses. 1224 01:37:38,690 --> 01:37:40,610 But I was wrong. 1225 01:37:40,630 --> 01:37:41,610 I'm telling you this. 1226 01:37:41,610 --> 01:37:43,410 I've seen the results firsthand. 1227 01:37:43,990 --> 01:37:51,010 If you want richer bugs from the outside world, maybe you should make bug finders richer. 1228 01:37:51,590 --> 01:38:00,810 Turns out that when you actually have a sample of good bugs you can pay for, you can now be like, yeah, we paid for the good bug, your thing is crap. 1229 01:38:01,650 --> 01:38:10,050 So we're not just doing 250 bucks, we're going to give $5,000 to the first finder, 2,500 to the second, 1,000 to maybe the next five. 1230 01:38:10,190 --> 01:38:12,790 If we get more, we might keep throwing more money at this. 1231 01:38:12,790 --> 01:38:14,310 I don't know how many bugs there are. 1232 01:38:14,530 --> 01:38:20,910 But we believe in A, this sort of behavior is toxic. 1233 01:38:20,910 --> 01:38:22,530 It destroys the mobile web. 1234 01:38:22,590 --> 01:38:24,610 It is some of the worst stuff we see in advertising. 1235 01:38:24,610 --> 01:38:26,950 And I run a company that fixes advertising. 1236 01:38:26,990 --> 01:38:28,370 This is still offensive. 1237 01:38:28,990 --> 01:38:35,530 And I think hackers can fix things and I'm willing to put my money where my mouth is. 1238 01:38:35,690 --> 01:38:37,430 So thank you all. 1239 01:38:37,430 --> 01:38:39,570 This has been a blast.