WEBVTT

00:00.000 --> 00:02.940
DEF CON, I missed you.

00:04.080 --> 00:05.200
Wow.

00:05.640 --> 00:11.680
So, show of hands, how many people are here for their absolute very first DEF CON?

00:13.060 --> 00:14.460
Thank you.

00:16.680 --> 00:21.840
You know, I've been doing DEF CON for a long time.

00:21.840 --> 00:23.740
This is about my 15th year.

00:23.780 --> 00:26.040
And I've watched it grow up.

00:26.040 --> 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.

00:32.580 --> 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.

00:43.020 --> 00:48.560
And you guys see this iHackPineapples guy?

00:49.100 --> 00:53.140
I don't know who you are, but you're my freaking hero.

00:55.200 --> 00:59.200
Basically this guy is like, you're going to come to DEF CON, you're going to hijack the Wi-Fi.

00:59.200 --> 01:02.460
Yeah, I'm going to take that really crappy piece of gear you bought and I'm going to break it.

01:02.460 --> 01:03.640
And if you're late, you can fix it.

01:03.640 --> 01:05.120
And if not, go get a refund.

01:06.680 --> 01:08.260
So, awesome.

01:08.640 --> 01:10.580
So what am I here to talk to you about?

01:11.180 --> 01:14.900
So I have a little bit of a tradition when it comes to my DEF CON talk.

01:14.900 --> 01:17.540
I never actually tell people what I'm going to talk about.

01:17.780 --> 01:18.420
Sorry.

01:18.660 --> 01:20.500
I don't know what I'm going to talk about.

01:20.720 --> 01:24.940
The subjects of my talk is a decent random number generator.

01:26.740 --> 01:31.000
So my talks are weird for DEF CON.

01:31.000 --> 01:33.880
Because, you know, we're hackers.

01:33.960 --> 01:36.000
We like to break things.

01:36.000 --> 01:40.400
But that's not really just what I do here.

01:40.800 --> 01:44.060
I like to show what's possible.

01:44.060 --> 01:49.120
And I like to show, hey, we can scan the entire Internet in a series of seconds.

01:49.120 --> 01:52.700
We can bust people who are doing violations of network neutrality.

01:52.700 --> 01:55.220
There's a few funny things we can do over DNS.

01:57.420 --> 01:58.420
Actually it was great.

01:58.420 --> 02:03.260
I once had like Darth Vader dancing on stage video streaming over DNS.

02:03.260 --> 02:06.040
Somebody told me you couldn't get high bandwidth over DNS.

02:06.040 --> 02:07.580
Somebody was wrong.

02:09.380 --> 02:11.280
But this is not the same thing.

02:11.280 --> 02:13.560
It's just showing what can be broken.

02:15.360 --> 02:20.500
So let's talk about why, what we're going to talk about today.

02:20.500 --> 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.

02:25.820 --> 02:27.640
We have a bunch of subjects.

02:27.760 --> 02:35.000
We are actually going to talk about why random number generation keeps getting things owned year after year.

02:35.160 --> 02:40.580
Have kind of a quote which is I would like to not be fixing the same bugs 15 years from now.

02:40.580 --> 02:42.460
I'd like to be fixing new bugs.

02:42.460 --> 02:45.840
But that would require dealing with the existing stuff.

02:46.520 --> 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.

02:55.200 --> 02:57.480
I want to talk about browser road day.

02:57.480 --> 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.

03:04.920 --> 03:06.720
I want to talk about DDoS.

03:08.020 --> 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.

03:17.340 --> 03:21.560
So how much did the NSA shit the bed anyway?

03:22.860 --> 03:28.780
But before any of that, I want to talk about why hackers are useful.

03:28.840 --> 03:33.460
And I want to do that by discussing of all things, hard drives.

03:34.300 --> 03:36.260
So let me give you a scenario.

03:36.960 --> 03:42.340
An attacker has compromised a system and put something malicious on the hard drive.

03:42.580 --> 03:44.260
How bad could it be?

03:44.340 --> 03:46.380
What could possibly go wrong?

03:46.620 --> 03:50.080
Well, you know, they might have put in like an auto-launching daemon.

03:50.080 --> 03:52.240
You boot up your machine, it's got a root kit.

03:52.280 --> 03:55.120
You might have replaced some core operating system files.

03:55.120 --> 03:59.340
Maybe they got really, really clever and they like hit the master boot records.

03:59.340 --> 04:03.400
The first thing the computer does right when it turns on is load some piece of malware.

04:03.700 --> 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?

04:12.440 --> 04:18.500
Well, this funny thing happens when you start researching hard drives.

04:18.800 --> 04:21.000
So a little bit of a joke .

04:21.700 --> 04:26.480
What is the difference between a hard drive and a brick?

04:26.820 --> 04:34.020
The answer to this question is, given sufficient research, there is no difference.

04:35.300 --> 04:38.720
Never in my life have I done more expensive research.

04:38.720 --> 04:40.080
There goes 75 bucks.

04:40.080 --> 04:41.600
There it is gone again.

04:41.900 --> 04:45.000
See, here's the deal.

04:45.340 --> 04:50.760
In theory, a hard drive is a thing you put data on.

04:50.760 --> 04:54.960
Bits go in, bits come out, the bits stay the same.

04:55.040 --> 05:04.480
In reality, we have what I like to call exhibits iron law of computer architecture.

05:04.720 --> 05:07.860
Yo dog, I heard you like computers.

05:07.860 --> 05:13.060
So I put a computer in your computer so you can compute while you compute.

05:19.810 --> 05:28.910
Now what is great about this iron law is that the more you understand about computer architecture, the truer it gets.

05:28.910 --> 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.

05:37.590 --> 05:43.890
And of course, it's doing it fast, it's doing it trusted, it's doing it insecurely.

05:44.130 --> 05:49.910
The reality is, is that everything in your computer has become very generic.

05:50.050 --> 05:53.890
Your iPhone has seven ARM chips.

05:54.010 --> 05:59.390
The biggest lie about a computer is that it's just one.

05:59.570 --> 06:00.230
Okay?

06:00.470 --> 06:09.750
Every device you have ever owned is a small network of mutually trusting, overly mutually trusting devices.

06:10.210 --> 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.

06:18.690 --> 06:20.070
Now maybe you doubt me .

06:20.070 --> 06:23.010
Maybe you think, oh, come on, Dan, you might be exaggerating .

06:23.010 --> 06:28.350
So let me actually show you what happens when you log into your hard drive.

06:28.950 --> 06:34.210
I did this project with Travis Goodspeed, probably the single most entertaining hardware hacker in the world.

06:34.210 --> 06:37.410
He's the guy behind POC, GTFO, proof of concept.

06:37.410 --> 06:38.770
Get the fuck out.

06:40.170 --> 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.

06:48.330 --> 06:50.410
What happens when you go into the serial port ?

06:50.410 --> 06:53.210
Well, you know, there's like an entire shell.

06:53.210 --> 06:55.090
It has like documentation.

06:55.430 --> 06:58.070
It actually tells you what your commands are.

06:58.070 --> 07:00.290
Oh, really, edit processor memory.

07:00.290 --> 07:02.690
And here are my arguments that I need to know for that.

07:02.690 --> 07:03.470
Sweet.

07:03.790 --> 07:06.130
You get some internal drive metadata.

07:06.330 --> 07:07.250
Like there's no hacking here.

07:07.250 --> 07:09.130
It's like a straight up interface, right?

07:09.510 --> 07:14.010
You can go ahead, you can like learn about your main disk, the public one.

07:14.110 --> 07:15.330
There's a second one.

07:15.330 --> 07:16.910
There's an entire system partition.

07:16.910 --> 07:18.670
You can go ahead and scrape through that too.

07:19.190 --> 07:21.310
Read the data back out.

07:21.310 --> 07:23.370
Actually take a look at the data.

07:23.370 --> 07:27.950
You know, when your hard drive is initialized, they run a bunch of tests.

07:27.950 --> 07:29.470
This is a Seagate hard drive.

07:29.470 --> 07:32.270
It's actually Seagate's test output.

07:32.270 --> 07:35.670
My favorite part of course being WTF status.

07:35.770 --> 07:36.590
Sweet.

07:40.070 --> 07:46.050
Now you might be saying, but Dan, you had to like hook up special pins to the hard drive.

07:46.050 --> 07:48.890
What, an attacker is going to teleport to your home and do that ?

07:48.890 --> 07:49.970
No, no, no.

07:50.330 --> 07:56.610
An attacker is going to go ahead and there's a great command for messing with hard drives called HD parm.

07:56.610 --> 07:57.690
We're going to run help on it.

07:57.690 --> 08:03.150
We're going to grep for my favorite phrase in computer security, extremely dangerous.

08:10.320 --> 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.

08:20.580 --> 08:24.860
So I'm not kidding about making bricks.

08:24.860 --> 08:32.620
I actually have my lab notes from this and it looks like a, I don't know, a wake.

08:32.620 --> 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.

08:40.100 --> 08:42.260
Firmware dump is 01 wrong.

08:42.300 --> 08:45.100
Brick by Dan when he wrote to the buffer, probably repairable.

08:45.100 --> 08:47.000
Brick by Dan with HD parm.

08:47.000 --> 08:50.960
Brick by Dan when he set the serial port to 62,500.

08:50.960 --> 08:55.200
You look at these things funny and they blow up.

08:55.780 --> 08:58.700
I tell you it's the most effective security technology of the hard drives.

09:01.060 --> 09:05.360
So this eventually became a paper with a somewhat predictable subject.

09:05.520 --> 09:09.600
Implementation and implications of a stealth hard drive back door.

09:10.320 --> 09:13.640
I'm kind of an unindicted co-conspirator on this.

09:13.640 --> 09:15.040
They did ten months of work.

09:15.040 --> 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.

09:25.400 --> 09:27.400
It's owned forever.

09:27.580 --> 09:28.860
Kind of nice.

09:29.160 --> 09:31.500
Why do I tell you all of this?

09:32.280 --> 09:39.520
There is something which I have been discussing privately for some time called storage XOR execution.

09:39.520 --> 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,

10:00.380 --> 10:06.600
that stores from the piece of the system that computes, that operates, that parses.

10:06.660 --> 10:12.500
So sure, you can go ahead and provide some malicious input and own the machine.

10:12.500 --> 10:13.900
That might happen.

10:13.900 --> 10:20.660
But you can't keep your ownership without storing it somewhere where it might get discovered.

10:21.220 --> 10:23.760
You actually spend time with attackers.

10:23.760 --> 10:26.920
One of the things they tell you is it's not about ownage.

10:26.920 --> 10:28.180
It's about continued ownage.

10:28.180 --> 10:32.220
It's about coming back in a year and your root kit is still ready to go.

10:32.220 --> 10:34.360
You don't have to break your way back in.

10:34.940 --> 10:35.720
Okay?

10:36.220 --> 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.

10:50.800 --> 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.

10:59.040 --> 11:01.060
People say, how can we be discussing this?

11:01.060 --> 11:02.500
These attacks aren't very advanced.

11:02.500 --> 11:07.820
I'm like, holy hell, we have people admitting we have vulnerabilities we have no idea what to do about.

11:07.900 --> 11:08.860
Great.

11:08.860 --> 11:09.840
Stuff is not working.

11:09.840 --> 11:11.920
Let's at least talk about that.

11:13.880 --> 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.

11:31.260 --> 11:36.880
Perhaps there should not be one piece of hardware for two different customers.

11:36.880 --> 11:38.200
Two customers, one hardware.

11:41.640 --> 11:43.760
Works about as well as you think.

11:45.280 --> 11:50.840
This, this is the value of hacker engineering.

11:50.960 --> 11:55.460
See what I like about hacking is that we have no delusions, okay?

11:55.460 --> 12:02.080
We are willing to see what systems are actually capable of from first principles.

12:02.140 --> 12:05.620
In fact you say something is impossible and we get to work.

12:06.480 --> 12:07.760
We are needed.

12:07.960 --> 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.

12:14.980 --> 12:17.000
At least we have a fighting chance.

12:17.460 --> 12:18.600
You know what?

12:18.840 --> 12:22.400
I got to say, I like hacking all the things.

12:23.180 --> 12:25.260
But I also like all the things.

12:25.800 --> 12:30.160
Let me show you something very near and dear to my heart.

12:31.040 --> 12:39.380
This is a cat in a shark costume on a Roomba chasing a duck.

12:40.220 --> 12:41.800
Fuck yeah!

12:48.690 --> 12:50.870
The internet has changed things.

12:50.870 --> 12:52.310
I get this cat.

12:52.310 --> 12:53.990
There's no Bob Saget.

12:53.990 --> 12:55.970
There's no America's Funniest Home Videos.

12:55.970 --> 12:59.050
There's no Wiffle Ball hitting some kid in the nuts.

13:00.030 --> 13:02.390
There's just the kitty, okay?

13:02.390 --> 13:06.030
And that, that is awesome, okay?

13:06.030 --> 13:12.710
One of my favorite artists, she goes on television, she's told, your music sounds like a rat being strangled.

13:12.710 --> 13:15.970
She goes, why yes, there's a market for dubstep.

13:15.970 --> 13:19.230
I should play violin while playing dubstep.

13:19.230 --> 13:22.890
She gets a half billion views on YouTube.

13:22.890 --> 13:24.890
She's a big deal now.

13:24.970 --> 13:31.070
And yeah, she does it with playing songs from Skyrim and Halo and Zelda.

13:31.070 --> 13:34.670
This appeals to my interest, okay?

13:34.770 --> 13:36.390
Lindsay Stolle has rocked it.

13:36.390 --> 13:42.590
We live in a world that sucks less because of the internet.

13:43.010 --> 13:44.570
I believe in email.

13:45.150 --> 13:51.010
I have never in my life received an inter-office memo and I hope I never do.

13:51.110 --> 13:57.910
I prefer Skype over plain old telephone, plain owned telephone service.

13:58.430 --> 14:03.710
I prefer online banking over having to sit for hours in a line in a bank.

14:04.530 --> 14:08.290
The internet has changed how things work.

14:08.770 --> 14:10.930
We could lose it.

14:10.990 --> 14:17.810
Like there's a level of compromise out there where we don't get all these nice things.

14:17.890 --> 14:20.470
And there are some people who even prefer that.

14:21.890 --> 14:28.410
Got to remember, the internet was not the first time we tried to create the internet.

14:28.410 --> 14:30.390
It's very matrixed like that.

14:30.390 --> 14:32.470
This is like the eighth attempt.

14:33.010 --> 14:37.490
Who here is on like Prodigy or Minitel or AOL?

14:38.230 --> 14:42.810
Like, we tried this a bunch of times.

14:42.810 --> 14:46.950
AOL spent like a billion dollars on modems one year .

14:47.170 --> 14:48.290
Turned out it was a good investment.

14:48.290 --> 14:51.210
They're still making $160 million a year off that stuff.

14:52.150 --> 14:54.130
Grandma loves her dial up.

14:55.990 --> 15:02.190
The reason the internet worked is because it was ours.

15:02.190 --> 15:02.670
Okay?

15:02.670 --> 15:05.190
This was the playground of nerds.

15:05.190 --> 15:08.970
This wasn't biz dudes who made something for biz reasons.

15:08.970 --> 15:13.130
This was nerds who were like, I got to send me some e-mail.

15:13.830 --> 15:19.650
And the key is, my God, it was cheap.

15:19.650 --> 15:24.610
No one on the internet ever said that you had to pay some portion of your revenues.

15:24.830 --> 15:27.730
People complain about paying for DNS names.

15:27.770 --> 15:34.090
What is the ratio between how much money Google makes and how much they pay for Google.com?

15:34.090 --> 15:36.410
I don't think there's a smaller number.

15:39.710 --> 15:41.510
One over Google.

15:44.950 --> 15:47.910
Contrast that with the Apple situation.

15:47.910 --> 15:49.370
Oh, you would like to be on our device.

15:49.370 --> 15:52.010
30% gross, please.

15:52.530 --> 15:56.390
You know, it's a very, very different model.

15:57.090 --> 16:01.390
And the free internet has disrupted so much.

16:01.530 --> 16:04.370
And there are those who would like to disrupt it back.

16:04.710 --> 16:06.790
So, here's the challenge.

16:06.910 --> 16:10.470
We are the guys who actually know how this damn thing works.

16:10.470 --> 16:14.490
We are the people who know that breaking everything is possible.

16:14.890 --> 16:19.290
We don't know that fixing everything is impossible.

16:19.730 --> 16:25.210
Now, you know, technically it's a bit of a game but technically correct is the best kind of correct.

16:26.090 --> 16:27.990
So why do I do this?

16:27.990 --> 16:29.270
Why am I here?

16:29.270 --> 16:32.950
Because I see openness to the possibilities.

16:33.430 --> 16:39.970
I see that there's sheer joy in this community for understanding how things work.

16:40.090 --> 16:43.430
I see people willing to call bullshit on everything.

16:43.510 --> 16:48.310
Especially the parts of security theory that are just clearly wrong.

16:48.310 --> 16:55.690
Because, what, you think everyone else in engineering can screw up and we in security are infallible?

16:55.690 --> 16:57.330
We screw things up all the time.

16:57.330 --> 16:59.390
We just have way more attitude about it.

17:01.390 --> 17:04.150
So, that's kind of my world.

17:04.150 --> 17:06.030
Whoa, why did everything just go dark?

17:06.650 --> 17:07.690
Get back here.

17:08.290 --> 17:09.130
Come back.

17:09.130 --> 17:10.330
I believe in you.

17:15.670 --> 17:16.890
All right.

17:17.470 --> 17:22.730
So that's the grand world vision kiddies on Roombas.

17:23.250 --> 17:24.670
Let's nerd out a bit.

17:25.090 --> 17:28.410
I want to talk to you guys about random number generators.

17:28.670 --> 17:32.430
Generation of random numbers is indeed too important to be left to chance.

17:42.270 --> 17:45.910
What does it actually mean to need a random number generator?

17:46.070 --> 17:50.550
Many processes require a generator of unpredictable numbers.

17:50.550 --> 17:55.690
That means if you get the last thousand, you can't figure out what the next one is going to be.

17:55.690 --> 17:59.910
You can't go back and figure out what some of the older ones were that you missed.

18:00.010 --> 18:09.430
Now, just because we require a strong random number generator doesn't mean we're actually getting strong random number generators.

18:09.430 --> 18:10.910
Here's a couple of various talks.

18:10.910 --> 18:14.170
How I Met Your Girlfriend by the great Sammy Kamkar.

18:15.670 --> 18:19.310
Many web applications are failing for session management.

18:19.370 --> 18:21.010
Exploit information for Python.

18:21.010 --> 18:23.090
Exploit information for Ruby.

18:23.410 --> 18:26.090
What the hell is going on?

18:26.250 --> 18:32.890
Well, the deal is that all these various web frameworks, you don't actually log into them that frequently.

18:32.890 --> 18:38.090
One of my friends was an admin at a major e-commerce site.

18:38.090 --> 18:39.170
He's like, yeah.

18:39.170 --> 18:39.870
Oh, wait, wait.

18:39.870 --> 18:41.090
We have an interruption.

18:41.090 --> 18:41.910
Excuse me.

18:42.370 --> 18:47.450
So as you all know, we have a tradition here at DEF CON with new speakers.

18:47.790 --> 18:49.670
We have a new speaker with us this year.

18:49.670 --> 18:53.930
His name is Kaminskow?

18:54.710 --> 18:55.450
Kaminskow?

18:55.450 --> 18:57.650
I think that's the right way to pronounce this.

18:57.650 --> 18:59.130
No, I think you messed it up.

18:59.590 --> 19:00.530
Try again.

19:01.110 --> 19:01.990
Kamikow?

19:02.310 --> 19:02.830
Kamikow.

19:02.830 --> 19:03.690
Yeah, it's Kamikow.

19:03.690 --> 19:04.470
Anyway.

19:07.050 --> 19:08.010
Come here.

19:08.550 --> 19:09.530
It's good to be back.

19:09.530 --> 19:11.090
Good to see you.

19:15.830 --> 19:17.390
Magnificent bastards.

19:20.110 --> 19:23.070
New speakers and really fucking old speakers.

19:23.070 --> 19:24.550
Oh, snap.

19:24.770 --> 19:26.470
It overflows back to zero.

19:33.860 --> 19:35.880
Actually, I missed the year or so.

19:37.820 --> 19:39.840
So the deal is this.

19:40.340 --> 19:44.900
You have literally one of the largest e-commerce sites in the world.

19:45.400 --> 19:47.080
We found a phone.

19:47.260 --> 19:49.580
Does anybody have one?

19:50.540 --> 19:57.850
I'd say drink but I just did.

19:59.790 --> 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?

20:07.070 --> 20:10.970
You think it's like tens of thousands or thousands?

20:11.050 --> 20:11.950
Hundreds?

20:12.310 --> 20:15.490
They're like, yeah, seven.

20:15.630 --> 20:19.210
Seven times a second we have to accept a password.

20:19.810 --> 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.

20:29.310 --> 20:33.730
That's the thing that's shoved into the web app every single time you visit.

20:34.390 --> 20:39.310
That value ideally is a random value.

20:39.370 --> 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.

20:47.670 --> 20:50.370
That's actually totally what's happening.

20:51.750 --> 20:56.230
More recently, a few days ago, awesome attack.

20:56.230 --> 20:58.910
One of the ‑‑ so beautiful.

20:58.930 --> 21:07.770
A guy by the name of Dominique Bongard, reversity on Twitter, came up with an attack against a scheme called WPS.

21:07.930 --> 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.

21:17.710 --> 21:23.770
And they made up this incredibly ill‑advised protocol for it.

21:23.770 --> 21:26.130
I mean , just like impressively.

21:26.810 --> 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.

21:41.250 --> 21:43.810
It's randomly generated but it's encrypted.

21:44.550 --> 21:48.570
And, you know, breaking a 128 bit key is not going to happen.

21:48.630 --> 21:50.990
Like, that's a 2 to the 128 work effort.

21:51.050 --> 21:53.270
That's going to take until the end of the universe.

21:53.730 --> 21:59.670
However, it requires you to actually have 128 bits of entropy.

22:00.390 --> 22:02.970
Which none of the devices did.

22:03.410 --> 22:08.110
Device one had what's called an LFSR, a linear feedback shift register.

22:08.110 --> 22:14.690
They keep showing up in this space because they're the quickest and easiest way to get this stream of numbers.

22:14.690 --> 22:19.530
You start with a seed value and it just keeps rolling and rolling and rolling.

22:19.550 --> 22:23.670
Well, the seed value in the first device was 32 bits long.

22:23.670 --> 22:26.210
So you just try all 32 bits combination.

22:26.210 --> 22:29.030
Second one, another 32 bits.

22:29.210 --> 22:32.010
The third one just encrypted with zero.

22:37.010 --> 22:39.050
Beautiful attack.

22:39.890 --> 22:48.210
So let's talk about why really we keep getting owned by random number generators.

22:48.430 --> 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.

23:02.270 --> 23:06.410
And for the love of God, most of it doesn't matter.

23:06.770 --> 23:12.710
No one's getting owned because they use SHA-1 or SHA-256 or hell MD4.

23:12.710 --> 23:17.150
No one's getting owned because they use hash instead of HMAC DBRG.

23:17.150 --> 23:22.090
They're not getting owned because they used the same entropy for too long and didn't mix in new entropy.

23:22.090 --> 23:25.950
We're not getting owned because we had one pool instead of 32 pools.

23:25.950 --> 23:32.870
Like there's a disconnect between what's getting us owned and what we argue about.

23:32.870 --> 23:42.310
The fundamental truth is there's like a thousand different ways to build a cryptographically secure pseudo random number generator.

23:42.310 --> 23:46.990
And they all have an incredibly high security margin.

23:46.990 --> 23:49.490
That is the fundamental truth.

23:49.490 --> 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.

24:01.670 --> 24:07.430
And two, we're not even using cryptographically secure pseudo random number generators.

24:07.430 --> 24:09.250
We're using LFSRs.

24:09.250 --> 24:10.430
We're using crap.

24:10.430 --> 24:13.150
This is what's actually happening.

24:13.670 --> 24:17.570
So let's talk about the no entropy problem.

24:17.570 --> 24:22.630
What does a cryptographically secure pseudo random number generator do?

24:22.630 --> 24:25.710
It takes a little bit of entropy.

24:25.730 --> 24:31.910
128 values that are either 0 or 1 that have no particular pattern.

24:31.910 --> 24:42.250
It takes that little tiny chunk and spreads it out into number after number after number, gigabytes, hundreds of gigabytes, whatever.

24:42.830 --> 24:49.150
Your idea is from an attacker standpoint, you can look at as much of this output as possible.

24:49.150 --> 24:52.850
You learn nothing about the secret.

24:52.850 --> 25:03.250
Your best attack is unfortunately to guess what all 128 bits of that seed are and it's just not feasible.

25:03.250 --> 25:05.570
There's too many.

25:06.550 --> 25:12.290
Now, in order for this to be true, you actually need 128 bits.

25:12.290 --> 25:15.690
What killed WPS is there actually wasn't.

25:15.690 --> 25:21.590
Generally there was 32 bits which is a meaningful, which is a successful amount to break.

25:21.590 --> 25:23.470
One case there was 0.

25:23.530 --> 25:26.730
This isn't an obscure bug.

25:27.050 --> 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.

25:38.350 --> 25:39.830
Now here's what's scary.

25:39.830 --> 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.

25:51.650 --> 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.

26:00.890 --> 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.

26:12.270 --> 26:14.490
That's an incredible failure rate.

26:14.490 --> 26:18.830
Shouldn't DevRandom and DevUrandom have actually prevented this?

26:18.830 --> 26:26.370
Because these keys are actually being generated out of what are supposed to be well engineered kernel systems.

26:26.490 --> 26:32.530
Let's talk about why we actually really do like kernel random number generators.

26:33.390 --> 26:43.370
First off, when you have hardware in your computer, remember your biggest lie of a computer is just one computer.

26:43.570 --> 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.

26:53.470 --> 26:59.390
An interrupt is fired, the CPU jumps to a certain point, you get a time stamp at that.

27:01.330 --> 27:06.570
You now have an interaction of someone else's clock with yours.

27:07.550 --> 27:13.650
You ever wonder what it means to actually collect random information, what it means to collect entropy?

27:13.730 --> 27:15.170
What are you doing?

27:15.990 --> 27:22.410
At the end of the day, what you're doing is you're measuring a slow system with a fast system.

27:22.550 --> 27:26.290
You know, I can snap my fingers and I think I have a rhythm going.

27:26.470 --> 27:29.050
You think I have a rhythm going accurate to the nanosecond?

27:29.050 --> 27:30.910
No, I don't.

27:30.950 --> 27:34.590
Because that's not how accurate human systems are.

27:34.590 --> 27:38.870
We are at best accurate to the hundredth of a second.

27:40.970 --> 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 .

27:58.190 --> 28:00.690
And that's what's happening in this kernel situation .

28:00.690 --> 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.

28:09.230 --> 28:14.190
Another great thing about kernel RNGs is that there's just one kernel, at least ideally.

28:14.190 --> 28:20.490
So you don't have some situation where one process is doing something right and one process is doing something wrong.

28:20.490 --> 28:24.010
Every process benefits from whatever randomness is available.

28:24.010 --> 28:25.270
It's shared.

28:25.910 --> 28:29.390
Finally, this is tricky stuff.

28:29.390 --> 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.

28:40.730 --> 28:42.590
So that was the idea.

28:42.690 --> 28:43.870
What went wrong?

28:44.050 --> 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.

29:02.610 --> 29:05.710
There were no events coming in from the hardware.

29:05.710 --> 29:07.290
It was just sitting there.

29:07.370 --> 29:10.630
And if you've got no events, you've got no entropy to operate on.

29:10.690 --> 29:17.310
Now, it would be nice if CPUs actually had hardware random number generation.

29:17.790 --> 29:25.330
But for whatever reason, that just consistently seems to be outside the purview of our modern CPU manufacturers.

29:25.330 --> 29:27.290
You just can't figure out how to do it.

29:28.770 --> 29:30.830
So how do you solve this problem?

29:30.830 --> 29:31.650
Like, really?

29:32.330 --> 29:35.990
The truth is, you don't have to be perfect.

29:35.990 --> 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.

29:44.690 --> 29:46.530
That really sucks.

29:48.430 --> 29:50.530
You've got to force the synthesis of events.

29:50.530 --> 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.

30:02.730 --> 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.

30:18.730 --> 30:21.610
This actually works.

30:21.830 --> 30:27.770
Now you can also go ahead and do some actions that take a hopefully non-deterministic amount of time.

30:28.010 --> 30:32.370
So reading values out of memory, causing contention for resources.

30:33.670 --> 30:35.530
You want to do what's called whitening.

30:35.710 --> 30:38.170
So that means you take any sequence of bits.

30:38.170 --> 30:40.230
If it's a zero zero, you throw it out.

30:40.230 --> 30:42.430
If it's a one one, you throw it out.

30:42.430 --> 30:44.830
The zero to one transition is considered a zero.

30:44.830 --> 30:47.030
The one to zero transition is considered a one.

30:47.030 --> 30:49.770
This is what's called de-biasing your data.

30:49.950 --> 30:53.910
I released a piece of code called docker RAND about two years ago.

30:54.130 --> 30:58.510
Docker RAND was based on true RAND by Matt Blaze from about ten years ago.

30:58.970 --> 31:02.990
I think actually about 1996.

31:04.910 --> 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.

31:15.610 --> 31:17.610
That wouldn't have happened.

31:18.310 --> 31:24.950
Part of security is accepting maybe there is some weird ass environment where docker RAND fails.

31:24.950 --> 31:27.490
But is it going to fail as much as status quo?

31:27.530 --> 31:28.430
No.

31:28.430 --> 31:29.730
No it's not.

31:30.770 --> 31:36.030
So let's talk about the larger issue.

31:36.710 --> 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.

31:51.750 --> 31:58.990
When you look at the languages that people use to write software, JavaScript has math random, LFSR.

31:58.990 --> 32:01.690
Ruby has Ruby RAND, LFSR.

32:01.690 --> 32:08.310
Java has Java util random, PHP RAND, it's all crap.

32:08.490 --> 32:09.850
Why?

32:09.930 --> 32:12.150
Why are we doing this?

32:13.450 --> 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.

32:25.730 --> 32:28.230
It's not fixing the old broken stuff.

32:28.230 --> 32:30.690
We make some new API.

32:30.810 --> 32:33.690
Then we make it weird.

32:33.910 --> 32:36.630
It's never just like math dot secure random.

32:36.630 --> 32:41.950
It's like bar A equals new UINT array one window crypto get random values.

32:41.950 --> 32:43.070
What?

32:44.070 --> 32:47.210
That wasn't what I was using when it was easy.

32:47.210 --> 32:51.830
Why are you making secure not easy and not default?

32:51.830 --> 32:53.970
Does that work anywhere else?

32:53.970 --> 32:55.230
No.

32:56.670 --> 33:00.650
So why not be secure by default?

33:00.650 --> 33:09.210
Why not instead of requiring some weird ass random API, why not take the broken APIs and make them not broken?

33:09.450 --> 33:12.830
So thus, we've actually been doing that.

33:12.830 --> 33:16.050
Ryan Castellucci works with me over at White Ops.

33:16.650 --> 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.

33:32.890 --> 33:36.290
So we've gotten JavaScript support for node in the browsers.

33:36.290 --> 33:37.490
We've gotten Ruby.

33:37.790 --> 33:41.770
We've actually made C's RAND function actually RAND.

33:42.610 --> 33:45.630
PHP, Python, OpenJDK.

33:45.630 --> 33:48.870
It's not like it's that hard to write this code.

33:48.910 --> 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.

33:58.190 --> 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?

34:05.190 --> 34:06.730
Do we support fixed seeds?

34:06.730 --> 34:08.270
Do we support high speed?

34:08.810 --> 34:15.230
So I'm going to do something now which people tend to call, it's when I play chess against myself.

34:15.230 --> 34:21.470
Let's talk about what's wrong with what we've named lib U Randy besides the name.

34:24.410 --> 34:29.990
Ryan actually named it and I'm like, sorry I can't think of this code as any other name now.

34:30.170 --> 34:36.570
There are two reasons why generally you wouldn't use an approach like this.

34:36.570 --> 34:44.830
The first reason is testers tend to like predictable test results.

34:44.830 --> 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.

34:53.210 --> 34:59.330
So the system will always behave in a predictable way that can be regression tested.

34:59.330 --> 35:03.070
Now I actually never, ever like this approach.

35:03.070 --> 35:04.490
Here's why.

35:05.850 --> 35:09.910
People say it's a two line change.

35:09.910 --> 35:15.030
Why do you need to go ahead and retest everything for a two line change?

35:15.210 --> 35:16.690
And here's the answer.

35:16.690 --> 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.

35:30.130 --> 35:35.610
So that when the memory corruption occurred, nothing bad visibly happened.

35:35.610 --> 35:43.670
And so when the house of cards falls the same way every time, you never discover the bug.

35:43.670 --> 35:47.830
And you only discover it when you do that two line change.

35:47.830 --> 35:53.210
That shouldn't break anything but now the house of cards falls like this and now everything blows up.

35:53.910 --> 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.

36:09.410 --> 36:10.410
It sucks.

36:11.030 --> 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.

36:20.850 --> 36:22.890
Okay, fine, we'll set an environment flag.

36:23.590 --> 36:31.090
More seriously, Urandom is actually kind of slower than LFSRs.

36:31.090 --> 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.

36:43.550 --> 36:49.790
And when you actually look at the ‑‑ so I was interested.

36:50.430 --> 36:53.450
I believe in being historical.

36:53.610 --> 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.

36:59.850 --> 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.

37:09.290 --> 37:13.890
It's like, well, we're not secure but we're not being benchmarked for security.

37:18.850 --> 37:24.930
So even at 4 megabytes a second , it's still like a million random numbers a second.

37:25.710 --> 37:30.230
It's generally fast enough for everything but not always.

37:30.550 --> 37:39.250
So this brings up the question, should we be using a user space scriptographically secure pseudo random number generator?

37:39.250 --> 37:41.170
Now, it doesn't mean that we don't use Urandom.

37:41.170 --> 37:44.470
We still mine it as frequently as we might like.

37:44.470 --> 37:48.250
If it happens to get some new bits of randomness from the kernel, great.

37:48.250 --> 37:49.150
Let's use them.

37:49.150 --> 37:50.470
Let's integrate them in.

37:50.750 --> 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.

37:59.390 --> 38:02.590
So one of the fastest hashes out there is what's called sip hash.

38:02.590 --> 38:04.390
It comes from our buddy DJB.

38:04.810 --> 38:09.690
If you just sip hash seed with an incremented counter, this actually works.

38:09.690 --> 38:14.510
It's 20 times faster than dev Urandom on Linux.

38:14.510 --> 38:19.750
It's competitive with the non-cryptographically secure pseudo random number generators.

38:19.830 --> 38:24.870
I guess what I'm trying to tell you is there's no advantage to sucking.

38:24.870 --> 38:27.630
You can be fast and secure.

38:27.630 --> 38:28.850
It's okay.

38:29.090 --> 38:35.050
Now there is a possible improvement that we could do and that is the integration of time.

38:35.050 --> 38:38.070
Specifically what's called clock monotonic.

38:38.070 --> 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.

38:52.130 --> 38:56.690
And it turns out you just need bits that are different.

38:56.690 --> 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.

39:08.550 --> 39:11.270
Now you have the same entropy happening twice.

39:11.270 --> 39:12.870
And it sucks.

39:12.950 --> 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.

39:25.190 --> 39:28.970
It's not that it can't, it's that it won't.

39:29.470 --> 39:31.450
That's a good thing.

39:31.530 --> 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.

39:43.730 --> 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.

39:53.310 --> 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.

40:02.630 --> 40:04.830
Force there to be some fixed offset.

40:05.290 --> 40:09.030
I'm not doing this yet in Lib U Randy.

40:09.110 --> 40:10.550
And here's why.

40:10.790 --> 40:17.950
Reasonable people can disagree about whether a CSPRNG should be in user space and kernel space.

40:17.990 --> 40:20.790
But we all hate LFSRs.

40:20.790 --> 40:26.050
So let's at least do something which causes those damn things to die.

40:26.590 --> 40:30.290
Another change is maybe we don't use SIP hash.

40:30.290 --> 40:36.790
SIP, it turns out because of quirks, you can do faster with Blake, you can really do faster with Skyn.

40:36.790 --> 40:39.650
So both of them are alternate hashing systems.

40:39.650 --> 40:42.270
We've found things where it's like twice as fast.

40:42.550 --> 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.

40:57.850 --> 40:59.990
The problems we don't have.

41:01.010 --> 41:07.210
So that's kind of the souped nuts on what's going on with entropy generation.

41:07.310 --> 41:11.490
But there's another problem around representation.

41:12.550 --> 41:29.330
Apparently you are supposed to do something with D3B07384D1NGJU42MA1$JH89 and whatever the hell that is, squiggly stuff.

41:29.830 --> 41:32.010
What the hell is that?

41:32.030 --> 41:35.370
Stop puking bits.

41:37.990 --> 41:42.590
We are lying to ourselves if we think users can do anything with that.

41:42.590 --> 41:44.930
They are lost.

41:46.050 --> 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.

41:57.810 --> 41:58.370
Okay?

41:58.370 --> 42:06.810
We have hardware acceleration for human faces and even then we maybe can get about 16 bits.

42:06.810 --> 42:14.270
There may be, if we're absolutely at the edge of our capability, able to differentiate 65,000 people.

42:14.550 --> 42:16.330
It's not that much.

42:16.530 --> 42:21.070
And computers want more, so much more, 24 to 128 bits.

42:21.070 --> 42:22.650
They want recognition.

42:22.790 --> 42:24.650
Have you ever seen this before?

42:24.650 --> 42:26.170
And they want repetition.

42:26.210 --> 42:28.150
Hey, give me that long ass password.

42:28.890 --> 42:30.710
And the standard stuff doesn't work.

42:30.710 --> 42:38.230
We did not evolve to deal with hex or base 64 or base 58 or squiggly SSH art.

42:38.230 --> 42:39.810
It's just not how we're built.

42:40.230 --> 42:42.390
Now, I've looked at this problem before.

42:42.850 --> 42:43.550
I did some work.

42:43.550 --> 42:45.310
I called it crypto mnemonics.

42:45.570 --> 42:51.790
Went ahead and took 512 male names, 1,024 female names, 8,192 last names.

42:51.790 --> 42:54.730
I represented entropy by married couples.

42:54.730 --> 42:58.770
I'm sorry, totally heteronormative but actually really diverse.

42:59.290 --> 43:05.550
You know, Julio and Epifania, Dizuti and Luther, Roland, Dubros and Manuel and Twilight and Bessie.

43:06.710 --> 43:08.930
Definite range of people here.

43:10.410 --> 43:16.870
This actually works as a way to get yourself to be used to some pattern of bits.

43:16.870 --> 43:21.610
You do have to show it every single time you interact with something.

43:21.610 --> 43:25.670
You can't just show the entropy representation when there's a problem.

43:25.670 --> 43:28.310
It's like you only see someone's face when there's a problem.

43:28.310 --> 43:30.030
Otherwise they're in a mask .

43:30.070 --> 43:31.790
No, that doesn't work that way.

43:31.790 --> 43:32.810
It's not how the brain works.

43:32.810 --> 43:36.270
It needs spaced repetition to remember.

43:36.930 --> 43:40.670
Now can we do better?

43:41.110 --> 43:44.770
Humans do have memory capacity.

43:44.770 --> 43:46.470
It's just not for arbitrary bits.

43:46.470 --> 43:48.730
Like Homer's epics are enormous.

43:48.730 --> 43:51.650
There's like kilobytes of entropy in there.

43:51.650 --> 43:55.370
The deal is is that we remember objects.

43:55.370 --> 43:56.630
We remember stories.

43:56.630 --> 44:02.710
We remember narratives far more than we remember arbitrary ones and zeros.

44:02.710 --> 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.

44:13.290 --> 44:17.610
Heck, maybe get like a password and like have it spell check.

44:17.850 --> 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.

44:36.070 --> 44:37.990
I haven't been doing this work alone.

44:37.990 --> 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.

44:47.270 --> 44:50.890
So he's going to come on stage and we're going to talk about how he did this.

44:58.380 --> 45:00.840
So Ryan, pick up a mic.

45:02.600 --> 45:03.720
Hi, guys.

45:04.340 --> 45:05.480
How's it going?

45:07.740 --> 45:11.960
So I just have to say, I have known Ryan for many, many years.

45:11.960 --> 45:14.320
He recently started working with me at White Ops.

45:14.320 --> 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.

45:20.900 --> 45:22.020
So thank you.

45:22.340 --> 45:24.420
So Ryan, tell me what we're looking at here.

45:24.420 --> 45:25.100
Okay.

45:25.100 --> 45:31.860
So we have up on the slide a randomly generated sample.

45:33.160 --> 45:36.280
It's like 5E4D, it's like a bunch of bits?

45:36.280 --> 45:37.200
Right.

45:37.380 --> 45:43.120
There's a couple algorithms that are combined together to generate the encoding we have there.

45:43.120 --> 45:46.480
As you can see, there's four groups of three words.

45:46.480 --> 45:50.260
Each one is an adjective, noun and verb.

45:51.040 --> 45:55.000
It's like macho acid answering, rustic cable fetching and something.

45:55.000 --> 45:55.700
Right.

45:56.080 --> 46:00.380
And we have a known amount of entropy there.

46:00.380 --> 46:05.240
So what we can do, spell check for passwords, well, pass phrases.

46:05.960 --> 46:10.720
So unfortunately we don't have a live demo to you.

46:10.720 --> 46:14.320
I could not get the code to work fast enough for that.

46:15.040 --> 46:17.000
I will fix that soon.

46:17.320 --> 46:18.520
The code will be released.

46:18.520 --> 46:19.700
It is awesome.

46:19.700 --> 46:23.200
But we actually do have sort of a view of what's going on here.

46:23.200 --> 46:27.860
That is, it can fix far worse than that.

46:27.860 --> 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.

46:39.640 --> 46:41.180
And the words are out of order even.

46:41.180 --> 46:41.640
Yes.

46:41.640 --> 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.

46:51.620 --> 46:53.620
And we can fix it so we should.

46:54.120 --> 46:54.780
Interesting.

46:54.780 --> 46:57.800
So you don't have to remember if the acid is macho or rustic.

46:57.800 --> 47:00.560
You just have to know acid, macho, rustic or whatever order.

47:00.560 --> 47:01.380
Exactly.

47:01.380 --> 47:02.140
Okay.

47:02.140 --> 47:04.700
So let's talk about how you actually did this.

47:04.720 --> 47:05.560
Okay.

47:05.560 --> 47:07.120
It's kind of complicated.

47:07.420 --> 47:10.220
I have code implemented in JavaScript and Python.

47:10.400 --> 47:12.180
We will, it's on GitHub.

47:12.180 --> 47:14.740
The repo is currently private.

47:14.740 --> 47:16.780
That will be changed soon.

47:17.540 --> 47:19.900
So we have two major components.

47:19.900 --> 47:24.020
There's a combinatorial number system encoder.

47:24.060 --> 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.

47:36.720 --> 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.

47:48.280 --> 47:52.720
So this is like you have an encoding of possible letters from A to Z.

47:52.720 --> 47:55.240
You could have B, A, D, F, G, C.

47:55.240 --> 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.

48:04.080 --> 48:05.860
And this is fairly efficient.

48:06.480 --> 48:08.480
This is, you can do this fast.

48:08.480 --> 48:11.120
You don't have to walk through all possible combinations.

48:11.920 --> 48:17.500
You can generate a specific numbered combination and that's your encoding.

48:17.800 --> 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.

48:29.340 --> 48:31.000
They can show up in any order, yes.

48:31.540 --> 48:33.840
For decode, we just have to sort them.

48:33.840 --> 48:34.200
All right.

48:34.200 --> 48:37.900
So talking about the decode, you're not having it be raw numbers, you're having it be words.

48:37.900 --> 48:38.400
Right.

48:38.400 --> 48:43.300
So there's another step here which is our word mapper.

48:43.620 --> 48:48.040
Our word mapper has a dictionary file.

48:48.620 --> 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.

48:57.780 --> 49:05.460
And we actually include three values, one with X nouns, one with X verbs, one with X adjectives and interlace them.

49:05.910 --> 49:08.440
But it's a little messy.

49:08.440 --> 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.

49:18.600 --> 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.

49:34.120 --> 49:35.420
We know that.

49:35.420 --> 49:37.100
We canonicalize them.

49:38.120 --> 49:43.810
And in coding we just pick the canonical form which in this case would be forbidding.

49:46.200 --> 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.

49:55.780 --> 49:59.340
We're going to correct for them before we even let them get into the decoder.

49:59.340 --> 50:00.400
Exactly.

50:00.900 --> 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.

50:13.540 --> 50:23.600
And then we have a recursive algorithm that goes through and maximizes the edit distance between words.

50:23.600 --> 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.

50:39.720 --> 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.

50:53.280 --> 50:57.120
Basically computational linguistics as applied to security.

51:01.890 --> 51:07.050
Basically a path out of using lead speak as a security technology.

51:07.590 --> 51:11.610
There's no more of this like, I used an app sign , I'm secure.

51:11.610 --> 51:16.270
We all know exactly how well that works and if you don't, go talk to the core logic guys.

51:16.270 --> 51:18.870
I think they have a contest that might change your mind.

51:20.170 --> 51:20.970
Nice.

51:20.970 --> 51:23.290
So it seems pretty cool.

51:23.290 --> 51:27.390
You think this is going to let us have passwords be generated server side?

51:27.730 --> 51:28.710
That's the idea.

51:28.710 --> 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.

51:41.350 --> 51:43.510
It's always seemed to me like victim shaming.

51:43.510 --> 51:47.510
We make the user generate the password so we can blame them when their password sucks.

51:47.510 --> 51:49.250
Meanwhile we have no clue how to build them one.

51:49.250 --> 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.

51:59.970 --> 52:03.910
We had a flat monkey staring and we had a greenhouse jumping.

52:05.050 --> 52:07.490
There was another tuple which I have now forgotten.

52:07.490 --> 52:11.210
But the point is I looked at these maybe twice ever and I still remember them.

52:11.510 --> 52:17.750
So we were talking last night about what the implications are for allowing more key stretching.

52:17.750 --> 52:22.490
Can you explain what key stretching is and why this makes it a more feasible thing?

52:22.490 --> 52:23.810
This is really cool.

52:23.810 --> 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.

52:39.270 --> 52:44.630
You've probably all heard of B crypt or PBKDF2 or S crypt.

52:44.930 --> 52:46.070
Yes, thank you.

52:47.670 --> 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.

53:01.470 --> 53:07.690
But if we have spell correct, even if you make a few small typos, it works the first time.

53:07.690 --> 53:08.950
It's fantastic.

53:09.270 --> 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.

53:21.490 --> 53:25.150
I had a high security thing I built a while ago.

53:25.150 --> 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.

53:37.970 --> 53:43.890
But if you knew it was going to be right, one minute wouldn't even be that bad for disk encryption.

53:46.670 --> 53:53.990
So we're basically dealing with a common failure mode of what would otherwise be a useful and effective security technology.

53:54.630 --> 53:57.830
The more effective a security technology works, the more we can use it.

53:58.370 --> 53:58.990
Cool.

53:59.270 --> 54:01.030
All right, Ryan, thank you much.

54:01.030 --> 54:02.790
I really appreciate you building this out.

54:08.620 --> 54:14.260
Do we have a drink?

54:14.460 --> 54:15.660
Someone bring a drink.

54:17.980 --> 54:19.080
All right.

54:21.940 --> 54:22.400
I will .

54:24.780 --> 54:32.760
So there's a major use case to be considered with a lot of this stuff.

54:33.260 --> 54:38.120
Speaking of work from a previous talk, a few years ago I did something called Fidelius.

54:38.160 --> 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.

54:49.880 --> 54:54.980
So you can have a passphrase for an SSH key, SSL certificate.

54:56.200 --> 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.

55:04.840 --> 55:09.800
So you hook the two together, you guess what's called a password authenticated key exchange scheme.

55:09.800 --> 55:11.280
It always works.

55:12.260 --> 55:16.940
This was relatively obscure two years ago.

55:17.060 --> 55:21.020
This is becoming straight up mainstream now.

55:21.020 --> 55:26.820
There's a scheme called brain wallet that allows you to have a word or phrase going to a bitcoin address.

55:26.820 --> 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.

55:32.960 --> 55:35.360
Not actually PGP but still .

55:36.040 --> 55:43.660
These systems are incredibly vulnerable to having a low amount of true entropy.

55:43.660 --> 55:47.920
Because by definition you're publishing your public key.

55:47.980 --> 55:51.860
It's almost like it's called a public key.

55:53.620 --> 55:57.980
So this has been a straight up expensive problem in brain wallet.

55:57.980 --> 56:01.740
Tens of thousands of dollars worth of bitcoin have been stolen.

56:01.740 --> 56:07.580
What we need is a way for people to be able to remember more entropy.

56:07.580 --> 56:13.640
The idea is that storing all these bits on a hard drive ends up being a screw up.

56:13.640 --> 56:16.060
People want something they can hold in their head.

56:16.060 --> 56:23.800
If we have these sorts of representation schemes that are self correcting, people can remember more.

56:23.800 --> 56:25.360
Stuff will work better.

56:26.140 --> 56:31.660
So the general idea, brain wallet and mini lock need human memorable entropy.

56:31.660 --> 56:33.820
Actual security needs more entropy.

56:33.820 --> 56:38.220
This story bit system increases memorable entropy.

56:38.300 --> 56:41.700
Now there is some interesting variations on the scheme.

56:41.700 --> 56:47.620
You can go ahead, you can have what we call split mode where you have a normal password you use.

56:47.920 --> 56:49.980
It allows things to work.

56:49.980 --> 56:53.260
It will take like two hours to crack a key.

56:53.500 --> 56:59.600
And then you have like a secondary password that's really there to allow for key exchange.

56:59.600 --> 57:02.300
So moving a key from one location to another.

57:02.480 --> 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.

57:10.860 --> 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.

57:22.240 --> 57:26.900
Because he has to run an attempt only one every few hours, a couple of attempts a day .

57:26.900 --> 57:29.720
He can wait until the end of time and he's not going to get your money.

57:31.120 --> 57:33.340
Two more tricks that we can do.

57:33.340 --> 57:37.720
These aren't necessarily good ideas but we're hackers.

57:37.820 --> 57:42.220
Good ideas are not exactly required here.

57:43.560 --> 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.

57:56.300 --> 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.

58:13.780 --> 58:15.540
Here's the PGP key ID.

58:15.540 --> 58:17.160
Here's the RSA ID.

58:17.160 --> 58:19.440
Here's some smaller amount of bits.

58:19.540 --> 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.

58:26.960 --> 58:30.100
I just need to match this 24 bits.

58:30.100 --> 58:33.700
It will take me a little bit of math but it won't be that bad.

58:34.200 --> 58:37.240
So here's the scheme that you can do.

58:37.360 --> 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.

58:49.220 --> 58:55.140
So you take the full hash, you hash it with the passphrase, you truncate the results.

58:55.160 --> 59:03.440
So the attacker still has to match all 128 bits, doesn't know the passphrase.

59:03.440 --> 59:08.980
Doesn't know what the 24 bits are that he actually does need to collide with.

59:08.980 --> 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.

59:18.120 --> 59:21.780
You want things to be easier for the good guy.

59:22.200 --> 59:23.380
He has a cost.

59:23.380 --> 59:26.100
Your legitimate user has to remember something.

59:26.260 --> 59:35.760
But the idea is ten people who are trying to remember the same key each have their own personal recognition appearance.

59:35.760 --> 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.

59:42.320 --> 59:44.720
But ten people are seeing ten different faces.

59:44.720 --> 59:45.620
It doesn't matter.

59:45.620 --> 59:48.540
They just need to see the same face for themselves.

59:48.540 --> 59:49.780
Does that make sense?

59:50.520 --> 59:55.160
There's a way of doing this in the opposite direction called local stretching .

59:55.740 --> 01:00:01.820
There is a problem where you have some password server.

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.

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.

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.

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.

01:00:58.820 --> 01:01:01.680
Oh, it has to have symbols.

01:01:01.680 --> 01:01:03.300
It must not have symbols.

01:01:03.300 --> 01:01:06.220
It has to have three numbers, two numbers, eight numbers.

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.

01:01:14.500 --> 01:01:16.660
You kind of just made things worse.

01:01:19.760 --> 01:01:23.120
What you can do is a kind of a cute trick.

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.

01:01:28.920 --> 01:01:32.700
So the user says ABC123 with a symbol.

01:01:32.740 --> 01:01:36.500
And that can be interpreted as requires three numbers and a symbol.

01:01:36.500 --> 01:01:40.320
And then that is what is actually stretched or expanded out.

01:01:40.320 --> 01:01:45.720
So it's inferred discovery of password policies.

01:01:45.720 --> 01:01:47.000
Kind of a neat trick.

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.

01:01:56.080 --> 01:01:59.520
And we've also talked about how we represent arbitrary data.

01:01:59.700 --> 01:02:01.780
Now let's talk about some ODA, okay?

01:02:02.980 --> 01:02:05.160
The other shoe has kind of dropped.

01:02:05.220 --> 01:02:08.820
IE had more attacks in 2013 than Java.

01:02:08.820 --> 01:02:11.300
And you know how much we love making fun of Java.

01:02:12.200 --> 01:02:14.120
How is this possible?

01:02:14.180 --> 01:02:19.180
IE at Microsoft has been working to secure IE for a decade.

01:02:19.180 --> 01:02:23.880
How is it that things have fallen so far?

01:02:25.960 --> 01:02:28.580
So, excuse me one sec.

01:02:28.580 --> 01:02:30.140
Got some water in me.

01:02:35.120 --> 01:02:36.920
Here's the deal, guys.

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.

01:02:46.480 --> 01:02:48.060
Like, they can't be separated.

01:02:48.060 --> 01:02:48.980
Are you crazy?

01:02:50.040 --> 01:02:53.260
Everyone thought that they were lying, they were full of it.

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?

01:03:00.240 --> 01:03:02.500
It really is Windows.

01:03:03.040 --> 01:03:07.680
You have this object model that was built back in the 90s called Calm.

01:03:07.700 --> 01:03:09.960
And they're like, hell, let's go put that on the Internet.

01:03:10.540 --> 01:03:13.260
It's like if you put mem copy on the Internet, okay?

01:03:13.260 --> 01:03:15.080
Like, hey, you know, we've got this API here.

01:03:15.080 --> 01:03:17.880
It takes bytes from somewhere and puts it somewhere else.

01:03:20.260 --> 01:03:22.720
What, you want it secure now?

01:03:22.720 --> 01:03:24.780
We barely have this working.

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.

01:03:38.000 --> 01:03:42.060
Like, for example, XP Calm from Firefox.

01:03:42.360 --> 01:03:43.700
It's not exactly subtle.

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.

01:03:51.180 --> 01:03:53.440
This is how it would have to work.

01:03:54.400 --> 01:03:57.880
Yes, attackers loved attacking plug-ins.

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.

01:04:06.860 --> 01:04:08.860
You didn't have to customize it at all.

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.

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.

01:04:24.520 --> 01:04:30.640
It's Firefoxoday, as the gruk might sing.

01:04:32.200 --> 01:04:37.840
Vulnerabilities in the raw browsers have taken over vulnerabilities in their plug-ins.

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.

01:04:49.960 --> 01:04:57.860
Browsers, in their normal operation, are constantly allocating memory and associating a type with it.

01:04:58.060 --> 01:05:00.440
This pointer is to a table.

01:05:00.440 --> 01:05:02.520
This pointer is to an image.

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?

01:05:08.220 --> 01:05:09.980
You've got to reuse that memory.

01:05:10.220 --> 01:05:15.120
So what happens is, a pointer starts out and it's pointing to a table.

01:05:15.520 --> 01:05:19.820
And eventually , the system says, user's moved on to a new web page .

01:05:19.820 --> 01:05:22.480
I don't need that table anymore.

01:05:22.720 --> 01:05:24.300
And so that pointer is free .

01:05:24.860 --> 01:05:28.100
And then later, it says, ah, I've got space.

01:05:28.100 --> 01:05:29.020
Let's go make an image.

01:05:29.020 --> 01:05:30.220
Let's put an image there.

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.

01:05:38.560 --> 01:05:40.880
This table has an image inside of it.

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.

01:05:44.720 --> 01:05:50.180
There's a billion ways for objects in HTML and JavaScript to point to another.

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.

01:06:05.140 --> 01:06:07.500
And that also works about as well as you'd hope.

01:06:08.180 --> 01:06:12.580
So use after free, that's when you have two different contexts in one.

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.

01:06:20.740 --> 01:06:24.080
And it's a real problem and it's not going away.

01:06:25.120 --> 01:06:27.180
Except that it kind of is.

01:06:27.380 --> 01:06:33.480
Google and Microsoft are actually doing some pretty serious things to deal with use after free.

01:06:33.560 --> 01:06:36.540
The Google solution is a typed heap.

01:06:36.540 --> 01:06:40.880
So what they're saying is, we're going to keep all the tables together.

01:06:40.880 --> 01:06:43.460
We're going to keep all the images together.

01:06:43.460 --> 01:06:48.920
So when you go back and make a second allocation, everything is with its peers.

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.

01:06:54.240 --> 01:06:56.080
You use a method of a table on an image.

01:06:56.080 --> 01:06:58.960
Because everything is sticking together .

01:06:59.060 --> 01:07:05.480
And this actually makes it incredibly harder to go ahead and exploit vulnerabilities.

01:07:06.660 --> 01:07:09.220
Microsoft as well is doing stuff.

01:07:09.220 --> 01:07:11.220
They're doing a lot of things.

01:07:11.220 --> 01:07:17.660
But the fundamental advantage of their approach is what's called non-deterministic fuzzing or freeing.

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.

01:07:25.340 --> 01:07:29.860
It might work, it could work, but they don't know it will.

01:07:30.180 --> 01:07:31.660
This is great.

01:07:31.660 --> 01:07:35.540
This is attacking the unique needs of an exploit.

01:07:35.540 --> 01:07:37.700
This is counter exploitation.

01:07:37.700 --> 01:07:45.640
Sure, you have probabilistic likelihood, but your requirement, your need is guaranteed reliability.

01:07:46.380 --> 01:07:48.900
So Microsoft is playing that game.

01:07:49.520 --> 01:07:51.080
I got a trick.

01:07:51.800 --> 01:07:53.640
A trick called Iron Heap.

01:07:53.640 --> 01:07:56.420
Named by the inestimable Rob Graham.

01:07:56.420 --> 01:07:58.220
And the idea is really simple.

01:07:58.220 --> 01:08:03.120
You can't use after free if you just don't have free memory.

01:08:04.960 --> 01:08:06.100
Nope.

01:08:06.540 --> 01:08:08.000
That's not going to do it.

01:08:09.020 --> 01:08:12.280
There's a little bit of a problem with this, you might know.

01:08:13.100 --> 01:08:16.140
We don't actually have an infinite amount of physical memory.

01:08:16.140 --> 01:08:22.900
But you know , on 64 bit machines we have an awfully large amount of virtual memory.

01:08:23.560 --> 01:08:28.240
So the basic idea is we never reuse an allocation.

01:08:28.280 --> 01:08:33.600
Your virtual memory space is 64 bits long and is basically mapped.

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.

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.

01:08:54.200 --> 01:08:56.780
Because you just have so much room.

01:08:56.780 --> 01:09:01.420
Look, we've only had 64 bit browsers really for a very short amount of time.

01:09:01.420 --> 01:09:05.640
This is the best possible use of 64 bit space.

01:09:05.660 --> 01:09:12.540
So the idea is that 0x1234123412341234, once it's freed, that's it.

01:09:12.540 --> 01:09:18.220
It never points again to an image or a CSS script or a JavaScript.

01:09:18.240 --> 01:09:21.980
That page stays unmapped forever.

01:09:22.400 --> 01:09:24.420
Exploit that.

01:09:25.680 --> 01:09:28.980
So we've got to do some stuff to make this efficient.

01:09:30.120 --> 01:09:34.560
You can only have a finite number of active allocations.

01:09:34.560 --> 01:09:39.840
The reason this can work at all is because there's actually hardware acceleration.

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.

01:09:56.100 --> 01:09:59.820
Make it really quick for me to find out there is no page.

01:10:00.080 --> 01:10:03.440
You can't have an infinite amount of these mappings.

01:10:03.440 --> 01:10:07.100
But you don't need an infinite amount of these mappings.

01:10:07.180 --> 01:10:10.300
You need to have like the top 10,000.

01:10:10.300 --> 01:10:12.500
The top 15,000.

01:10:12.660 --> 01:10:15.860
Anything else can swap.

01:10:16.200 --> 01:10:17.140
Guess what?

01:10:17.440 --> 01:10:19.100
Machines swap.

01:10:19.840 --> 01:10:23.140
Maybe to disk, maybe to more RAM.

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.

01:10:28.900 --> 01:10:32.660
The other trick you can of course do is what's called having guard pages.

01:10:32.740 --> 01:10:37.100
So that means you have unallocated space between allocations.

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.

01:10:44.000 --> 01:10:45.420
And that sort of sucks.

01:10:45.420 --> 01:10:48.540
But again, you can do this probabilistically.

01:10:48.540 --> 01:10:51.520
You don't always have to go ahead and make an exploit work.

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.

01:10:57.280 --> 01:10:58.860
That is cheating.

01:10:59.120 --> 01:10:59.940
Good.

01:10:59.940 --> 01:11:00.960
We get to cheat.

01:11:00.960 --> 01:11:01.920
We're defenders.

01:11:03.240 --> 01:11:07.080
Implementation wise, this can be done entirely in user space.

01:11:07.240 --> 01:11:10.780
So, you know, you manage memory in user space.

01:11:10.780 --> 01:11:13.360
You handle the exception when it's unmapped.

01:11:13.360 --> 01:11:15.320
You populate it in the exception.

01:11:16.020 --> 01:11:19.620
It can be run in the kernel because kernels are already managing page tables.

01:11:19.760 --> 01:11:21.520
I don't object to doing this in the kernel.

01:11:21.520 --> 01:11:22.960
I don't object to kernel modules.

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.

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.

01:11:37.640 --> 01:11:39.960
We can be more efficient than that.

01:11:41.700 --> 01:11:43.260
Downsides of Iron Heap.

01:11:43.260 --> 01:11:45.040
One, there's no code yet.

01:11:45.040 --> 01:11:46.480
Just some proof of concepts.

01:11:46.760 --> 01:11:50.640
And two, it really does lean on 64 bit.

01:11:50.780 --> 01:11:56.460
And browsers, particularly Flash, aren't entirely fantastic at 64 bit yet.

01:11:56.460 --> 01:11:58.720
This is true and it matters.

01:11:58.720 --> 01:12:00.660
People like their freaking Flash.

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.

01:12:11.580 --> 01:12:13.460
A piece of code called Die Hard.

01:12:13.600 --> 01:12:17.080
It's an interesting secure allocator from Emery Berger over at UMass.

01:12:17.680 --> 01:12:21.840
It was an advanced ASLR implementation without a band heat metadata.

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.

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.

01:12:32.240 --> 01:12:36.520
Suppresses use after free in a way very similar to the Microsoft allocators.

01:12:36.640 --> 01:12:40.960
So, you don't know when the memory is actually free.

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.

01:12:48.300 --> 01:12:50.740
Like, it's not so good.

01:12:53.280 --> 01:12:58.240
The big thing about Die Hard is that they're available today.

01:12:58.240 --> 01:13:01.540
There's code for Windows, there's code for Mac, there's code for Linux.

01:13:02.880 --> 01:13:05.260
Probably worth exploring for tails.

01:13:05.740 --> 01:13:09.120
There's something different about this stuff.

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.

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.

01:13:32.180 --> 01:13:36.220
What the end game is that leads to arbitrary code execution.

01:13:36.220 --> 01:13:39.660
Yes, you've corrupted but you don't have a path.

01:13:39.660 --> 01:13:47.060
And this class of defense is different because you're actually preventing the initial corrupting moment.

01:13:47.060 --> 01:13:54.000
If you don't have the free complete, the use after free can never start.

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.

01:14:01.340 --> 01:14:05.700
You cannot imagine how many undiscovered bones are in this space.

01:14:05.820 --> 01:14:08.760
I still remember the first time I wrote a fuzzer that found these stuff.

01:14:10.660 --> 01:14:13.880
Come to work every morning, it's like, ooh, look at all these, like dozens.

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.

01:14:23.260 --> 01:14:26.000
It's like, dude, I found four O days at lunch.

01:14:27.280 --> 01:14:31.160
Like really, you get the pattern down in quantity.

01:14:32.000 --> 01:14:34.140
So here's the plan, okay?

01:14:35.160 --> 01:14:38.020
IE has got a story around use after free.

01:14:38.660 --> 01:14:41.420
Chrome has got a story around use after free.

01:14:43.080 --> 01:14:45.160
Firefox has got some O day.

01:14:45.420 --> 01:14:47.560
Firefox needs a story around memory hardening.

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.

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.

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.

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.

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.

01:15:23.700 --> 01:15:26.220
Emery Berger, creator of DieHard.

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.

01:15:30.180 --> 01:15:31.460
So that's what we're up to.

01:15:39.510 --> 01:15:40.010
Dr.

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.

01:15:47.870 --> 01:15:49.370
I'm like, dude, you want to join us?

01:15:49.370 --> 01:15:50.530
He's like, hell yeah.

01:15:52.970 --> 01:15:55.830
So that's what we're going to do about browsers.

01:15:56.850 --> 01:15:58.730
Now we've got to talk about DDoS.

01:15:58.970 --> 01:16:00.370
We're almost there.

01:16:00.370 --> 01:16:01.690
A little bit left.

01:16:02.330 --> 01:16:03.670
Everyone having fun here?

01:16:03.670 --> 01:16:05.690
I know I'm nerding out like crazy.

01:16:11.220 --> 01:16:12.680
All right.

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.

01:16:20.460 --> 01:16:22.880
Series of tubes getting clogged here.

01:16:23.520 --> 01:16:28.280
We had all of 100 gigabit flood in 2013.

01:16:28.600 --> 01:16:33.340
We've had like 114 in 2014, okay?

01:16:33.340 --> 01:16:36.760
Like the bad guys are making a mess of things.

01:16:38.040 --> 01:16:43.380
I had assumed that DDoS had just turned into botnets.

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.

01:16:52.160 --> 01:17:00.660
It turns out the biggest and ugliest of the DDoS's are actually something else.

01:17:00.780 --> 01:17:05.660
They're not using desktop machines, they're using DNS servers.

01:17:05.660 --> 01:17:07.720
That's my protocol, dammit.

01:17:08.060 --> 01:17:10.480
Using NTP servers.

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.

01:17:23.360 --> 01:17:29.980
And I want to take a minute to explain why this variation is quite so damaging.

01:17:30.400 --> 01:17:31.920
So here's the deal.

01:17:32.320 --> 01:17:35.740
I am a terrible artist.

01:17:36.080 --> 01:17:39.860
But I've tried to draw the internet.

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.

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.

01:18:00.600 --> 01:18:01.660
Does that make sense?

01:18:01.660 --> 01:18:06.480
Depending on where you go, you have a fan out and then a fan in.

01:18:07.180 --> 01:18:14.600
Now if you're flooding a single destination, all your traffic takes pretty much one route.

01:18:14.640 --> 01:18:19.200
It goes down, down, up, up, down.

01:18:19.200 --> 01:18:23.940
And that's the one route 99.9% of your traffic is going to take.

01:18:23.940 --> 01:18:30.680
So the most bandwidth you can consume is the least bandwidth of any of these hops.

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.

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.

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.

01:18:58.740 --> 01:18:59.660
Boom.

01:18:59.660 --> 01:19:01.380
This is what's going on.

01:19:01.820 --> 01:19:04.480
And it's ugly and it's not going away.

01:19:04.900 --> 01:19:05.980
So what are we going to do?

01:19:05.980 --> 01:19:08.340
Are we going to lose our toy?

01:19:08.920 --> 01:19:10.220
I don't want to lose my toy.

01:19:10.220 --> 01:19:11.200
I like my toy.

01:19:11.200 --> 01:19:13.260
I like my kitties on Roombas, damn it.

01:19:14.220 --> 01:19:15.800
So what are we going to do?

01:19:16.800 --> 01:19:20.760
Ideally there's this thing called BCP38.

01:19:21.100 --> 01:19:23.920
Ideally there's a technology called URPF.

01:19:24.080 --> 01:19:27.360
Ideally networks couldn't lie.

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.

01:19:36.240 --> 01:19:37.220
Yeah.

01:19:39.820 --> 01:19:43.360
I'm not saying that this is a bad idea.

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.

01:19:52.540 --> 01:19:57.780
The technology, I'm not saying it doesn't scale, but it totally doesn't scale.

01:19:57.860 --> 01:20:01.660
Effectively the technology works by dropping traffic.

01:20:01.660 --> 01:20:03.800
You know what ISPs don't like doing?

01:20:04.020 --> 01:20:05.700
Dropping traffic.

01:20:05.940 --> 01:20:07.180
It fails once in the field.

01:20:07.180 --> 01:20:09.380
They're like, I'm never turning this back on again.

01:20:09.880 --> 01:20:14.300
I'm not saying we shouldn't continue to strive for BCP38 compliance.

01:20:14.300 --> 01:20:16.000
Some crazy paper came out a while ago.

01:20:16.000 --> 01:20:19.740
They found at least 2,300 networks that don't have it.

01:20:20.100 --> 01:20:25.740
You only get the real advantage of BCP38 when it's almost entirely universal.

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.

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.

01:20:43.720 --> 01:20:47.780
At least not if we can't bust them a hell of a lot quicker.

01:20:48.020 --> 01:20:50.680
So, I'm going to bust them.

01:20:50.680 --> 01:20:51.680
Here's what we're going to do.

01:20:51.680 --> 01:20:57.100
We're going to bring back an old idea called stochastic tracing.

01:20:57.560 --> 01:20:59.660
I did not come up with this idea.

01:20:59.660 --> 01:21:01.200
Maybe I've refined it a bit.

01:21:01.240 --> 01:21:04.240
First heard this idea about 12 or 13 years ago.

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.

01:21:15.920 --> 01:21:19.540
Doesn't do anything for your standard normal flows.

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.

01:21:28.100 --> 01:21:33.740
And these things actually incrementally improve the internet over time.

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.

01:21:44.720 --> 01:21:50.240
As it happens, routers have most of the technology necessary to already do this.

01:21:50.240 --> 01:21:54.430
It's very simple to configure a router to do what's called a GRE stream.

01:21:54.430 --> 01:21:57.590
To say, please send me one out of every million packets.

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.

01:22:03.370 --> 01:22:08.310
We can go to a daemon, the daemon can go ahead and send this trace packet.

01:22:08.310 --> 01:22:10.250
What does it actually mean to send a trace?

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.

01:22:16.670 --> 01:22:18.590
I don't even want them knowing my DDoFs.

01:22:18.750 --> 01:22:25.210
So the idea is the traces go to the destination of the flows.

01:22:25.270 --> 01:22:26.970
And maybe the source.

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.

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.

01:22:44.590 --> 01:22:46.170
What does the payload actually look like?

01:22:46.170 --> 01:22:47.310
That's a good question.

01:22:47.310 --> 01:22:49.030
Do we encapsulate this in ICMP?

01:22:49.030 --> 01:22:50.670
Do we make an HTTP post?

01:22:50.670 --> 01:22:51.650
I don't know.

01:22:51.650 --> 01:22:55.870
All I know is if you're on the internet, you're already receiving crap.

01:22:55.870 --> 01:22:58.490
I know this because I'm sending you crap.

01:23:00.190 --> 01:23:03.310
And you haven't crashed yet, I think.

01:23:04.910 --> 01:23:07.270
There's an alternate option.

01:23:07.350 --> 01:23:10.050
This of course comes back to my own history in DNS.

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.

01:23:20.210 --> 01:23:22.530
That might actually be hard.

01:23:22.830 --> 01:23:25.670
There's a space called reverse DNS.

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.

01:23:36.950 --> 01:23:42.690
You can actually host more than just PTR records inside of reverse DNS.

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.

01:23:51.470 --> 01:23:54.150
Here's the server that accepts those trace packets.

01:23:54.150 --> 01:23:57.310
And it's still trust associated with the IP.

01:23:57.310 --> 01:23:58.390
It's very nice.

01:23:59.450 --> 01:24:01.870
Obviously we want to assign trace payloads.

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.

01:24:08.030 --> 01:24:09.230
Go harass Verizon.

01:24:09.750 --> 01:24:13.730
So we've got to prevent that and we can do that with ED25519 keys.

01:24:13.730 --> 01:24:15.430
So that can work.

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.

01:24:24.210 --> 01:24:26.930
We've got to make this stuff happen faster.

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.

01:24:32.650 --> 01:24:37.330
Where there can be firewall rules that are automatically applied.

01:24:37.330 --> 01:24:39.010
Now this is rough.

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.

01:24:44.410 --> 01:24:46.950
So I don't know exactly how this works.

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.

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.

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.

01:25:11.170 --> 01:25:12.950
We don't participate in this anymore.

01:25:13.070 --> 01:25:14.190
Call RRD.

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.

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.

01:25:32.490 --> 01:25:34.410
I don't know why I said I wanted a two-hour talk.

01:25:34.410 --> 01:25:35.950
Am I trying to kill myself here?

01:25:36.810 --> 01:25:37.830
All right.

01:25:38.910 --> 01:25:42.350
Can't just not talk about this whole NSA thing.

01:25:42.670 --> 01:25:44.570
Can't just leave it to Bruce Schneier.

01:25:46.170 --> 01:25:47.830
I love Bruce.

01:25:49.990 --> 01:25:51.110
I'm worried.

01:25:51.270 --> 01:25:57.070
I'm worried about the long-term reaction to the NSA revelations.

01:25:57.090 --> 01:26:02.650
See, there are two ways that you can win in technology.

01:26:02.890 --> 01:26:07.750
You can have the better technology or you can have FUD.

01:26:07.790 --> 01:26:10.150
Oh sure, you can go with that competitor.

01:26:10.150 --> 01:26:15.350
They're cheaper, faster, nicer, more powerful, but ooga booga nation state.

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 .

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.

01:26:35.070 --> 01:26:36.250
Thank you very much.

01:26:38.010 --> 01:26:42.470
The Internet, again, was not the first time we tried to make the Internet.

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.

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.

01:26:58.650 --> 01:27:02.550
And a lot of these political actors have a different goal in mind.

01:27:02.730 --> 01:27:09.590
You know, we didn't want the Chinese Internet or the Iranian Internet before Snowden.

01:27:09.690 --> 01:27:11.950
I hope we don't want that now.

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.

01:27:27.990 --> 01:27:29.470
You maniacs!

01:27:29.470 --> 01:27:30.810
You finally did it!

01:27:30.810 --> 01:27:32.630
You blew it all up!

01:27:32.630 --> 01:27:34.470
Damn you to hell!

01:27:45.770 --> 01:27:50.070
Let me tell you the honest truth about cryptography.

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.

01:28:05.210 --> 01:28:11.210
There's a reason we were asking the NSA's advice for cryptographic vulnerabilities.

01:28:11.210 --> 01:28:11.810
Okay?

01:28:11.810 --> 01:28:17.290
Most crypto functions do not need the NSA's help to suck.

01:28:17.290 --> 01:28:19.470
They get that for free.

01:28:21.370 --> 01:28:22.730
Okay?

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.

01:28:31.830 --> 01:28:38.990
And the NSA has actually been pretty good at saying, something's wrong here.

01:28:38.990 --> 01:28:41.330
This thing in Ness, it's not good.

01:28:41.330 --> 01:28:44.030
This thing in Shaw Zero, it's not good.

01:28:44.030 --> 01:28:45.010
Excuse me, I'm out.

01:28:46.450 --> 01:28:47.090
You

01:28:52.580 --> 01:28:58.380
know, it sucks.

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?

01:29:06.780 --> 01:29:10.460
Like a department of defense?

01:29:10.840 --> 01:29:16.600
They could have like a conference, like a DEF CON.

01:29:20.230 --> 01:29:27.090
What's happening is that even good advice is being treated with deep suspicion.

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.

01:29:36.250 --> 01:29:39.790
And, you know, this is not a controversial opinion.

01:29:39.870 --> 01:29:46.630
Zuko of Tahoe LFS is like, hey, Kessack is too slow in performance patterns.

01:29:46.930 --> 01:29:49.630
The community is like, NIST , NIST is evil.

01:29:49.630 --> 01:29:50.770
NIST is doing more evil.

01:29:50.770 --> 01:29:53.730
They got NSA pulling their strings .

01:29:54.290 --> 01:29:56.230
And what's the end result?

01:29:56.790 --> 01:30:01.070
We are totally replacing NIST with DJB.

01:30:01.210 --> 01:30:03.490
With some guy.

01:30:04.490 --> 01:30:10.010
Now, I want to be clear, I'm an enormous DJB fan.

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 .

01:30:18.090 --> 01:30:24.770
But fewer trusted resources in a time of great need , not actually helpful.

01:30:24.770 --> 01:30:29.270
There's that great quote, Linux scales, Linux does not scale.

01:30:30.970 --> 01:30:33.130
I have a graph.

01:30:33.770 --> 01:30:38.070
And this graph explains the problem very clearly.

01:30:42.640 --> 01:30:46.180
The NSA has two missions.

01:30:46.380 --> 01:30:50.020
DJB pretty sure only has one.

01:30:51.220 --> 01:30:53.280
This is what's going on here, okay?

01:30:53.280 --> 01:31:00.120
Like sometimes one of these guys finds a bug and says, cool.

01:31:00.700 --> 01:31:02.920
And it's not DJB.

01:31:05.180 --> 01:31:08.040
So we're all kind of waiting for the other shoe to drop.

01:31:09.480 --> 01:31:10.940
Not implementers.

01:31:10.940 --> 01:31:15.940
If you've noticed, pretty much everything new that comes out just uses DJB sec.

01:31:15.940 --> 01:31:18.020
Like his stuff is one.

01:31:18.060 --> 01:31:23.320
Everything new is, you know, 25519 or, you know, bad ass or libsodium.

01:31:23.320 --> 01:31:26.880
His stuff has won the day with implementers.

01:31:29.080 --> 01:31:31.580
There's what's called epistemology.

01:31:31.580 --> 01:31:34.200
There's how do you know what you know.

01:31:34.500 --> 01:31:38.240
Academics aren't really allowed to know things without some degree of evidence.

01:31:38.240 --> 01:31:42.540
This is kind of a barrier to a lot of FUD and BS.

01:31:42.620 --> 01:31:44.500
This is kind of the heart of science .

01:31:45.180 --> 01:31:48.200
We do know that dual ECDPRG is bad.

01:31:48.200 --> 01:31:50.920
We have hard evidence, we have math and so on.

01:31:51.380 --> 01:31:53.300
But there's another shoe.

01:31:53.300 --> 01:31:56.120
And that shoe is what's called the NIST P curves.

01:31:56.360 --> 01:31:59.740
There's this great technology, it's called elliptical curves.

01:31:59.740 --> 01:32:01.980
Elliptical curves requires parameters.

01:32:02.340 --> 01:32:06.580
There are two major sets of parameters that came out of NIST.

01:32:06.640 --> 01:32:09.060
The P curves and the K curves.

01:32:09.100 --> 01:32:12.560
We know exactly how the K curves were constructed.

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.

01:32:20.980 --> 01:32:23.680
And now you have your parameters and everything is good.

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.

01:32:36.440 --> 01:32:38.380
Every shirt has two sleeves.

01:32:41.140 --> 01:32:45.360
I'm not saying we know that the P curves are compromised.

01:32:45.540 --> 01:32:50.880
However, if you don't plan on the P curves being compromised, you're an idiot.

01:32:51.600 --> 01:32:53.080
And you should get fired.

01:32:53.360 --> 01:32:58.700
And in fact, that's pretty much what all implementers have realized.

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.

01:33:09.040 --> 01:33:12.920
So this is something that everyone is sort of waiting for.

01:33:12.920 --> 01:33:15.760
It's not like we know it.

01:33:15.780 --> 01:33:17.080
But we know it.

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?

01:33:25.400 --> 01:33:28.920
The hard problems in crypto actually aren't the math.

01:33:28.960 --> 01:33:33.460
They're actually not even the implementations, although GPGG are gone inside.

01:33:34.500 --> 01:33:40.360
Key management is the hard part because this is what actually touches users and organizations.

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?

01:33:47.560 --> 01:33:51.500
Every project in the real world, who here works in IT?

01:33:52.980 --> 01:33:53.820
Okay?

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.

01:34:05.710 --> 01:34:07.350
That is the metric.

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?

01:34:17.210 --> 01:34:19.710
When's the last time you saw crypto work in the field?

01:34:20.370 --> 01:34:22.290
Not an unrelated thing.

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.

01:34:30.590 --> 01:34:34.790
Over at Black Hat, one of the most significant announcements in some time happened.

01:34:34.910 --> 01:34:40.450
Somehow Alex Stamos, one of the founders of ISAC, got root at Yahoo.

01:34:40.930 --> 01:34:44.410
I don't know how he did it but he's like, you know what?

01:34:44.410 --> 01:34:48.910
We're going to do end to end PGP for Yahoo freaking mail.

01:34:49.950 --> 01:34:51.150
Sweet!

01:34:55.520 --> 01:34:56.700
Because you know what?

01:34:56.700 --> 01:35:02.320
Google might understand user experience but Yahoo really, really understands it.

01:35:03.480 --> 01:35:06.900
So, summary of what we've talked about today.

01:35:06.900 --> 01:35:08.320
We're almost done here.

01:35:08.600 --> 01:35:11.140
Don't let an attacker touch your storage.

01:35:11.140 --> 01:35:14.840
Let it store, let it execute, don't let it do both.

01:35:15.320 --> 01:35:17.520
Actively gather true entropy.

01:35:17.560 --> 01:35:21.020
Death to non cryptographically secure PRNGs.

01:35:21.480 --> 01:35:26.160
Please, for the love of God, represent entropy in a way other than bit vomit.

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.

01:35:34.020 --> 01:35:37.080
The NSA crypto fallout continues.

01:35:37.080 --> 01:35:38.680
It hasn't gone away.

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.

01:35:45.220 --> 01:35:46.940
He's a professor at UIUC.

01:35:47.800 --> 01:35:49.900
Yahoo's PGP news is fantastic.

01:35:49.900 --> 01:35:52.660
One of the most significant things of the year.

01:35:52.760 --> 01:35:54.220
Maybe of a couple years.

01:35:54.220 --> 01:35:58.860
And, just because I can, just one more thing.

01:35:59.940 --> 01:36:02.140
I totally get to pull this.

01:36:03.820 --> 01:36:05.640
It's Apple related.

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.

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.

01:36:28.200 --> 01:36:29.120
Yes.

01:36:29.120 --> 01:36:29.900
Okay?

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.

01:36:41.980 --> 01:36:42.900
No.

01:36:42.900 --> 01:36:44.660
That is not what I want to do.

01:36:44.660 --> 01:36:46.260
Fuck those guys.

01:36:46.720 --> 01:36:48.940
Apple wants help, let's give it to them.

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.

01:36:58.630 --> 01:37:00.570
Screw that, I got a company .

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.

01:37:05.410 --> 01:37:09.630
I want to see this dead off the mobile internet, okay?

01:37:09.630 --> 01:37:12.330
I've become a believer in bug bounties.

01:37:12.330 --> 01:37:15.330
This is a complete 180 on my old position.

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.

01:37:26.970 --> 01:37:33.210
You can't imagine how crappy bugs are that come in from the outside world sometimes.

01:37:33.210 --> 01:37:36.970
People have no idea how stuff works and they think they're geniuses.

01:37:38.690 --> 01:37:40.610
But I was wrong.

01:37:40.630 --> 01:37:41.610
I'm telling you this.

01:37:41.610 --> 01:37:43.410
I've seen the results firsthand.

01:37:43.990 --> 01:37:51.010
If you want richer bugs from the outside world, maybe you should make bug finders richer.

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.

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.

01:38:10.190 --> 01:38:12.790
If we get more, we might keep throwing more money at this.

01:38:12.790 --> 01:38:14.310
I don't know how many bugs there are.

01:38:14.530 --> 01:38:20.910
But we believe in A, this sort of behavior is toxic.

01:38:20.910 --> 01:38:22.530
It destroys the mobile web.

01:38:22.590 --> 01:38:24.610
It is some of the worst stuff we see in advertising.

01:38:24.610 --> 01:38:26.950
And I run a company that fixes advertising.

01:38:26.990 --> 01:38:28.370
This is still offensive.

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.

01:38:35.690 --> 01:38:37.430
So thank you all.

01:38:37.430 --> 01:38:39.570
This has been a blast.

