start	end	text
0	8680	DEF CON, I missed you. Wow. So, show of hands, how many people
8680	14460	are here for their absolute very first DEF CON? Thank you.
16680	21940	You know, I've been doing DEF CON for a long time. This is
21940	26400	about my 15th year. And I've watched it grow up. I've watched
26400	31020	it grow from a tiny little thing at the Alexis Park to we've kind
31020	35640	of overfilled the Rio. And the one thing that amazes me is just
35640	40520	like, wow, people are just here having incredible amounts of
40520	48560	just fun and joy. And you guys see this iHackPineapples guy?
49100	55800	I don't know who you are, but you're my freaking hero. Basically
55800	57920	this guy is like, you're going to come to DEF CON, you're going
57920	60740	to hijack the Wi-Fi. Yeah, I'm going to take that really crappy
60740	62700	piece of gear you bought and I'm going to break it. And if you're
62700	68260	late, you can fix it. And if not, go get a refund. So, awesome.
68640	72160	So what am I here to talk to you about? So I have a little bit of
72260	75700	a tradition when it comes to my DEF CON talk. I never actually
75700	79260	tell people what I'm going to talk about. Sorry. I don't know
79260	82460	what I'm going to talk about. The subjects of my talk is a
82460	90480	decent random number generator. So my talks are weird for DEF
90480	94920	CON. Because, you know, we're hackers. We like to break
94920	101840	things. But that's not really just what I do here. I like to
101840	106680	show what's possible. And I like to show, hey, we can scan the
106680	110460	entire Internet in a series of seconds. We can bust people who
110460	113420	are doing violations of network neutrality. There's a few funny
113420	118700	things we can do over DNS. Actually it was great. I once
118700	123260	had like Darth Vader dancing on stage video streaming over DNS.
123260	126040	Somebody told me you couldn't get high bandwidth over DNS.
126040	131540	Somebody was wrong. But this is not the same thing. It's just
131540	138880	showing what can be broken. So let's talk about why, what we're
138880	141180	going to talk about today. Because we're going to be here
141180	143660	for a few hours and you should have some idea that maybe
143660	146600	there will be something you're interested in. We have a bunch
146600	150140	of subjects. We are actually going to talk about why random
150140	155000	number generation keeps getting things owned year after year.
155160	158720	Have kind of a quote which is I would like to not be fixing the
158720	162620	same bugs 15 years from now. I'd like to be fixing new bugs. But
162620	167280	that would require dealing with the existing stuff. I want to
167280	170520	talk about how we're sort of expecting users to recognize
170520	176080	these huge strings of hex and it's bullshit. I want to talk
176080	180040	about browser road day. There's a ton of vulnerabilities that
180040	182780	are undiscovered and they all kind of follow the same form
182780	185760	and we have to start dealing with them. I want to talk about
185760	190200	DDoS. We really are getting distributed denial of service
190200	193720	attacks that are scaling at a level where really it's an open
193720	198720	question if the internet is going to keep working. So how
198720	204720	much did the NSA shit the bed anyway? But before any of that,
204720	209400	I want to talk about why hackers are useful. And I want to do
209400	214880	that by discussing of all things, hard drives. So let me
214880	219600	give you a scenario. An attacker has compromised a system and
219600	224260	put something malicious on the hard drive. How bad could it be?
224340	228040	What could possibly go wrong? Well, you know, they might have
228040	230500	put in like an auto-launching daemon. You boot up your
230500	233200	machine, it's got a root kit. You might have replaced some
233200	236320	core operating system files. Maybe they got really, really
236320	239720	clever and they like hit the master boot records. The first
239720	242380	thing the computer does right when it turns on is load some
242380	246260	piece of malware. And in all of these cases it sucks but at
246260	249820	least you can like format the hard drive, the bad guy is gone,
249820	256280	they are destroyed, right? Well, this funny thing happens when
256280	260440	you start researching hard drives. So a little bit of a
260440	267380	joke. What is the difference between a hard drive and a brick?
267380	271840	The answer to this question is, given sufficient research, there
271840	277720	is no difference. Never in my life have I done more expensive
277720	282900	research. There goes 75 bucks. There it is gone again. See,
283440	289540	here's the deal. In theory, a hard drive is a thing you put
289540	295680	data on. Bits go in, bits come out, the bits stay the same. In
295680	302340	reality, we have what I like to call exhibits iron law of
302340	308100	computer architecture. Yo dog, I heard you like computers. So I
308100	311780	put a computer in your computer so you can compute while you
311780	323930	compute. Now what is great about this iron law is that the more
323930	328910	you understand about computer architecture, the truer it gets.
328910	332470	Pretty much everything that runs automatically is another little
332470	335110	computer that is running on its own cycle that is going and
335110	340730	doing stuff. And of course, it's doing it fast, it's doing it
340730	345570	trusted, it's doing it insecurely. The reality is, is
345570	350330	that everything in your computer has become very generic. Your
350330	357250	iPhone has seven ARM chips. The biggest lie about a computer is
357250	363090	that it's just one. Okay? Every device you have ever owned is a
363090	368570	small network of mutually trusting, overly mutually
368570	372970	trusting devices. A hard drive is really just another computer
372970	375590	with direct access to your system memory via specially
376150	379750	designed physical and logical protocols. Now maybe you doubt
379750	382710	me. Maybe you think, oh, come on, Dan, you might be
382710	385470	exaggerating. So let me actually show you what happens when you
385470	390250	log into your hard drive. I did this project with Travis
390250	393350	Goodspeed, probably the single most entertaining hardware hacker
393350	396990	in the world. He's the guy behind POC, GTFO, proof of
396990	403030	concept. Get the fuck out. And so we sit down one day, we buy a
403030	406250	huge stack of hard drives and it turns out on the back of them
406990	410050	there's a serial port. What happens when you go into the
410050	413370	serial port? Well, you know, there's like an entire shell. It
413370	416750	has like documentation. It actually tells you what your
416750	420650	commands are. Oh, really, edit processor memory. And here are
420650	424250	my arguments that I need to know for that. Sweet. You get some
424250	427330	internal drive metadata. Like there's no hacking here. It's
427330	430450	like a straight up interface, right? You can go ahead, you can
430450	434930	like learn about your main disk, the public one. There's a
434930	437210	second one. There's an entire system partition. You can go
437210	441310	ahead and scrape through that too. Read the data back out.
441310	444230	Actually take a look at the data. You know, when your hard
444230	448590	drive is initialized, they run a bunch of tests. This is a
448590	452990	Seagate hard drive. It's actually Seagate's test output.
452990	461650	My favorite part of course being WTF status. Sweet. Now you might
461650	466050	be saying, but Dan, you had to like hook up special pins to the
466050	468550	hard drive. What, an attacker is going to teleport to your home
468550	471950	and do that? No, no, no. An attacker is going to go ahead
471950	475130	and there's a great command for messing with hard drives called
475130	478390	HD parm. We're going to run help on it. We're going to grep for
478390	483150	my favorite phrase in computer security, extremely dangerous.
490320	495300	And you'll notice nowhere does it ask for a password but it
495300	501180	totally wants the firmware to replace the system partition. So
502540	506340	I'm not kidding about making bricks. I actually have my lab
506340	512620	notes from this and it looks like a, I don't know, a wake.
512620	515980	It's like this hard drive, fate, platters exposed, finger
515980	518880	printed, and I think we actually have like our fingers on the
518880	523260	platters. Firmware dump is 01 wrong. Brick by Dan when he
523260	526160	wrote to the buffer, probably repairable. Brick by Dan with HD
526160	530960	parm. Brick by Dan when he set the serial port to 62,500.
530960	536200	You look at these things funny and they blow up. I tell you
536200	538700	it's the most effective security technology of the hard drives.
541060	544000	So this eventually became a paper with a somewhat
544000	547160	predictable subject. Implementation and implications
547160	551800	of a stealth hard drive back door. I'm kind of an unindicted
551800	555200	co-conspirator on this. They did ten months of work. They
555200	560180	actually built malicious firmware that hides on the hard
560180	564160	drive, corrupts the surrounding operating system whether or not
564160	567900	the drive has been formatted. It's owned forever. Kind of
567900	574100	nice. Why do I tell you all of this? There is something which
574100	577880	I have been discussing privately for some time called storage
577880	582700	XOR execution. Which basically says from an architectural
582700	586900	standpoint, if you have code you're running that you know is
586900	592060	malicious, that you are completely aware is exposed to
592060	598220	skilled attackers, at minimum separate the piece of the system
598220	602660	that remembers, that persists, that stores from the piece of
602660	608360	the system that computes, that operates, that parses. So sure,
608360	611940	you can go ahead and provide some malicious input and own the
611940	616320	machine. That might happen. But you can't keep your ownership
616320	620660	without storing it somewhere where it might get discovered.
621220	624220	You actually spend time with attackers. One of the things
624220	627760	they tell you is it's not about ownage. It's about continued
627760	630940	ownage. It's about coming back in a year and your root kit is
630940	634360	still ready to go. You don't have to break your way back in.
634940	641480	Okay? You can't even start discussing storage XOR execution
642000	647320	if you don't have the paranoia of realizing all of these places
647320	652360	to persist your attacks. You know, I'm one of these rare
652360	655620	people in information security that is happy we are talking
655620	659720	about APT, about advanced persistent threats. People say,
659720	662000	how can we be discussing this? These attacks aren't very
662000	665360	advanced. I'm like, holy hell, we have people admitting we have
665360	669140	vulnerabilities we have no idea what to do about. Great. Stuff
669140	675940	is not working. Let's at least talk about that. We aren't even
675940	681980	having it as a basic part of discussion that maybe when you
681980	686580	use resources in a cloud, the underlying hardware should only
686580	690240	be shared with other people in your cloud, like in your
690240	694160	organization. Perhaps there should not be one piece of
694160	697640	hardware for two different customers. Two customers, one
697640	708840	hardware. Works about as well as you think. This, this is the
708840	712860	value of hacker engineering. See what I like about hacking is
712860	717600	that we have no delusions, okay? We are willing to see what
717600	722600	systems are actually capable of from first principles. In fact
722600	726980	you say something is impossible and we get to work. We are
726980	730680	needed. Let me tell you, there's a lot of people out there who
730680	735240	want to modify the internet who have no idea how it works. At
735240	740640	least we have a fighting chance. You know what? I got to say, I
740640	746100	like hacking all the things. But I also like all the things. Let
746100	753100	me show you something very near and dear to my heart. This is a
753100	760720	cat in a shark costume on a Roomba chasing a duck. Fuck
760720	772510	yeah! The internet has changed things. I get this cat. There's
772510	775970	no Bob Saget. There's no America's Funniest Home Videos.
775970	780670	There's no Wiffle Ball hitting some kid in the nuts. There's
780670	786650	just the kitty, okay? And that, that is awesome, okay? One of my
786650	790290	favorite artists, she goes on television, she's told, your
790290	794290	music sounds like a rat being strangled. She goes, why yes,
794290	798110	there's a market for dubstep. I should play violin while playing
798110	803530	dubstep. She gets a half billion views on YouTube. She's a big
803530	808250	deal now. And yeah, she does it with playing songs from Skyrim
808250	815090	and Halo and Zelda. This appeals to my interest, okay? Lindsay
815090	821090	Stolle has rocked it. We live in a world that sucks less because
821090	827090	of the internet. I believe in email. I have never in my life
827090	831670	received an inter-office memo and I hope I never do. I prefer
831670	838910	Skype over plain old telephone, plain owned telephone service. I
838910	842490	prefer online banking over having to sit for hours in a line
842490	849010	in a bank. The internet has changed how things work. We
849010	854490	could lose it. Like there's a level of compromise out there
854490	858450	where we don't get all these nice things. And there are some
858450	864450	people who even prefer that. Got to remember, the internet was
864450	868690	not the first time we tried to create the internet. It's very
868690	873290	matrixed like that. This is like the eighth attempt. Who here
873290	881430	is on like Prodigy or Minitel or AOL? Like, we tried this a
881430	886350	bunch of times. AOL spent like a billion dollars on modems one
886350	888810	year. Turned out it was a good investment. They're still
888810	892990	making $160 million a year off that stuff. Grandma loves her
892990	900650	dial up. The reason the internet worked is because it
900650	905630	was ours. Okay? This was the playground of nerds. This wasn't
905630	909910	biz dudes who made something for biz reasons. This was nerds who
909910	918950	were like, I got to send me some e-mail. And the key is, my God,
918950	922190	it was cheap. No one on the internet ever said that you had
922190	925910	to pay some portion of your revenues. People complain about
925910	929930	paying for DNS names. What is the ratio between how much money
929930	934570	Google makes and how much they pay for Google.com? I don't
934570	945810	think there's a smaller number. One over Google. Contrast that
945810	948850	with the Apple situation. Oh, you would like to be on our
948850	954710	device. 30% gross, please. You know, it's a very, very
954710	961390	different model. And the free internet has disrupted so much.
961530	965250	And there are those who would like to disrupt it back. So,
965250	969210	here's the challenge. We are the guys who actually know how this
969210	972770	damn thing works. We are the people who know that breaking
972770	978130	everything is possible. We don't know that fixing everything is
978130	981590	impossible. Now, you know, technically it's a bit of a game
981590	987130	but technically correct is the best kind of correct. So why do
987130	991570	I do this? Why am I here? Because I see openness to the
991570	996570	possibilities. I see that there's sheer joy in this
996570	1000850	community for understanding how things work. I see people
1000850	1005070	willing to call bullshit on everything. Especially the parts
1005070	1009010	of security theory that are just clearly wrong. Because,
1009010	1012850	what, you think everyone else in engineering can screw up and we
1012850	1017410	in security are infallible? We screw things up all the time. We
1017410	1023870	just have way more attitude about it. So, that's kind of my
1023870	1028550	world. Whoa, why did everything just go dark? Get back here. Come
1028550	1039890	back. I believe in you. All right. So that's the grand world
1039890	1045650	vision kiddies on Roombas. Let's nerd out a bit. I want to talk
1045650	1049550	to you guys about random number generators. Generation of random
1049550	1062930	numbers is indeed too important to be left to chance. What does
1062930	1066590	it actually mean to need a random number generator? Many
1066590	1070990	processes require a generator of unpredictable numbers. That means
1070990	1074410	if you get the last thousand, you can't figure out what the
1074410	1077110	next one is going to be. You can't go back and figure out
1077110	1080890	what some of the older ones were that you missed. Now, just
1080890	1085490	because we require a strong random number generator doesn't
1085490	1089430	mean we're actually getting strong random number generators.
1089430	1091990	Here's a couple of various talks. How I Met Your Girlfriend
1091990	1097610	by the great Sammy Kamkar. Many web applications are failing
1097610	1101250	for session management. Exploit information for Python. Exploit
1101250	1107730	information for Ruby. What the hell is going on? Well, the deal
1107730	1110450	is that all these various web frameworks, you don't actually
1110450	1115070	log into them that frequently. One of my friends was an admin
1115070	1120010	at a major e-commerce site. He's like, yeah. Oh, wait, wait. We
1120010	1124530	have an interruption. Excuse me. So as you all know, we have a
1124530	1128670	tradition here at DEF CON with new speakers. We have a new
1128670	1135970	speaker with us this year. His name is Kaminskow? Kaminskow? I
1135970	1138370	think that's the right way to pronounce this. No, I think you
1138370	1143130	messed it up. Try again. Kamikow? Kamikow. Yeah, it's
1143130	1150330	Kamikow. Anyway. Come here. It's good to be back. Good to see
1150330	1162090	you. Magnificent bastards. New speakers and really fucking old
1162090	1174780	speakers. Oh, snap. It overflows back to zero. Actually, I missed
1174780	1182220	the year or so. So the deal is this. You have literally one of
1182220	1187080	the largest e-commerce sites in the world. We found a phone.
1187260	1200510	Does anybody have one? I'd say drink but I just did. Yeah, so
1200510	1203430	you've got one of the largest e-commerce sites in the world and
1203430	1207250	you'd be like, how many logins per second do you process? You
1207250	1211950	think it's like tens of thousands or thousands? Hundreds?
1212310	1218150	They're like, yeah, seven. Seven times a second we have to accept
1218270	1222690	a password. And it's surprising but when you actually think about
1222690	1227270	what happens, you put in your password, you get a cookie, that
1227270	1230550	is now password equivalent. That's the thing that's shoved
1230550	1235850	into the web app every single time you visit. That value
1235850	1241150	ideally is a random value. Man, it would suck if you could go
1241150	1244510	ahead and log in a thousand times and predict the next
1244510	1249490	thousand log in magic numbers. That's actually totally what's
1249490	1256230	happening. More recently, a few days ago, awesome attack. One
1256230	1260390	of the ‑‑ so beautiful. A guy by the name of Dominique
1260390	1266230	Bongard, reversity on Twitter, came up with an attack against a
1266230	1271230	scheme called WPS. WPS exists so that you can relatively
1272110	1274970	efficiently negotiate with an access point and find out what
1274970	1278150	the passphrase is so you can log in and use the internet. And
1278150	1284050	they made up this incredibly ill‑advised protocol for it. I
1284050	1289450	mean, just like impressively. But the one part of the protocol
1289450	1293710	that wasn't actually awful was this piece where at the
1293710	1298870	beginning you have some value and it's encrypted with a 128
1298870	1304710	bit key. It's randomly generated but it's encrypted. And, you
1304710	1308870	know, breaking a 128 bit key is not going to happen. Like,
1308870	1311770	that's a 2 to the 128 work effort. That's going to take
1311770	1315630	until the end of the universe. However, it requires you to
1315630	1321450	actually have 128 bits of entropy. Which none of the
1321450	1326510	devices did. Device one had what's called an LFSR, a linear
1326510	1329890	feedback shift register. They keep showing up in this space
1329890	1333670	because they're the quickest and easiest way to get this stream
1333670	1337290	of numbers. You start with a seed value and it just keeps
1337290	1340930	rolling and rolling and rolling. Well, the seed value in the
1340930	1345230	first device was 32 bits long. So you just try all 32 bits
1345230	1349990	combination. Second one, another 32 bits. The third one
1349990	1361750	just encrypted with zero. Beautiful attack. So let's talk
1361750	1366850	about why really we keep getting owned by random number
1366850	1370650	generators. And the most important thing to realize is
1370650	1374990	there's a huge amount of discussion in the cryptographic
1374990	1380290	world about the absolute right way to build a cryptographically
1380290	1384790	secure random number generator. And for the love of God, most of
1384790	1388650	it doesn't matter. No one's getting owned because they use
1388650	1393970	SHA-1 or SHA-256 or hell MD4. No one's getting owned because
1393970	1397910	they use hash instead of HMAC DBRG. They're not getting owned
1397910	1400710	because they used the same entropy for too long and didn't
1400710	1403970	mix in new entropy. We're not getting owned because we had one
1403970	1408990	pool instead of 32 pools. Like there's a disconnect between
1408990	1413670	what's getting us owned and what we argue about. The fundamental
1413670	1419230	truth is there's like a thousand different ways to build a
1419230	1424790	cryptographically secure pseudo random number generator. And
1424790	1429490	they all have an incredibly high security margin. That is the
1429490	1432910	fundamental truth. When you actually look at the systems in
1432910	1437350	the field that are breaking and they are all breaking, your two
1437350	1442990	problems are one, there's no entropy at all. And two, we're
1442990	1446290	not even using cryptographically secure pseudo random number
1446290	1451150	generators. We're using LFSRs. We're using crap. This is what's
1451150	1456590	actually happening. So let's talk about the no entropy
1456590	1460810	problem. What does a cryptographically secure pseudo
1460810	1465710	random number generator do? It takes a little bit of entropy.
1465730	1471050	128 values that are either 0 or 1 that have no particular
1471050	1476250	pattern. It takes that little tiny chunk and spreads it out
1476250	1480650	into number after number after number, gigabytes, hundreds of
1480650	1485730	gigabytes, whatever. Your idea is from an attacker standpoint,
1485730	1489690	you can look at as much of this output as possible. You learn
1489690	1496250	nothing about the secret. Your best attack is unfortunately to
1496250	1502450	guess what all 128 bits of that seed are and it's just not
1502450	1509030	feasible. There's too many. Now, in order for this to be true,
1509030	1514850	you actually need 128 bits. What killed WPS is there actually
1514850	1518730	wasn't. Generally there was 32 bits which is a meaningful,
1518730	1523470	which is a successful amount to break. One case there was 0.
1523530	1528890	This isn't an obscure bug. Nadia Henninger did this incredibly
1528890	1533490	beautiful attack a few years ago where she found 1 out of 200
1533490	1538510	RSA keys on the internet were actually badly generated. Now
1538510	1543270	here's what's scary. If she finds that 1 out of 200 keys are
1543270	1547690	identical, the method that she used doesn't actually tell her
1548270	1552670	if the keys are almost identical. If there's a single
1552670	1557690	bit of difference and otherwise everything is the same, Nadia's
1557690	1563270	method wouldn't be able to find it. So unfortunately we have
1563270	1567510	this really ugly situation where 1 out of 200 is a floor and
1567510	1570930	really it's something like 1 out of 50 keys on the internet is
1570930	1575870	bad. That's an incredible failure rate. Shouldn't DevRandom
1575870	1579330	and DevUrandom have actually prevented this? Because these
1579330	1581990	keys are actually being generated out of what are
1581990	1587810	supposed to be well engineered kernel systems. Let's talk about
1587810	1592530	why we actually really do like kernel random number generators.
1593390	1599570	First off, when you have hardware in your computer,
1599570	1603370	remember your biggest lie of a computer is just one computer.
1603570	1608270	When one of the other pieces on the other computers talks to
1608270	1613390	your CPU, literally what happens is a piece of the kernel is run.
1613470	1617630	An interrupt is fired, the CPU jumps to a certain point, you
1617630	1623650	get a time stamp at that. You now have an interaction of
1623650	1629510	someone else's clock with yours. You ever wonder what it means to
1629510	1632570	actually collect random information, what it means to
1632570	1636970	collect entropy? What are you doing? At the end of the day,
1636970	1641510	what you're doing is you're measuring a slow system with a
1641510	1645150	fast system. You know, I can snap my fingers and I think I
1645290	1648190	have a rhythm going. You think I have a rhythm going accurate to
1648190	1653510	the nanosecond? No, I don't. Because that's not how accurate
1653510	1657890	human systems are. We are at best accurate to the hundredth
1657890	1663310	of a second. When you have a computer that says I'm going to
1663310	1665610	watch your mouse movements, I'm going to watch your interkey
1665610	1669390	stroke timings, you basically have a situation where a CPU
1670050	1674430	that is running at billions and billions of cycles a second is
1674430	1677490	measuring a system that's running at hundreds of times a
1677490	1680050	second. And that's what's happening in this kernel
1680410	1683330	situation. The kernel is seeing an event come in and it's
1683330	1685310	hoping it's coming from some other computer that's running
1685310	1690130	slower or at least out of its control. Another great thing
1690130	1693330	about kernel RNGs is that there's just one kernel, at
1693330	1697110	least ideally. So you don't have some situation where one process
1697110	1699810	is doing something right and one process is doing something
1699810	1703230	wrong. Every process benefits from whatever randomness is
1703230	1709790	available. It's shared. Finally, this is tricky stuff. And one of
1709790	1714170	the whole points of an operating system is to take tricky stuff
1714170	1719230	and put it into a box that smart people build it and it is done
1719230	1725550	right. So that was the idea. What went wrong? Well, all those
1725550	1729210	devices that were going ahead and generating these random keys,
1729210	1734710	all these devices were started up, there was nobody at the
1734710	1738970	keyboard, there was nobody at the mouse, there was no hard
1738970	1743710	drive to be getting friction from air. There were no events
1743710	1747570	coming in from the hardware. It was just sitting there. And if
1747570	1751290	you've got no events, you've got no entropy to operate on. Now,
1751290	1755910	it would be nice if CPUs actually had hardware random
1755910	1760230	number generation. But for whatever reason, that just
1760230	1764370	consistently seems to be outside the purview of our modern CPU
1764370	1769470	manufacturers. You just can't figure out how to do it. So how
1769470	1774450	do you solve this problem? Like, really? The truth is, you don't
1774450	1778030	have to be perfect. You could fail every once in a while and
1778030	1782050	you're still going to beat the one nine of reliability that we
1782050	1789510	got out of RSA. That really sucks. You've got to force the
1789510	1793230	synthesis of events. You have to actually force a situation where
1793690	1798390	the device, whatever device that it actually is, has something
1798390	1802870	on a slower clock that's pinging the fast clock. And
1802870	1806810	realistically what that means is using the real time clock,
1806810	1809750	which tends to be a separate chip, tends to run at some
1809750	1814530	amount of kilohertz and having that ping the CPU which tends to
1814530	1817650	be running at some amount of hundreds of megahertz to
1817650	1823730	gigahertz. This actually works. Now you can also go ahead and do
1823730	1826450	some actions that take a hopefully non-deterministic
1826450	1830430	amount of time. So reading values out of memory, causing
1830430	1834610	contention for resources. You want to do what's called
1834610	1838310	whitening. So that means you take any sequence of bits. If
1838310	1841490	it's a zero zero, you throw it out. If it's a one one, you
1841490	1844830	throw it out. The zero to one transition is considered a zero.
1844830	1847630	The one to zero transition is considered a one. This is what's
1847630	1851370	called de-biasing your data. I released a piece of code called
1851370	1855330	docker RAND about two years ago. Docker RAND was based on
1855330	1859630	true RAND by Matt Blaze from about ten years ago. I think
1859630	1867450	actually about 1996. If we had followed Matt Blaze's guidance
1867450	1872590	in 1996, we would not have a single nine of reliability for
1872590	1877610	RSA in, you know, 2012. That wouldn't have happened.
1878310	1882610	Part of security is accepting maybe there is some weird ass
1882610	1885810	environment where docker RAND fails. But is it going to fail
1885810	1894010	as much as status quo? No. No it's not. So let's talk about
1894010	1900110	the larger issue. Even worse than the fact that we don't have
1900110	1903170	true entropy to see this cryptographically secure pseudo
1903170	1907450	random number generator, is the fact that we're not actually
1907450	1913550	using the CSPRNGs at all. When you look at the languages that
1913550	1918990	people use to write software, JavaScript has math random, LFSR.
1918990	1924610	Ruby has Ruby RAND, LFSR. Java has Java util random, PHP RAND,
1925470	1934870	it's all crap. Why? Why are we doing this? Well, what ends up
1934870	1939410	happening is every time someone complains about the nature of
1939410	1942830	the random number generator that we have, we end up making
1943610	1948750	secure random. It's not fixing the old broken stuff. We make
1948750	1954870	some new API. Then we make it weird. It's never just like
1954870	1959530	math dot secure random. It's like bar A equals new UINT array
1959530	1965450	one window crypto get random values. What? That wasn't what I
1965450	1970190	was using when it was easy. Why are you making secure not easy
1970190	1978370	and not default? Does that work anywhere else? No. So why not be
1978370	1983270	secure by default? Why not instead of requiring some weird
1983270	1988130	ass random API, why not take the broken APIs and make them not
1988130	1993130	broken? So thus, we've actually been doing that. Ryan
1993130	1997170	Castellucci works with me over at White Ops. And what we've
1997170	2001070	been doing is systematically going through each and every one
2001070	2005890	of the popular web programming environments and we're taking
2005890	2011410	their crappy little math randoms and making them a shell for
2011410	2015690	dev U random. So we've gotten JavaScript support for node in
2015690	2019430	the browsers. We've gotten Ruby. We've actually made C's RAND
2019430	2026510	function actually RAND. PHP, Python, OpenJDK. It's not like
2026510	2029850	it's that hard to write this code. We actually just need to
2029850	2034230	write it and get it something that people agree, hey, maybe we
2034230	2038950	should just have an easy to use path here. Now there's going to
2038950	2042510	be some run time feature support like being able to interrogate
2042510	2046010	how good is this random number generator? Do we support fixed
2046010	2050610	seeds? Do we support high speed? So I'm going to do something now
2050610	2054310	which people tend to call, it's when I play chess against
2054310	2058210	myself. Let's talk about what's wrong with what we've named lib
2058210	2066510	U Randy besides the name. Ryan actually named it and I'm like,
2066510	2070970	sorry I can't think of this code as any other name now. There are
2070970	2075590	two reasons why generally you wouldn't use an approach like
2075590	2083790	this. The first reason is testers tend to like predictable test
2083790	2087670	results. So they tend to like situations where they can say I
2087670	2092270	want it to be a random stream but I want it to be the same random
2092270	2096170	stream. So the system will always behave in a predictable
2096170	2101570	way that can be regression tested. Now I actually never,
2101570	2108970	ever like this approach. Here's why. People say it's a two line
2108970	2113630	change. Why do you need to go ahead and retest everything for a
2113630	2117590	two line change? And here's the answer. It's because there's a
2117590	2123150	bunch of bugs that don't show up in the field for, not because
2123150	2128030	there isn't a bug, but because the house of cards fell in just
2128030	2132110	the same precise way. So that when the memory corruption
2132110	2137370	occurred, nothing bad visibly happened. And so when the house
2137370	2142510	of cards falls the same way every time, you never discover
2142510	2147050	the bug. And you only discover it when you do that two line
2147050	2150650	change. That shouldn't break anything but now the house of
2150650	2154570	cards falls like this and now everything blows up. I really
2154570	2159490	don't like these sort of fixed seeds because they allow the
2159490	2164590	ugly bugs to stay unfound unless you go ahead and do like a
2164590	2167830	complete massive retest which then you now have to do every
2167830	2172970	time because you keep getting burnt. It sucks. But people want
2172970	2175230	it and so okay, we'll go ahead and we'll have a special mode
2175230	2179310	for LibUrandy that allows you to say no, no, no, I intentionally
2179310	2181670	want my randomness to suck. Okay, fine, we'll set an
2181670	2187390	environment flag. More seriously, Urandom is actually
2187390	2193070	kind of slower than LFSRs. So you do have a situation where
2193070	2198550	it's 4 megabytes a second out of Urandom and 260 megabytes a
2198550	2204430	second out of your crappy bad randomness. And when you
2204430	2211570	actually look at the ‑‑ so I was interested. I believe in
2211570	2215390	being historical. Let's look at the historical record and see
2216090	2219030	why did these APIs get screwed up like this in the first
2219030	2222810	place. And at least in the browser case, they realized they
2222810	2225570	had a bad random number generator but they also had
2225570	2228430	benchmarks and they really didn't want to lose at the
2228430	2231790	benchmarks. It's like, well, we're not secure but we're not
2231790	2241210	being benchmarked for security. So even at 4 megabytes a
2241210	2246190	second, it's still like a million random numbers a second.
2246190	2252090	It's generally fast enough for everything but not always. So
2252090	2256090	this brings up the question, should we be using a user space
2256930	2259870	scriptographically secure pseudo random number generator? Now,
2259870	2262870	it doesn't mean that we don't use Urandom. We still mine it as
2262870	2266190	frequently as we might like. If it happens to get some new bits
2266190	2269290	of randomness from the kernel, great. Let's use them. Let's
2269290	2273050	integrate them in. But like I said at the beginning, like a
2273050	2278510	few minutes ago, pretty much every variant of a CSPRNG is
2278510	2281710	still secure. So one of the fastest hashes out there is
2281710	2286250	what's called sip hash. It comes from our buddy DJB. If you just
2286250	2288490	sip hash seed with an incremented counter, this
2288490	2293890	actually works. It's 20 times faster than dev Urandom on
2293890	2297630	Linux. It's competitive with the non-cryptographically secure
2297630	2301010	pseudo random number generators. I guess what I'm trying to tell
2301010	2306750	you is there's no advantage to sucking. You can be fast and
2306750	2311410	secure. It's okay. Now there is a possible improvement that we
2311410	2315430	could do and that is the integration of time. Specifically
2315430	2321050	what's called clock monotonic. Now while you can't get for
2321050	2326290	whatever mysterious reasons NSA good hardware random number
2326290	2333150	generator, you can at least get a time stamp. And it turns out
2333150	2337730	you just need bits that are different. We've got this
2337730	2341070	problem with what's called forking where you have a
2341070	2347050	process, you make a copy of it, the copy has the same seed and
2347050	2350470	the same counter value. Now you have the same entropy happening
2350470	2356310	twice. And it sucks. If you integrate time, it turns out
2357190	2361550	empirically it's a pain in the butt to get two things to happen
2361550	2366090	at exactly the same CPU nanosecond. It's not that it
2366090	2372150	can't, it's that it won't. That's a good thing. So you
2372150	2376790	could actually have on a per query to the random interface
2376790	2382270	basis, you could actually say give me this time stamp's view
2382270	2386470	of the randomness. So my preferred CSPRNG looks
2386470	2390170	something like SIP hashing the secret, a counter, the previous
2390170	2393870	output and what I call the shifted time. So you don't just
2393870	2397550	do the time directly, you shift it by some amount so the
2397550	2400550	attacker can't just say, well I know according to NTP that this
2400550	2403730	value is going to be almost zero. Force there to be some
2403730	2409550	fixed offset. I'm not doing this yet in Lib U Randy. And here's
2409550	2414970	why. Reasonable people can disagree about whether a CSPRNG
2414970	2419450	should be in user space and kernel space. But we all hate
2419450	2424570	LFSRs. So let's at least do something which causes those
2424570	2429410	damn things to die. Another change is maybe we don't use SIP
2429410	2434010	hash. SIP, it turns out because of quirks, you can do faster
2434010	2437870	with Blake, you can really do faster with Skyn. So both of
2437870	2440450	them are alternate hashing systems. We've found things
2440450	2444870	where it's like twice as fast. So really the right answer at
2444870	2448970	the end of the day may not be do a user space CSPRNG and maybe
2449570	2453510	fix up the really weird one inside of Linux which is
2453510	2456990	obsessed with mixing stuff in multiple poles, et cetera, et
2456990	2463290	cetera. The problems we don't have. So that's kind of the
2463290	2467470	souped nuts on what's going on with entropy generation. But
2467470	2473830	there's another problem around representation. Apparently you
2473830	2484790	are supposed to do something with D3B07384D1NGJU42MA1$JH89 and
2484790	2490730	whatever the hell that is, squiggly stuff. What the hell is
2490730	2500550	that? Stop puking bits. We are lying to ourselves if we think
2500550	2507570	users can do anything with that. They are lost. The problem is
2507570	2512230	is that computers actually need humans to recognize and to
2512230	2518950	remember large amounts of bits and it's hopeless. Okay? We have
2518950	2525150	hardware acceleration for human faces and even then we maybe can
2525150	2530110	get about 16 bits. There may be, if we're absolutely at the edge
2530110	2534970	of our capability, able to differentiate 65,000 people. It's
2534970	2539170	not that much. And computers want more, so much more, 24 to
2539170	2544650	128 bits. They want recognition. Have you ever seen this before?
2544650	2548150	And they want repetition. Hey, give me that long ass password.
2548890	2552270	And the standard stuff doesn't work. We did not evolve to deal
2552270	2558590	with hex or base 64 or base 58 or squiggly SSH art. It's just
2558590	2562970	not how we're built. Now, I've looked at this problem before. I
2562970	2566090	did some work. I called it crypto mnemonics. Went ahead and
2566090	2571950	took 512 male names, 1,024 female names, 8,192 last names. I
2571950	2575990	represented entropy by married couples. I'm sorry, totally
2575990	2580150	heteronormative but actually really diverse. You know, Julio
2580150	2583990	and Epifania, Dizuti and Luther, Roland, Dubros and Manuel and
2583990	2590930	Twilight and Bessie. Definite range of people here. This
2590930	2595590	actually works as a way to get yourself to be used to some
2595590	2600170	pattern of bits. You do have to show it every single time you
2600170	2603630	interact with something. You can't just show the entropy
2603630	2606630	representation when there's a problem. It's like you only see
2606630	2609510	someone's face when there's a problem. Otherwise they're in a
2609510	2612450	mask. No, that doesn't work that way. It's not how the brain
2612450	2617590	works. It needs spaced repetition to remember. Now can
2617590	2625270	we do better? Humans do have memory capacity. It's just not
2625270	2629170	for arbitrary bits. Like Homer's epics are enormous. There's like
2629170	2634530	kilobytes of entropy in there. The deal is is that we remember
2634530	2639990	objects. We remember stories. We remember narratives far more
2639990	2643530	than we remember arbitrary ones and zeros. So if you can
2643530	2648390	represent ones and zeros in these sort of narratives that
2648390	2653230	humans are built to remember, you actually have something.
2653290	2658170	Heck, maybe get like a password and like have it spell check. So
2658170	2662570	what we've been exploring has been using triads of adjectives,
2662570	2667390	nouns and verbs and having these be selected to be maximally
2667390	2672410	distant from each other and to encode whatever entropy someone
2672410	2676670	needs to recognize or repeat in these stories. I haven't been
2676670	2679730	doing this work alone. I've been working with my co-worker Ryan
2679730	2685410	Casalucci over at White Ops and it's his code, it's his work,
2685410	2688450	he's the one who should be talking about it. So he's going
2688450	2690890	to come on stage and we're going to talk about how he did this.
2698380	2700840	So Ryan, pick up a mic.
2702600	2705480	Hi, guys. How's it going?
2707740	2711960	So I just have to say, I have known Ryan for many, many years.
2711960	2715060	He recently started working with me at White Ops. I have never
2715060	2719120	had a guest come up in the middle of my talk and there's no
2719120	2723460	one I'd rather have be here. So thank you. So Ryan, tell me what
2723460	2724420	we're looking at here.
2724420	2731860	Okay. So we have up on the slide a randomly generated sample.
2733160	2736280	It's like 5E4D, it's like a bunch of bits?
2736280	2739360	Right. There's a couple algorithms that are combined
2739360	2743440	together to generate the encoding we have there. As you
2743440	2747640	can see, there's four groups of three words. Each one is an
2747640	2750260	adjective, noun and verb.
2751040	2754880	It's like macho acid answering, rustic cable fetching and
2754880	2755000	something.
2755000	2760780	Right. And we have a known amount of entropy there. So what
2760780	2765240	we can do, spell check for passwords, well, pass phrases.
2765960	2771380	So unfortunately we don't have a live demo to you. I could not
2771380	2777000	get the code to work fast enough for that. I will fix that soon.
2777320	2779700	The code will be released. It is awesome.
2779700	2783200	But we actually do have sort of a view of what's going on here.
2783200	2788980	That is, it can fix far worse than that. But as you can see,
2789800	2794580	transpositions, deleted spaces, replaced characters, added
2794580	2798720	letters, deleted letters, random garbage symbols, it can fix all
2798720	2799640	of this.
2799640	2801180	And the words are out of order even.
2801180	2806800	Yes. It is also order insensitive because people will
2806800	2810000	commonly mix up the order of words when they are trying to
2810000	2813620	remember something like this. And we can fix it so we should.
2814120	2816920	Interesting. So you don't have to remember if the acid is macho
2816920	2820280	or rustic. You just have to know acid, macho, rustic or whatever
2820280	2820560	order.
2820560	2821380	Exactly.
2821380	2824700	Okay. So let's talk about how you actually did this.
2824720	2828780	Okay. It's kind of complicated. I have code implemented in
2828780	2832640	JavaScript and Python. We will, it's on GitHub. The repo is
2832640	2838300	currently private. That will be changed soon. So we have two
2838300	2842840	major components. There's a combinatorial number system
2842840	2848060	encoder. That is an obscure but really neat trick where you can
2848060	2854220	take an arbitrary number and encode it as a series of
2854220	2859360	non-repeating symbols. So as the example shows, if you have
2860780	2866600	multiple A's, that's not going to work because you can't use
2866600	2868260	the same symbol more than once.
2868280	2871600	So this is like you have an encoding of possible letters
2871600	2875240	from A to Z. You could have B, A, D, F, G, C.
2875240	2879960	You're picking N of them where N might be 3 or 4 or 5 depending
2879960	2884440	upon how large a range of numbers you want to encode. And
2884440	2888540	this is fairly efficient. This is, you can do this fast. You
2888540	2892560	don't have to walk through all possible combinations. You can
2892560	2896680	generate a specific numbered combination and that's your
2896680	2897500	encoding.
2897800	2901640	And so you're actually able to take arbitrary bits of input and
2901640	2904960	map them to this scheme that says it's these numbers and
2904960	2908460	because the numbers are a combinatorial system, they can
2908460	2909340	show up in any order.
2909340	2913080	They can show up in any order, yes. For decode, we just have to
2913080	2913840	sort them.
2913840	2916200	All right. So talking about the decode, you're not having it be
2916200	2917900	raw numbers, you're having it be words.
2917900	2923300	Right. So there's another step here which is our word mapper.
2923620	2931760	Our word mapper has a dictionary file. In the implementation we
2931760	2934140	were showing in the last slide, we actually have three
2934140	2937680	dictionaries, one for nouns, one for adjectives, one for verbs.
2937780	2942120	And we actually include three values, one with X nouns, one
2942120	2945460	with X verbs, one with X adjectives and interlace them.
2945910	2952300	But it's a little messy. Anyway, so our dictionary has our words
2952300	2957380	in it and variant forms of the words because it makes things
2957380	2961820	easier for people. So for the verbs, for example, it doesn't
2961820	2970220	matter if you say forbidding or forbidden or forbade or whatever,
2970220	2975540	they're all forms of the same verb. We know that. We
2975540	2981780	canonicalize them. And in coding we just pick the canonical form
2981780	2983810	which in this case would be forbidding.
2986200	2991820	So we're basically taking all the common errors of password
2991820	2995780	input and we're saying those common errors no longer count.
2995780	2998680	We're going to correct for them before we even let them get into
2998680	2999340	the decoder.
2999340	3007160	Exactly. And I've got some crazy Python code using I think
3007160	3011140	something called node box which is a linguistics suite that we
3011140	3019020	use to generate all the verb forms. And then we have a
3019540	3023140	recursive algorithm that goes through and maximizes the edit
3023140	3024680	distance between words. If you're not familiar with edit
3024680	3030080	distance, I don't remember the specific one I'm using but each
3031480	3037180	character insertion, deletion, alteration or transposition of
3037180	3041400	adjacent characters counts as an edit. So we want to have at
3041400	3045960	least two edits between any words possible so that a single
3045960	3052460	typo cannot possibly result in a valid but wrong word.
3053280	3056260	Basically computational linguistics as applied to
3056260	3065830	security. Basically a path out of using lead speak as a
3065830	3070470	security technology. There's no more of this like, I used an app
3070470	3074010	sign, I'm secure. We all know exactly how well that works and
3074010	3077010	if you don't, go talk to the core logic guys. I think they
3077130	3082730	have a contest that might change your mind. Nice. So it seems
3082730	3085830	pretty cool. You think this is going to let us have passwords
3085830	3090410	be generated server side? That's the idea. We generate not
3090410	3093930	necessarily server side but computer generated pass phrases
3093930	3099050	that there's a reasonable hope of people understanding and
3100210	3103550	remembering. It's always seemed to me like victim shaming. We
3103550	3106310	make the user generate the password so we can blame them
3106310	3108650	when their password sucks. Meanwhile we have no clue how to
3108650	3112150	build them one. I remember when a few months ago when we first
3112150	3116150	started working on this, Dan came up with some examples and I
3116150	3120050	think there was, I still remember most of what we had. We
3120050	3125370	had a flat monkey staring and we had a greenhouse jumping. There
3125370	3127930	was another tuple which I have now forgotten. But the point is
3127930	3131210	I looked at these maybe twice ever and I still remember them.
3131510	3135650	So we were talking last night about what the implications are
3135650	3138770	for allowing more key stretching. Can you explain what
3138770	3141930	key stretching is and why this makes it a more feasible
3141930	3147710	thing? This is really cool. So key stretching is the idea where
3147710	3153370	in addition to randomness in the pass phrase as a source of
3153370	3157270	difficulty to crack it, we also just make the hashing slow as
3157270	3164630	hell. You've probably all heard of B crypt or PBKDF2 or S crypt.
3164930	3171590	Yes, thank you. And this is somewhat limited because if
3171590	3175790	you're spinning for five seconds and it takes you three times to
3176810	3179810	get your password right, you're going to just throw the computer
3179810	3184570	through the window. But if we have spell correct, even if you
3184570	3188950	make a few small typos, it works the first time. It's fantastic.
3189270	3192530	And people generally aren't going to mind newly so much
3193350	3198030	waiting for their login to complete as they are waiting to
3198030	3200810	see if they typed their password correctly and if not having to
3200810	3204630	reenter it. I had a high security thing I built a while
3204630	3209690	ago. It would spin the CPU for 60 seconds and it was a
3209690	3213230	threshold scheme so we had five of us having to type passwords
3213230	3219510	and when somebody mistyped it, it sucked. But if you knew it
3219510	3222770	was going to be right, one minute wouldn't even be that bad
3222770	3229110	for disk encryption. So we're basically dealing with a common
3229110	3232490	failure mode of what would otherwise be a useful and
3232490	3235670	effective security technology. The more effective a security
3235670	3239550	technology works, the more we can use it. Cool. All right,
3239550	3242170	Ryan, thank you much. I really appreciate you building this
3242170	3262380	out. Do we have a drink? Someone bring a drink. All right. I
3262400	3271580	will. So there's a major use case to be considered with a lot
3271580	3276000	of this stuff. Speaking of work from a previous talk, a few
3276000	3279360	years ago I did something called Fidelius. Fidelius is basically
3279720	3284620	a trick that allows you to use a passphrase, any string of
3284620	3290580	characters, and use that to seed any asymmetric system. So you
3290580	3294980	can have a passphrase for an SSH key, SSL certificate.
3296200	3298440	Basically what I did was say, you know, a passphrase will seed
3298560	3301960	a pseudo random number generator and a random stream of bits is
3301960	3306260	the input to all key generators. So you hook the two together,
3306260	3308620	you guess what's called a password authenticated key
3308620	3314140	exchange scheme. It always works. This was relatively
3314140	3320120	obscure two years ago. This is becoming straight up mainstream
3320120	3323360	now. There's a scheme called brain wallet that allows you to
3323360	3327540	have a word or phrase going to a bitcoin address. There's a
3327540	3330980	scheme called mini lock that has a word or phrase going to, you
3330980	3334720	know, the rough equivalent of a PGP key. Not actually PGP but
3334720	3341620	still. These systems are incredibly vulnerable to having a
3341620	3346120	low amount of true entropy. Because by definition you're
3346120	3350100	publishing your public key. It's almost like it's called a
3350100	3357060	public key. So this has been a straight up expensive problem in
3357060	3360520	brain wallet. Tens of thousands of dollars worth of bitcoin have
3360520	3364960	been stolen. What we need is a way for people to be able to
3364960	3371300	remember more entropy. The idea is that storing all these bits
3371300	3374460	on a hard drive ends up being a screw up. People want something
3374460	3377740	they can hold in their head. If we have these sorts of
3377740	3382160	representation schemes that are self correcting, people can
3382160	3388040	remember more. Stuff will work better. So the general idea,
3388040	3392060	brain wallet and mini lock need human memorable entropy. Actual
3392060	3396180	security needs more entropy. This story bit system increases
3396180	3400780	memorable entropy. Now there is some interesting variations on
3400780	3403520	the scheme. You can go ahead, you can have what we call split
3403520	3409140	mode where you have a normal password you use. It allows
3409140	3413260	things to work. It will take like two hours to crack a key.
3413500	3417160	And then you have like a secondary password that's really
3417160	3421400	there to allow for key exchange. So moving a key from one location
3421400	3426020	to another. So that can be set to take a few seconds while the
3426020	3428940	slow mode, the one that's really in your head, that one might
3428940	3433020	take hours and hours. The general idea is that, yeah, it
3433020	3436920	might take you hours and hours but the relative slow down to
3436920	3439940	the attacker that's trying to brute force your keys from the
3439940	3443140	public key, that guy is just screwed. Because he has to run
3443140	3446660	an attempt only one every few hours, a couple of attempts a
3446660	3448920	day. He can wait until the end of time and he's not going to
3448920	3454040	get your money. Two more tricks that we can do. These aren't
3455180	3460220	necessarily good ideas but we're hackers. Good ideas are not
3460220	3467960	exactly required here. It is an argument that no matter how you
3467960	3473200	slice it, at minimum it's easier to remember 24 bits than to
3473200	3480460	remember 80 to 128 bits. So there has long been a desire on
3480460	3485660	the part of software developers who are presenting a key for
3485660	3490020	memory to have, here's the full fingerprint which we understand
3490020	3493780	you can't remember and here's a shrunk down version of it.
3493780	3498220	Here's the PGP key ID. Here's the RSA ID. Here's some smaller
3498220	3501660	amount of bits. And the problem is, from the attacker's
3501660	3505740	standpoint, they're like, great, I don't need to collide with the
3505740	3510900	big thing. I just need to match this 24 bits. It will take me a
3510900	3515380	little bit of math but it won't be that bad. So here's the
3515380	3520580	scheme that you can do. If the user can remember even a small
3520580	3524640	passphrase that is never submitted to the server, that
3524640	3529420	passphrase can be a sort of shrinker or a bit limiter. So
3529420	3533100	you take the full hash, you hash it with the passphrase, you
3533100	3538780	truncate the results. So the attacker still has to match all
3538780	3544900	128 bits, doesn't know the passphrase. Doesn't know what
3544900	3548280	the 24 bits are that he actually does need to collide
3548280	3553800	with. So this is going ahead and creating a differential between
3553800	3557680	the work effort of the bad guy and the work effort of the good
3557680	3562580	guy. You want things to be easier for the good guy. He has
3562680	3566660	a cost. Your legitimate user has to remember something. But the
3566660	3570900	idea is ten people who are trying to remember the same key
3570900	3575880	each have their own personal recognition appearance. It's
3575880	3580380	like they see the same face but for themselves every time they
3580380	3583360	see someone's face it's the same face. But ten people are seeing
3583360	3586260	ten different faces. It doesn't matter. They just need to see
3586260	3591360	the same face for themselves. Does that make sense? There's a
3591360	3594600	way of doing this in the opposite direction called local
3594600	3600080	stretching. There is a problem where you have some password
3600900	3607320	server. It's not particularly doing any work to make it so
3607320	3610200	when somebody compromises the password store, because we know
3610200	3615360	it happens a lot, that the attacker can't go ahead and
3615360	3618500	figure out, aha, I got the password store, now I've got the
3618500	3624560	plain text password. What you could do is have the stretching,
3624560	3629500	the complexifier of the password actually happen in the client.
3629500	3635220	So it's like, yeah, the user is remembering ABC123 but it's
3635220	3639460	being expanded out a billion times before it's ever sent to
3639460	3646360	the server. Where things get messy in having basically
3646360	3650600	software generate the passphrase, the one that is the
3650600	3655540	actual password for a server, is every freaking website has its
3655540	3659700	own rules for what a password has to look like. Oh, it has to
3659700	3664140	have symbols. It must not have symbols. It has to have three
3664140	3668440	numbers, two numbers, eight numbers. By the way, going from
3668600	3670660	a scheme that has to have a letter to a scheme that has to
3670660	3673680	have a number, you know there are more letters than numbers.
3674500	3681800	You kind of just made things worse. What you can do is a kind
3681800	3686540	of a cute trick. And that is you can examine the pattern of
3686540	3689660	the passphrase that was provided by the user. So the user says
3690880	3694980	ABC123 with a symbol. And that can be interpreted as requires
3694980	3697980	three numbers and a symbol. And then that is what is actually
3698600	3704180	stretched or expanded out. So it's inferred discovery of
3704180	3710640	password policies. Kind of a neat trick. So now we've gone
3710640	3714200	ahead and we've gone into pretty amount of detail on how
3714200	3717820	we generate random numbers. And we've also talked about how we
3717820	3721780	represent arbitrary data. Now let's talk about some ODA, okay?
3722980	3726820	The other shoe has kind of dropped. IE had more attacks in
3726820	3730520	2013 than Java. And you know how much we love making fun of
3730520	3736080	Java. How is this possible? IE at Microsoft has been working to
3736080	3742980	secure IE for a decade. How is it that things have fallen so
3742980	3755800	far? So, excuse me one sec. Got some water in me. Here's the
3755800	3762280	deal, guys. Anyone remember way, way back in the day when
3762280	3765800	Microsoft was just like, you know, Internet Explorer is just
3765800	3768980	Windows. Like, they can't be separated. Are you crazy?
3770040	3774100	Everyone thought that they were lying, they were full of it. And
3774100	3777720	you actually look at Internet Explorer, that damn thing is
3777720	3781700	Windows the remix featuring the Internet, okay? It really is
3781700	3786000	Windows. You have this object model that was built back in the
3786000	3789200	90s called Calm. And they're like, hell, let's go put that on
3789200	3792980	the Internet. It's like if you put mem copy on the Internet,
3792980	3795440	okay? Like, hey, you know, we've got this API here. It takes
3795440	3801240	bytes from somewhere and puts it somewhere else. What, you want
3801240	3807740	it secure now? We barely have this working. And don't worry,
3807740	3810680	because of the nature of browsers, because they're all
3810680	3814600	implementing the same standards, everybody ended up with
3814600	3818380	something that looked pretty much exactly like Calm. Like,
3818380	3823200	for example, XP Calm from Firefox. It's not exactly
3823200	3825760	subtle. I mean, it is literally what's called an interface
3826360	3830260	description language literally built into the very standards of
3830260	3835920	the web. This is how it would have to work. Yes, attackers
3835920	3838960	loved attacking plug-ins. Because it didn't matter if you
3838960	3845300	were attacking IE or Firefox or Chrome, it was still Java, write
3845300	3849020	once, own everywhere. You didn't have to customize it at all. You
3849020	3852280	even got to escape all these weird little sandboxes that the
3852280	3858220	attackers were messing around with. And so, you know, as has
3858220	3863960	finally come out, my Tor de-anonymization has a first
3863960	3872840	name. It's Firefoxoday, as the gruk might sing. Vulnerabilities
3872840	3876680	in the raw browsers have taken over vulnerabilities in their
3876680	3881900	plug-ins. And that's because we've been exposing the
3881900	3884140	underlying object model to something that it was never
3884140	3890920	really designed to be exposed to from bad guys. Browsers, in
3890920	3896000	their normal operation, are constantly allocating memory and
3896000	3900760	associating a type with it. This pointer is to a table. This
3900760	3904360	pointer is to an image. Now, if you're going to be constantly
3904360	3908220	allocating memory, you've got to free it at some point, right?
3908220	3912440	You've got to reuse that memory. So what happens is, a
3912440	3916260	pointer starts out and it's pointing to a table. And
3916260	3919720	eventually, the system says, user's moved on to a new web
3919720	3923860	page. I don't need that table anymore. And so that pointer is
3923860	3928560	free. And then later, it says, ah, I've got space. Let's go
3928560	3933300	make an image. Let's put an image there. Problem is, if
3933300	3935880	you've looked at JavaScript, there's like a million ways to
3935880	3940040	have a pointer to a pointer to a pointer. This table has an
3940040	3942980	image inside of it. This image has a CSS thing inside of it,
3942980	3946420	which has a link back to another image. There's a billion ways
3946420	3950180	for objects in HTML and JavaScript to point to another.
3950640	3955200	And if you ever get the system screwing up, getting it to free
3955200	3959920	memory, and it still has some pointer still pointing to it,
3959920	3965440	you now have two object contexts, one pointer. And that
3965440	3970000	also works about as well as you'd hope. So use after free,
3970000	3973580	that's when you have two different contexts in one. Use
3973580	3976980	after free is something like 90 to 98 percent of the
3976980	3981660	undiscovered vulnerabilities in browsers today. And it's a real
3981660	3987180	problem and it's not going away. Except that it kind of is.
3987380	3989620	Google and Microsoft are actually doing some pretty
3989620	3994660	serious things to deal with use after free. The Google solution
3994660	3998840	is a typed heap. So what they're saying is, we're going to keep
3998840	4002600	all the tables together. We're going to keep all the images
4002600	4006880	together. So when you go back and make a second allocation,
4006880	4010220	everything is with its peers. You don't get some situation
4010220	4014740	where you use a method of an image on a table. You use a
4014740	4018400	method of a table on an image. Because everything is sticking
4018400	4023620	together. And this actually makes it incredibly harder to go
4023620	4027600	ahead and exploit vulnerabilities. Microsoft as
4027600	4031580	well is doing stuff. They're doing a lot of things. But the
4031580	4034500	fundamental advantage of their approach is what's called
4034500	4039260	non-deterministic fuzzing or freeing. They're making it so
4039260	4042920	the attacker never quite knows if they go ahead and pull their
4042920	4048280	stunt, it's going to work. It might work, it could work, but
4048280	4053400	they don't know it will. This is great. This is attacking the
4053400	4058280	unique needs of an exploit. This is counter exploitation. Sure,
4058280	4061060	you have probabilistic likelihood, but your
4061060	4066760	requirement, your need is guaranteed reliability. So
4066760	4072400	Microsoft is playing that game. I got a trick. A trick called
4072400	4076620	Iron Heap. Named by the inestimable Rob Graham. And the
4076620	4081760	idea is really simple. You can't use after free if you just don't
4081760	4089940	have free memory. Nope. That's not going to do it. There's a
4089940	4094240	little bit of a problem with this, you might know. We don't
4094240	4096740	actually have an infinite amount of physical memory. But you
4096740	4101700	know, on 64 bit machines we have an awfully large amount of
4101700	4107060	virtual memory. So the basic idea is we never reuse an
4107060	4112060	allocation. Your virtual memory space is 64 bits long and is
4112060	4116360	basically mapped. Say this chunk of the address space points to
4116360	4121040	this page and this chunk points to that page. You keep reusing
4121040	4123880	physical memory, but the pointers, the stuff that's
4123880	4127920	actually exposed to user space, the addresses that are actually
4128840	4132500	exploitable by the various use after free techniques, they're
4132500	4137220	never reused. Because you just have so much room. Look, we've
4137220	4141420	only had 64 bit browsers really for a very short amount of time.
4141420	4146380	This is the best possible use of 64 bit space. So the idea is
4146380	4153200	that 0x1234123412341234, once it's freed, that's it. It never
4153200	4158700	points again to an image or a CSS script or a JavaScript. That
4158700	4166900	page stays unmapped forever. Exploit that. So we've got to do
4166900	4172420	some stuff to make this efficient. You can only have a
4172420	4175680	finite number of active allocations. The reason this can
4175680	4179920	work at all is because there's actually hardware acceleration.
4179920	4184220	There's what's called a memory management unit that very
4184560	4188460	quickly allows a process to say, hey, I'm accessing this virtual
4188460	4192260	fake address, make it really quick for me to go ahead and
4192260	4196500	figure out what page of memory has the real content. Make it
4196500	4200920	really quick for me to find out there is no page. You can't have
4200920	4205240	an infinite amount of these mappings. But you don't need an
4205240	4208040	infinite amount of these mappings. You need to have like
4208040	4216460	the top 10,000. The top 15,000. Anything else can swap. Guess
4216460	4223480	what? Machines swap. Maybe to disk, maybe to more RAM. But the
4223480	4227180	idea is you handle the case where it's the .01 percent of
4227180	4230680	the time. The other trick you can of course do is what's
4230680	4234660	called having guard pages. So that means you have unallocated
4234660	4239400	space between allocations. This gets a little fat because now
4239400	4242020	you have to have 8 kilobytes used every time even if you have
4242020	4245980	like an 8 byte allocation. And that sort of sucks. But again,
4245980	4248940	you can do this probabilistically. You don't
4248940	4252360	always have to go ahead and make an exploit work. You just have
4252360	4255380	to make it a nightmare enough so the attacker never really knows
4255380	4259940	if this stuff is going to work or not. That is cheating. Good.
4259940	4264640	We get to cheat. We're defenders. Implementation wise,
4264640	4269000	this can be done entirely in user space. So, you know, you
4269000	4272620	manage memory in user space. You handle the exception when it's
4272620	4276560	unmapped. You populate it in the exception. It can be run in
4276560	4279980	the kernel because kernels are already managing page tables. I
4279980	4282180	don't object to doing this in the kernel. I don't object to
4282180	4285540	kernel modules. I'm willing to say the operating system needs
4285540	4289600	to adapt to the new needs of software. If I don't, you know,
4289600	4293280	right now to figure out what permissions are on a page in
4293280	4296100	Linux, you know, parse a freaking text file out of the
4296100	4302180	proc file system. We can be more efficient than that. Downsides
4302180	4305580	of Iron Heap. One, there's no code yet. Just some proof of
4305580	4310920	concepts. And two, it really does lean on 64 bit. And
4310920	4315580	browsers, particularly Flash, aren't entirely fantastic at 64
4315580	4319400	bit yet. This is true and it matters. People like their
4319400	4324640	freaking Flash. So, what may work today is a piece of
4324640	4327200	software that got really, I don't want to say popular, but
4327200	4332200	was being developed around 2007, 2008. A piece of code
4332200	4335000	called Die Hard. It's an interesting secure allocator
4335000	4338780	from Emery Berger over at UMass. It was an advanced ASLR
4338780	4342740	implementation without a band heat metadata. It's a long way
4342740	4346220	of saying when you allocate memory, it goes to hard to
4346220	4348200	predict pointers. You don't really know where it's going to
4348200	4351500	be and you don't have obvious things for you to corrupt.
4352240	4355060	Suppresses use after free in a way very similar to the
4355060	4360180	Microsoft allocators. So, you don't know when the memory is
4360180	4363720	actually free. It is eventually, but, you know, Internet
4363720	4366360	Explorer actually has a command that says run the garbage
4366360	4375000	collector now. Like, it's not so good. The big thing about Die
4375000	4378860	Hard is that they're available today. There's code for
4378860	4383340	Windows, there's code for Mac, there's code for Linux. Probably
4383340	4387360	worth exploring for tails. There's something different
4387360	4392520	about this stuff. So, when we have normal ASLR for like
4392520	4396060	loading libraries, we have what's called NX which means you
4396060	4399100	can't execute code that you throw into the stack or heap
4399100	4404120	somewhere. A lot of other defenses assume the corruption
4404120	4408800	has occurred and say now that it's occurred, let's make it
4408800	4414080	really tough to figure out what to do. What the end game is
4414080	4416880	that leads to arbitrary code execution. Yes, you've
4416880	4421160	corrupted but you don't have a path. And this class of defense
4421160	4425400	is different because you're actually preventing the initial
4425400	4431800	corrupting moment. If you don't have the free complete, the use
4431800	4436840	after free can never start. There is nothing going on in
4436840	4440680	infosec that is killing more O day than use after free
4440680	4444740	killers. You cannot imagine how many undiscovered bones are in
4444740	4447500	this space. I still remember the first time I wrote a fuzzer that
4447500	4452360	found these stuff. Come to work every morning, it's like, ooh,
4452360	4455800	look at all these, like dozens. Can I just say by the way,
4455800	4458640	whenever like people who actually write fuzzers hear
4458640	4464500	things like, and they used four O days. It's like, dude, I found
4464500	4469240	four O days at lunch. Like really, you get the pattern down
4469240	4476840	in quantity. So here's the plan, okay? IE has got a story around
4476840	4481420	use after free. Chrome has got a story around use after free.
4483080	4486520	Firefox has got some O day. Firefox needs a story around
4486520	4491260	memory hardening. So it's going to take some time and it's going
4491260	4493740	to be hard to convince them to give up their beautiful memory
4493740	4499700	allocator gem alloc. But we're going to put together an actual
4501240	4505280	strong secure allocator for production Firefox in the field
4505280	4507940	today. We're going to start by building this for the Tor
4507940	4511980	browser combinations, for the tails environment. We're going
4511980	4514440	to get it so that it is indistinguishable performance
4514440	4518940	wise from real native Firefox. It's not going to be me alone
4518940	4521880	doing this as a white ops project and I actually have
4521880	4526560	managed to recruit Dr. Emery Berger, creator of DieHard. We're
4526560	4529220	going to go ahead, we're going to get Firefox a heck of a lot
4529220	4541070	safer. So that's what we're up to. Dr. Berger actually came on
4541070	4545650	board about 80 minutes ago, so I'm really excited to be
4545650	4549690	announcing this. I'm like, dude, you want to join us? He's like,
4549690	4557030	hell yeah. So that's what we're going to do about browsers. Now
4557030	4560830	we've got to talk about DDoS. We're almost there. A little bit
4560830	4564950	left. Everyone having fun here? I know I'm nerding out like
4564950	4575900	crazy. All right. So we've got to talk about DDoS here because
4577100	4581480	the bad guys are filling up our pipes. Series of tubes getting
4581480	4589240	clogged here. We had all of 100 gigabit flood in 2013. We've had
4589240	4595940	like 114 in 2014, okay? Like the bad guys are making a mess of
4595940	4603500	things. I had assumed that DDoS had just turned into botnets. You
4603500	4606200	know, you've got millions of desktops, you fire them all on
4606200	4609280	some website, they all have full stacks, there's millions of
4609280	4615880	machines, life sucks. It turns out the biggest and ugliest of
4615880	4621220	the DDoS's are actually something else. They're not
4621220	4626120	using desktop machines, they're using DNS servers. That's my
4626120	4632360	protocol, dammit. Using NTP servers. They're lying about
4632360	4635480	their source address, they're pinging some machine on the
4635480	4638540	internet, they're causing those machines to reply to some poor
4638540	4643940	target and it is filling everything up. And I want to
4643940	4648860	take a minute to explain why this variation is quite so
4648860	4657340	damaging. So here's the deal. I am a terrible artist. But I've
4657340	4663660	tried to draw the internet. So what we've got here is you've
4663660	4667240	got some source and if you're going to go down one network
4667240	4669420	path you'll take the left fork and the other one you'll take
4669420	4675420	the right fork. It spreads out and eventually as you get closer
4675420	4678240	and closer to the destination there are fewer and fewer paths
4678240	4680980	and finally you're at the destination. Does that make
4680980	4685420	sense? Depending on where you go, you have a fan out and then
4685540	4691820	a fan in. Now if you're flooding a single destination, all your
4691820	4697180	traffic takes pretty much one route. It goes down, down, up,
4697180	4703040	up, down. And that's the one route 99.9% of your traffic is
4703040	4707820	going to take. So the most bandwidth you can consume is the
4707820	4713560	least bandwidth of any of these hops. But now, now let's say
4713560	4717060	we're going to reflect off of machines all around the
4717060	4722560	internet. What happens is, is that your traffic fans out in
4722560	4726620	all possible directions, hits all of these various name
4726620	4732020	servers, each of which has their own fastest route back to some
4732020	4735660	poor network. And I don't know if you can see it, but the
4735660	4741380	entire damn network is red. Boom. This is what's going on.
4741820	4745680	And it's ugly and it's not going away. So what are we going to
4745680	4749980	do? Are we going to lose our toy? I don't want to lose my
4749980	4754740	toy. I like my toy. I like my kitties on Roombas, damn it. So
4754740	4759360	what are we going to do? Ideally there's this thing called
4759360	4764560	BCP38. Ideally there's a technology called URPF. Ideally
4765360	4769080	networks couldn't lie. So you can't be in the middle of San
4769080	4774380	Francisco and be like, hey, I'm poor schlub in London and I want
4774380	4783360	this DNS supply. Yeah. I'm not saying that this is a bad idea.
4783360	4787540	I'm just saying there's a heck of a lot of networks out there
4787540	4792680	that don't give a crap about filtering routes. The
4792680	4796580	technology, I'm not saying it doesn't scale, but it totally
4796580	4800920	doesn't scale. Effectively the technology works by dropping
4800920	4804580	traffic. You know what ISPs don't like doing? Dropping
4804580	4807820	traffic. It fails once in the field. They're like, I'm never
4807820	4811460	turning this back on again. I'm not saying we shouldn't continue
4811460	4815760	to strive for BCP38 compliance. Some crazy paper came out a while
4815760	4820320	ago. They found at least 2,300 networks that don't have it. You
4820320	4824700	only get the real advantage of BCP38 when it's almost entirely
4824700	4829900	universal. Now, it's been a tremendous success for cable
4829900	4833580	modems, for DSL lines, even for a bunch of corporate
4833580	4839300	environments. But the really big pipes that are really able to do
4839300	4842860	huge reflection attacks, they're not getting secured anytime
4842860	4846860	soon. At least not if we can't bust them a hell of a lot
4846860	4851120	quicker. So, I'm going to bust them. Here's what we're going to
4851120	4856140	do. We're going to bring back an old idea called stochastic
4856140	4860520	tracing. I did not come up with this idea. Maybe I've refined it
4860600	4864760	a bit. First heard this idea about 12 or 13 years ago. And
4864760	4869340	the idea is you've got a router and one out of maybe a million
4869340	4874340	packets, it says, hi, I'm this router and I routed some
4874340	4878240	traffic to you. Doesn't do anything for your standard
4878240	4881280	normal flows. But if you've got a router that's being made to
4881280	4884200	move billions and billions of packets, you're going to end up
4884200	4888260	with a nice stream of hundreds and hundreds of tracers. And
4888260	4892580	these things actually incrementally improve the
4892580	4896400	internet over time. Because there's more and more traces and
4896400	4899420	it's harder and harder for an attacker to know whether or not
4899420	4902640	their spoofed traffic is going to be quickly detected back to
4902640	4908300	them. As it happens, routers have most of the technology
4908300	4911830	necessary to already do this. It's very simple to configure a
4911830	4915570	router to do what's called a GRE stream. To say, please send
4915570	4919470	me one out of every million packets. That can go to an
4920010	4922690	individual daemon, we don't need to patch the router for God's
4922690	4926990	sake. We can go to a daemon, the daemon can go ahead and send
4926990	4930250	this trace packet. What does it actually mean to send a trace?
4930410	4934230	Because by the way, I don't want random people on the internet
4934710	4937150	knowing all the traffic that I'm receiving. I don't even want
4937150	4941750	them knowing my DDoFs. So the idea is the traces go to the
4941750	4947810	destination of the flows. And maybe the source. There are only
4947810	4951930	two IPs that are really supposed to be seeing traffic and it's
4951930	4955850	the source and destination IP. So if you're spoofing traffic, I
4955850	4958930	don't think you have an expectation of privacy for the
4958930	4962690	network to hide that you are lying about being the guy in
4962690	4966550	London. What does the payload actually look like? That's a
4966550	4969870	good question. Do we encapsulate this in ICMP? Do we make an HTTP
4969870	4974210	post? I don't know. All I know is if you're on the internet,
4974210	4977390	you're already receiving crap. I know this because I'm sending
4977390	4985790	you crap. And you haven't crashed yet, I think. There's an
4985790	4989210	alternate option. This of course comes back to my own history in
4989210	4996130	DNS. Sometimes it's a pain in the butt to hijack, say, all the
4996130	4999590	trace traffic that's coming out of ICMP to an IP or HTTP to an
4999590	5004530	IP. That might actually be hard. There's a space called reverse
5004530	5014230	DNS. 4.3.2.1.inattr.arpa can say my DNS name is blahblah.foo.com
5014230	5019470	with what's called a PTR record. You can actually host more than
5019470	5023710	just PTR records inside of reverse DNS. So you could host
5023710	5027730	something that actually says, yeah, I know you're trying to
5027730	5033170	do tracing for 1.2.3.4. Here's the server that accepts those
5033170	5037310	trace packets. And it's still trust associated with the IP.
5037310	5041870	It's very nice. Obviously we want to assign trace payloads.
5041870	5044330	Otherwise you can spoof a whole bunch of things and be like,
5044330	5048410	yeah, I'm totally Verizon moving all this traffic. Go harass
5048410	5051770	Verizon. So we've got to prevent that and we can do that with
5051770	5058230	ED25519 keys. So that can work. The long term vision is to
5058230	5062790	reduce the time between a DDoS and tracing the involved
5062790	5067450	networks. We've got to make this stuff happen faster. Ultimately
5067450	5070830	what we need to do is we need to get to the point where DDoS is
5070830	5075210	automatically suppressed. Where there can be firewall rules that
5075210	5079710	are automatically applied. Now this is rough. Because there's a
5079710	5082950	lot of hops that are going to see enough to be able to request
5082950	5087290	firewalling. So I don't know exactly how this works. But what
5087290	5091530	I do know is that these floods are growing fast enough and nasty
5091530	5095830	enough that we may actually get the greatly feared congestion
5095830	5100950	collapse. There may actually be entire countries, entire regions
5100950	5104310	of the globe that just have too much traffic for anything to
5104310	5108670	work. And I think Paul Vixen would kill me if I didn't say,
5108670	5111230	by the way, you know, we can, like, patch name servers. We
5111230	5115090	don't participate in this anymore. Call RRD. But
5115090	5120570	unfortunately it requires so many hosts to upgrade versus this
5120570	5125550	kind of stuff which is just incrementally improving. So
5125550	5129850	let's talk about practically the last thing I wanted to discuss
5129850	5133350	in this epically long talk today. I don't know why I said I
5133350	5137050	wanted a two-hour talk. Am I trying to kill myself here? All
5137050	5142950	right. Can't just not talk about this whole NSA thing. Can't
5142950	5151830	just leave it to Bruce Schneier. I love Bruce. I'm worried. I'm
5151830	5157070	worried about the long-term reaction to the NSA revelations.
5157090	5163230	See, there are two ways that you can win in technology. You can
5163230	5168850	have the better technology or you can have FUD. Oh sure, you
5168850	5172270	can go with that competitor. They're cheaper, faster, nicer,
5172270	5177010	more powerful, but ooga booga nation state. This sounds
5177010	5180930	ridiculous until you realize there really are proposals to go
5180930	5184670	ahead and keep all traffic within a country within a
5184670	5188930	country. This is really, sure BGP says this route is faster,
5188930	5191750	better, easier, but the law says you have to keep it within our
5191750	5198490	borders where we can monitor it all. Thank you very much. The
5198490	5201690	Internet, again, was not the first time we tried to make the
5201690	5204730	Internet. It was the first one that worked at large scale
5204730	5209570	because you didn't have this sort of political interference.
5209950	5213450	This was the network made by nerds who had one thing they
5213450	5217010	wanted which was make this work, make this work as fast as
5217010	5220970	possible. And a lot of these political actors have a
5220970	5225330	different goal in mind. You know, we didn't want the
5225330	5230090	Chinese Internet or the Iranian Internet before Snowden. I hope
5230090	5234590	we don't want that now. But I look out there and I look at the
5234590	5241350	reactions to the NSA and especially their manipulation of
5241350	5245250	crypto standards and there really is only one thing I can
5245250	5253010	think. You maniacs! You finally did it! You blew it all up! Damn
5253010	5270070	you to hell! Let me tell you the honest truth about cryptography.
5270070	5274410	And if you don't know, the NSA pushed and got a broken crypto
5274410	5278890	standard into, well, they wanted to have everyone use it but
5278890	5287390	really they only screwed other feds. There's a reason we were
5287390	5291210	asking the NSA's advice for cryptographic vulnerabilities.
5291210	5297290	Okay? Most crypto functions do not need the NSA's help to suck.
5297290	5305690	They get that for free. Okay? It takes like 10 years to figure
5305690	5311350	out that a cypher or a hash or whatever might actually be safe.
5311830	5317810	And the NSA has actually been pretty good at saying, something's
5317810	5321770	wrong here. This thing in Ness, it's not good. This thing in
5321770	5338380	Shaw Zero, it's not good. Excuse me, I'm out. You know, it sucks.
5338380	5342800	Wouldn't it be nice if we had like a department of the
5342800	5349120	government that was dedicated to defense? Like a department of
5349120	5361070	defense? They could have like a conference, like a DEF CON. What's
5361070	5365570	happening is that even good advice is being treated with deep
5365570	5370750	suspicion. NIST is like, hey, yeah, we standardized on this
5370750	5374510	Kessack algorithm, but wow, Shaw 3 is slower than Shaw 256 in
5374510	5378730	performance patterns. And, you know, this is not a
5378730	5384370	controversial opinion. Zuko of Tahoe LFS is like, hey, Kessack
5384370	5388290	is too slow in performance patterns. The community is like,
5388290	5393170	NIST, NIST is evil. NIST is doing more evil. They got NSA pulling
5393170	5397830	their strings. And what's the end result? We are totally
5397830	5406890	replacing NIST with DJB. With some guy. Now, I want to be
5406890	5412230	clear, I'm an enormous DJB fan. I've been advocating curve 25519
5412590	5417150	for using TLS replacing protocol for literally like half a
5417150	5422190	decade. But fewer trusted resources in a time of great
5422190	5425930	need, not actually helpful. There's that great quote, Linux
5425930	5434770	scales, Linux does not scale. I have a graph. And this graph
5434770	5444980	explains the problem very clearly. The NSA has two
5444980	5452340	missions. DJB pretty sure only has one. This is what's going on
5452340	5458000	here, okay? Like sometimes one of these guys finds a bug and
5458000	5466700	says, cool. And it's not DJB. So we're all kind of waiting for
5466700	5471860	the other shoe to drop. Not implementers. If you've noticed,
5471860	5476200	pretty much everything new that comes out just uses DJB sec. Like
5476200	5481580	his stuff is one. Everything new is, you know, 25519 or, you know,
5481580	5486880	bad ass or libsodium. His stuff has won the day with implementers.
5489080	5492780	There's what's called epistemology. There's how do you
5492780	5496320	know what you know. Academics aren't really allowed to know
5496320	5499440	things without some degree of evidence. This is kind of a
5499900	5503980	barrier to a lot of FUD and BS. This is kind of the heart of
5503980	5508660	science. We do know that dual ECDPRG is bad. We have hard
5508660	5513300	evidence, we have math and so on. But there's another shoe.
5513300	5517320	And that shoe is what's called the NIST P curves. There's this
5517320	5520120	great technology, it's called elliptical curves. Elliptical
5520120	5524320	curves requires parameters. There are two major sets of
5524320	5528160	parameters that came out of NIST. The P curves and the K
5528160	5532740	curves. We know exactly how the K curves were constructed. You
5532740	5536020	take this value that comes from a mathematical function, you put
5536020	5538840	it in what's called a nothing up your sleeve generator to show
5538840	5541820	there's nothing up your sleeve. And now you have your
5541820	5545060	parameters and everything is good. And then there's the P
5545060	5549340	curves where that thing that's going into the nothing up your
5549340	5557520	sleeve generator is C493608 dot, dot, dot. Every shirt has two
5557520	5564480	sleeves. I'm not saying we know that the P curves are
5564480	5568640	compromised. However, if you don't plan on the P curves being
5568640	5573820	compromised, you're an idiot. And you should get fired. And in
5573820	5578700	fact, that's pretty much what all implementers have realized.
5578700	5581660	One of probably the most interesting things about
5581660	5586660	Bitcoin is a long time ago they said, yeah, this P curve stuff
5586660	5591000	is garbage, let's go with the K curves. So this is something
5591000	5595760	that everyone is sort of waiting for. It's not like we know it.
5595780	5602060	But we know it. The larger issue is it's not like crypto worked
5602060	5606000	particularly well before the NSA con revelations, okay? The hard
5606000	5609180	problems in crypto actually aren't the math. They're
5609180	5612360	actually not even the implementations, although GPGG are
5612360	5617320	gone inside. Key management is the hard part because this is
5617320	5621240	what actually touches users and organizations. We keep modeling
5621240	5624440	cryptography as math and implementation but there's a
5624440	5628340	complexity that goes unnoticed and that's operations, okay? Every
5628680	5634820	project in the real world, who here works in IT? Okay? Tell me
5634820	5639480	I'm wrong when I say every project needs to be measured only
5639480	5641960	in terms of how many god damn meetings you need to do in order
5641960	5652050	to complete it. That is the metric. When is the last time
5652050	5655350	you saw a meeting count measured in anything to do with
5655350	5659010	cryptography? When's the last time you saw crypto work in the
5659010	5664290	field? Not an unrelated thing. We have to learn to respect
5664290	5669310	usability, we have to learn that this isn't the operational
5669310	5672610	requirement. Over at Black Hat, one of the most significant
5672610	5676790	announcements in some time happened. Somehow Alex Stamos,
5676790	5681710	one of the founders of ISAC, got root at Yahoo. I don't know how
5681710	5685070	he did it but he's like, you know what? We're going to do end
5685070	5696420	to end PGP for Yahoo freaking mail. Sweet! Because you know
5696420	5700740	what? Google might understand user experience but Yahoo really,
5700740	5706020	really understands it. So, summary of what we've talked
5706020	5709600	about today. We're almost done here. Don't let an attacker
5709600	5713700	touch your storage. Let it store, let it execute, don't let
5713700	5718560	it do both. Actively gather true entropy. Death to non
5718560	5723260	cryptographically secure PRNGs. Please, for the love of God,
5723260	5727820	represent entropy in a way other than bit vomit. Browsers become
5727820	5731100	vastly more secure once use after free is prevented and we
5731100	5736060	are going to fix this in Firefox. The NSA crypto fallout
5736060	5739940	continues. It hasn't gone away. There's been a wholesale
5739940	5745760	movement to, while I'm a fan of the guy, he's a guy. He's a
5745760	5750520	professor at UIUC. Yahoo's PGP news is fantastic. One of the
5750520	5754220	most significant things of the year. Maybe of a couple years.
5754220	5760980	And, just because I can, just one more thing. I totally get
5760980	5768180	to pull this. It's Apple related. Apple went ahead and
5768180	5772900	put into their latest release notes for iOS 8, Safari now
5772900	5776580	blocks ads from automatically redirecting to the app store
5776580	5780380	without user interaction. If you still see the previous behavior
5780380	5783080	or find legitimate redirection to the app store to be broken in
5783080	5791100	some way, please file a bug. Yes. Okay? I am tired of
5791100	5794640	browsing something on my phone and it's like, I know you're
5794640	5797100	trying to browse this website but what I really think you
5797100	5803800	want to do is pay money to Kim Kardashian. No. That is not what
5803800	5808200	I want to do. Fuck those guys. Apple wants help, let's give it
5808200	5816590	to them. Now, I talked about this on Twitter before and I
5816590	5820090	said, hey, I'll give you 250 bucks. Screw that, I got a
5820090	5822990	company. I'll give you five fricking grand for the first
5822990	5825930	person to go ahead and give Apple some bugs they can fix. I
5825930	5830550	want to see this dead off the mobile internet, okay? I've
5830950	5834070	become a believer in bug bounties. This is a complete 180
5834070	5838350	on my old position. I used to think that bug bounties would
5838350	5842790	lead to crappy bugs and people being idiots and demanding money
5842790	5847550	anyway and it would just be cheaper to pay them off. You
5847550	5851670	can't imagine how crappy bugs are that come in from the
5851670	5855230	outside world sometimes. People have no idea how stuff works and
5855230	5861410	they think they're geniuses. But I was wrong. I'm telling you
5861410	5865870	this. I've seen the results firsthand. If you want richer
5865870	5869570	bugs from the outside world, maybe you should make bug
5869570	5874150	finders richer. Turns out that when you actually have a sample
5874150	5878110	of good bugs you can pay for, you can now be like, yeah, we
5878110	5883210	paid for the good bug, your thing is crap. So we're not just
5883210	5886470	doing 250 bucks, we're going to give $5,000 to the first finder,
5886470	5890610	2,500 to the second, 1,000 to maybe the next five. If we get
5890610	5893050	more, we might keep throwing more money at this. I don't know
5893050	5899450	how many bugs there are. But we believe in A, this sort of
5899450	5903090	behavior is toxic. It destroys the mobile web. It is some of
5903090	5905330	the worst stuff we see in advertising. And I run a
5905330	5911250	company that fixes advertising. This is still offensive. And I
5911250	5914490	think hackers can fix things and I'm willing to put my money
5914490	5919570	where my mouth is. So thank you all. This has been a blast.
