00:00:00.000 --> 00:00:05.839 hi, well Hello, Def Con. It's nice to be back. Thank you very 00:00:05.839 --> 00:00:12.713 much for showing up. And welcome to crypto for hackers. A cool 00:00:12.713 --> 00:00:18.585 little talk I put together. It's in our moments of greatest 00:00:18.585 --> 00:00:22.856 weakness that we define ourselves as individuals. This 00:00:22.856 --> 00:00:26.426 is something that I said years ago, to a colleague of mine at 00:00:26.426 --> 00:00:30.230 American express when I was in charge of their security 00:00:30.230 --> 00:00:37.237 portfolio. The executive VP team had decided not to strengthen 00:00:37.237 --> 00:00:42.276 our password policy because it would have increased our costs 00:00:42.276 --> 00:00:48.215 too much. The sad thing is, it was cheaper just to pay out in 00:00:48.215 --> 00:00:53.553 lawsuits and insurance premiums when our customer data was 00:00:53.553 --> 00:00:58.258 hacked. Now, this is one of many real-world scenarios that we 00:00:58.258 --> 00:01:02.262 face in our modern Internet. This is the world we live in. 00:01:02.262 --> 00:01:05.499 And this is exactly the way of thinking that caused so many 00:01:05.499 --> 00:01:11.505 problems. But times are changing and there are those of us who 00:01:11.505 --> 00:01:16.510 think differently. Those of us who are at war with this 00:01:16.510 --> 00:01:20.514 establishment. Governments and corporations continue to support 00:01:20.514 --> 00:01:24.985 legislation that revocation our personal rights. Our every 00:01:24.985 --> 00:01:30.390 action is monitored, and our every intention is scrutinized. 00:01:30.390 --> 00:01:33.927 As each year passes, we lose more of what it means to be 00:01:33.927 --> 00:01:37.664 free. The ability to share information is one of our most 00:01:37.664 --> 00:01:41.501 basic and fundamental rights. Without this, there is no 00:01:41.501 --> 00:01:45.605 privacy, there is no freedom of expression, and no ability to 00:01:45.605 --> 00:01:50.744 hold rogue agencies accountable for their unlawful activities. 00:01:50.744 --> 00:01:53.914 As long as governments and corporations can eaves drop on 00:01:53.914 --> 00:01:58.552 our communications, we live in a constant state of fear. But we 00:01:58.552 --> 00:02:02.689 have the power to change the future. We are hackers, we are 00:02:02.689 --> 00:02:06.259 programmers, we are members of the info sect community and we 00:02:06.259 --> 00:02:10.397 are strong and we are smart. We are far smarter than they are, 00:02:10.397 --> 00:02:16.470 and this what makes them afraid, this is what scares them. Ladies 00:02:16.470 --> 00:02:19.906 and gentlemen, I would like to introduce you to a very dear 00:02:19.906 --> 00:02:25.012 friend of mine. He's a business partner as well. He's a 00:02:25.012 --> 00:02:27.981 visionary in the field of information security and 00:02:27.981 --> 00:02:32.819 privacy. Truly a man who needs no introduction. My good friend, 00:02:32.819 --> 00:02:38.825 the one and only, Mr. John McAfee. (Applause.) Now, there's 00:02:44.164 --> 00:02:50.170 a rumor going around the goons that John and I might be up on 00:02:52.639 --> 00:02:56.043 stage doing a shot together with some goons. So goons, is that 00:02:56.043 --> 00:03:03.216 just a rumor? Sorry, I think I threw of timing. Sorry about 00:03:03.216 --> 00:03:09.056 that. So it's not a rumor. All right. So welcome, proctor, an 00:03:09.056 --> 00:03:13.193 awesome goon who has some alcohol for us. (Applause.) >> 00:03:13.193 --> 00:03:19.199 Shut this whole thing down. This is not secure. >> I am really 00:03:26.039 --> 00:03:30.877 John Smith. No relation to the McAfee that just got out of jail 00:03:30.877 --> 00:03:36.883 the other day. >> Sir, are you a new speaker at Def Con. >> I'm 00:03:40.287 --> 00:03:42.789 afraid I am. >> And what do new speakers do? >> That was a lie. 00:03:42.789 --> 00:03:48.795 I actually keynoted last year. >> He insisted on doing water. 00:04:01.341 --> 00:04:03.343 >> To Def Con! (Applause.) Are we really doing a selfie? Is 00:04:03.343 --> 00:04:05.345 that what's happening? >> I am very proud, by the way today to 00:04:05.345 --> 00:04:11.351 be standing on stage with Eijah. I noticed Eijah at hack Miami, 00:04:45.719 --> 00:04:48.922 he seemed to have no life whatsoever. >> That's true. >> 00:04:48.922 --> 00:04:51.424 Which is absolutely true. >> Absolutely. >> Which is 00:04:51.424 --> 00:04:55.028 indicative of a man who is dedicated to the work that he is 00:04:55.028 --> 00:04:58.932 doing. And I have never seen a more dedicated programmer than 00:04:58.932 --> 00:05:02.536 the man standing next to me. What he's going to talk to you 00:05:02.536 --> 00:05:05.105 about today is something radically new, social 00:05:05.105 --> 00:05:08.742 encryption, which to me is the closest thing to electronic 00:05:08.742 --> 00:05:12.279 magic that I have ever seen. You'll be talking about that, 00:05:12.279 --> 00:05:14.848 right? >> Absolutely, sir. >> I'm on the right stage. >> The 00:05:14.848 --> 00:05:18.318 last 15 minutes we'll talk about social crypto, yeah. >> Good. 00:05:18.318 --> 00:05:22.889 And trying to get in touch with this man is the most difficult 00:05:22.889 --> 00:05:26.059 thing in the world. He never answers the phone but if you 00:05:26.059 --> 00:05:29.196 call him at 3:15 in the morning, at 3:17 you'll get an answer. I 00:05:29.196 --> 00:05:35.202 think the demonsaw project which is under the umbrella of future 00:05:41.374 --> 00:05:45.378 tense now is one of my favorite projects and I think it's going 00:05:45.378 --> 00:05:48.415 to change the way that we communicate, the way that we 00:05:48.415 --> 00:05:52.352 look at data and it's going to give us a degree of privacy 00:05:52.352 --> 00:05:58.258 which I personally need, and I think all of you do as well. 00:05:58.258 --> 00:06:00.727 Without further adieu I'm going to give this back to the man of 00:06:00.727 --> 00:06:04.531 the hour. Thank you for inviting me on stage. >> You're welcome. 00:06:04.531 --> 00:06:10.537 Thank you, sir. (Applause.) These mics are not hug friendly. 00:06:17.911 --> 00:06:19.913 Just FYI >> John, thank you very much. That was a kind 00:06:19.913 --> 00:06:25.919 introduction. I may have screwed this up. So what I want to do, 00:06:29.990 --> 00:06:34.494 before I start about crypto for hackers, because I think this is 00:06:34.494 --> 00:06:39.032 an exciting 101 talk and thank you for packing the room. I love 00:06:39.032 --> 00:06:42.502 being here at Def Con, I love speaking and if anyone wants a 00:06:42.502 --> 00:06:47.707 beer, once this talk is over, my schedule frees up and my stress 00:06:47.707 --> 00:06:51.311 level drops like 4 --> 000%. I would love to have a beer with you and 00:06:51.311 --> 00:06:56.583 just chat about anything. About why blue is a better color than 00:06:56.583 --> 00:07:00.654 red. It doesn't matter. We can talk. One thing I want to point 00:07:00.654 --> 00:07:06.126 out is John and I had a crazy, a pretty fucking crazy idea a few 00:07:06.126 --> 00:07:10.597 weeks ago. We thought let's throw the biggest, awesome party 00:07:10.597 --> 00:07:13.633 at Def Con that has ever happened. Can we do it in just a 00:07:13.633 --> 00:07:15.969 couple of days? So in a couple of days we pulled together this 00:07:15.969 --> 00:07:23.677 party. There's an eventbrite link. We can have up to 5 --> 000 00:07:23.677 --> 00:07:28.048 people before hustler's strip club is in violation of fire 00:07:28.048 --> 00:07:35.488 code. I think we're at least 1,500, almost 2 --> 000 now. So go 00:07:35.488 --> 00:07:39.059 there, sign up. It's a free party tonight at 10:00 p.m. and 00:07:39.059 --> 00:07:42.062 there's free buses, free limo service from Bally's. All the 00:07:42.062 --> 00:07:44.431 information is on Def Con parties, all the information is 00:07:44.431 --> 00:07:48.168 on demonsaw. We would love for you to show up. There's going to 00:07:48.168 --> 00:07:56.076 be some free beer. Have you to take the bus and the limo. Some 00:07:56.076 --> 00:07:58.912 sort of contractual agreement, but there's a number we'll tweet 00:07:58.912 --> 00:08:05.885 out for free limo pickup. Show up, party with us. We've rented 00:08:05.885 --> 00:08:09.589 out the entire roof top floor once the free booze runs out, 00:08:09.589 --> 00:08:15.395 about 20 minutes, it will be $5 beers and $5 shots for the whole 00:08:15.395 --> 00:08:19.666 not. Not $12 strip club prices. We negotiated that just for you 00:08:19.666 --> 00:08:27.307 guys. And it will be awesome. All right. Enough about that. 00:08:27.307 --> 00:08:30.377 Oh, also, if you want to get a picture with John or a picture 00:08:30.377 --> 00:08:33.713 with me, the place to do that is at that party. There's a lot of 00:08:33.713 --> 00:08:36.216 people here, it's a little congested and some safety 00:08:36.216 --> 00:08:40.553 issues. We ask that you don't come up to John after this. But 00:08:40.553 --> 00:08:45.191 at the party we're going to be there as long as you guys will 00:08:45.191 --> 00:08:47.827 be there. If you want a picture with John or me, we'll totally 00:08:47.827 --> 00:08:50.930 do it at the party. So who am I? My name is Eijah. Is that my 00:08:50.930 --> 00:08:56.936 real name? It's my real name here. I'm a founder of demonsaw 00:09:01.174 --> 00:09:07.180 which is a new type of platform. It is a brand new type of 00:09:14.421 --> 00:09:16.556 information sharing platform that allows you to share your 00:09:16.556 --> 00:09:19.526 files securely and allows you to share your communications 00:09:19.526 --> 00:09:22.762 securely, chat securely, share securely, there's no 00:09:22.762 --> 00:09:25.932 infrastructure, there's no peer-to-peer. It's a little bit 00:09:25.932 --> 00:09:31.938 of tor, a little bit of drop box, it works, it's secure and 00:09:34.207 --> 00:09:41.047 there's no infrastructure. I don't log, I don't track, 00:09:41.047 --> 00:09:45.919 there's no ads. I don't make any money. I do it, I work 100-hour 00:09:45.919 --> 00:09:50.924 weeks just to make something that we can protect our privacy. 00:09:50.924 --> 00:09:55.462 I get nothing out of it except knowing that we're secure. I'm 00:09:55.462 --> 00:09:59.466 also a senior programmer at rock star games. So yes, I have just 00:09:59.466 --> 00:10:03.736 outed myself right here at Def Con 23. I'm a senior programmer 00:10:03.736 --> 00:10:08.074 and I worked on grand theft auto 5 and I worked on max Payne 3. I 00:10:08.074 --> 00:10:11.811 lived in Europe for almost a year. John was very kind in his 00:10:11.811 --> 00:10:16.716 words. I've been a programmer for a long time. I'm passionate 00:10:16.716 --> 00:10:21.387 about code and I'm passionate about hacking. And I'm also a 00:10:21.387 --> 00:10:25.825 part-time hacker in my free time. My lawyer told me that I 00:10:25.825 --> 00:10:31.064 should preface the next phrase with I may or may not have been 00:10:31.064 --> 00:10:35.802 involved with the original Blu-Ray hack where the device 00:10:35.802 --> 00:10:40.540 keys were released to the world. So I may or may not have been 00:10:40.540 --> 00:10:45.044 Atari vampire a few years back. So now my lawyer will be happy. 00:10:45.044 --> 00:10:49.816 So obviously I'm somebody who's obsessed with security, somebody 00:10:49.816 --> 00:10:56.523 who's obsessed with privacy. Last year at Def Con I spoke 00:10:56.523 --> 00:10:59.993 about the modern Internet and our privacy was at risk for 00:10:59.993 --> 00:11:07.166 convenience. This year, rather than focus on the sad, dark 00:11:07.166 --> 00:11:10.470 times we've seen ourselves thrown into, I'd like to talk 00:11:10.470 --> 00:11:15.742 about the future and what we can do to regain control and change 00:11:15.742 --> 00:11:18.444 our future. Because everything in this talk is about 00:11:18.444 --> 00:11:23.616 empowerment of the individual and making us stronger. I have a 00:11:23.616 --> 00:11:26.853 shirt on, you'll see what it says in a few minutes and I'll 00:11:26.853 --> 00:11:31.724 be giving a bunch of these away today. But as the weeks went on 00:11:31.724 --> 00:11:35.261 last year, I started thinking more about the role of crypto, 00:11:35.261 --> 00:11:38.398 that it plays in secure communications and I thought 00:11:38.398 --> 00:11:41.701 about how traditional security was based around the 00:11:41.701 --> 00:11:44.804 infrastructure. So if you think about the traditional security 00:11:44.804 --> 00:11:49.075 model that we've had for 30, 40-plus years, it's based around 00:11:49.075 --> 00:11:52.345 authorities and trust. It's based around these trusted 00:11:52.345 --> 00:11:59.052 nodes, call them key stores or authoritative sources or 00:11:59.052 --> 00:12:01.888 certificate authorities or identity providers or whatever 00:12:01.888 --> 00:12:05.124 you want to call them, all of that they can be called. But 00:12:05.124 --> 00:12:08.428 it's these pieces of hardware and software that we trust for 00:12:08.428 --> 00:12:12.498 some reason. And when we want to authenticate or authorize, we 00:12:12.498 --> 00:12:15.702 access these nodes that verify our identity. This model of 00:12:15.702 --> 00:12:21.708 trust is not ideal and not scaleable for social networks 00:12:24.110 --> 00:12:29.282 and for individual sharing. It just doesn't work. PKI and 00:12:29.282 --> 00:12:33.119 strong crypto is just too difficult. Exchanging billions 00:12:33.119 --> 00:12:37.323 of keys to securely communicate in a large group is too much 00:12:37.323 --> 00:12:40.827 work and even key stores don't solve this problem. It's painful 00:12:40.827 --> 00:12:45.031 to be secure in our modern age. Crypto is hard. It shouldn't be 00:12:45.031 --> 00:12:50.536 that way. So becoming powerful again, and empowering individual 00:12:50.536 --> 00:12:55.942 really starts with making crypto easy. Now, I want to talk just 00:12:55.942 --> 00:12:58.945 for a second about what our world would look like without 00:12:58.945 --> 00:13:04.484 secrets. Imagine a world where we didn't have privacy. What 00:13:04.484 --> 00:13:08.021 would that look like? Well, remember at our core, each one 00:13:08.021 --> 00:13:11.758 of us are individuals. And we wrap this individual core in 00:13:11.758 --> 00:13:15.662 layers of social networks. But when it comes down to it, we're 00:13:15.662 --> 00:13:18.297 still individual people and we still have dark secrets that we 00:13:18.297 --> 00:13:22.068 want to protect. So a world without secrets would be an 00:13:22.068 --> 00:13:25.371 extremely dangerous place. It would be fragile where 00:13:25.371 --> 00:13:29.409 everything is known about everybody. Even the most facts 00:13:29.409 --> 00:13:33.046 of disobedience would be dealt with in other ways. There would 00:13:33.046 --> 00:13:40.486 be no freedom, no joys, nothing to live for. It would be dismal 00:13:40.486 --> 00:13:44.090 and bleak. Society would crumble and our existence would be 00:13:44.090 --> 00:13:47.193 meaningless. Those are pretty dark statements, right? But if 00:13:47.193 --> 00:13:51.297 you really think about secrecy and privacy, we cannot survive 00:13:51.297 --> 00:13:59.205 without privacy. So crypto is our strongest weapon. It was 00:13:59.205 --> 00:14:03.242 considered a military weapon in the U.S. until 1992. By the way, 00:14:03.242 --> 00:14:05.745 this is Picari. It's called a peak a boo face palm. It's 00:14:05.745 --> 00:14:11.751 really bad face palm. So crypto can be used as both an offensive 00:14:16.989 --> 00:14:22.061 and defensive weapon. We can focus our attacks and we can 00:14:22.061 --> 00:14:27.233 protect our assets. Poor crypto implementation as in the case of 00:14:27.233 --> 00:14:31.504 the AACS hacks a few years back can totally ruin a specification 00:14:31.504 --> 00:14:36.109 a protocol, a company or even an app. There's been a lot of news 00:14:36.109 --> 00:14:41.781 lately in the UK and U.S. about very foolish individuals like 00:14:41.781 --> 00:14:44.617 David Cameron, the prime minister of the UK. Foolish man. 00:14:44.617 --> 00:14:50.623 There's also another guy who doesn't get it. James, the FBI 00:14:55.762 --> 00:15:01.567 director. Both of these gentleman have advocated either 00:15:01.567 --> 00:15:06.272 for decreasing the amount of encryption or providing backdoor 00:15:06.272 --> 00:15:11.944 access to the feds. To be honest -- I'm being facetious. The feds 00:15:11.944 --> 00:15:16.482 never make a mistake with respect to crypto. It's not like 00:15:16.482 --> 00:15:22.522 21 million records have just been leaked in an OPM recently, 00:15:22.522 --> 00:15:25.525 right? We can't trust the feds to protect our stuff. We have to 00:15:25.525 --> 00:15:32.398 take control and be authoritative. Technology has 00:15:32.398 --> 00:15:38.404 always been the deciding factor between survival extinction. 00:15:40.406 --> 00:15:44.243 This is still true today. Governments and corporations 00:15:44.243 --> 00:15:46.512 have one fatal weakness. They are not us. They are not 00:15:46.512 --> 00:15:49.415 programmers, they are not hackers, they do not adapt well 00:15:49.415 --> 00:15:54.120 and quickly to change. We do. So technology is on our side, 00:15:54.120 --> 00:15:58.724 favoring those who embrace it most. Today we have the capacity 00:15:58.724 --> 00:16:00.927 and the ability to be greater than governments and 00:16:00.927 --> 00:16:04.297 corporations, and this is what makes them afraid. This is what 00:16:04.297 --> 00:16:07.533 scares the shit out of our government and the UK government 00:16:07.533 --> 00:16:11.504 and corporations. Because they no longer are the powerful ones. 00:16:13.573 --> 00:16:18.845 So the people will win in the end through hackers and 00:16:18.845 --> 00:16:24.183 programmers and people like us. I was thinking about a battle 00:16:24.183 --> 00:16:28.487 cry for our hacker generation. I call this group here the hacker 00:16:28.487 --> 00:16:31.791 generation. I'm not sure, I don't know if I coined that. I 00:16:31.791 --> 00:16:34.961 just view us as the hacker generation, maybe generation X, 00:16:34.961 --> 00:16:37.897 maybe millennials, maybe baby boomers, we need a mantra, a 00:16:37.897 --> 00:16:42.869 battle cry to let the feds and corporations know how we feel 00:16:42.869 --> 00:16:50.509 and what we're doing. So I came up with that and printed it on 00:16:50.509 --> 00:16:57.583 the back of 150 demonsaw shirts. Here it is. My shit, my way, 00:16:57.583 --> 00:17:03.522 fuck off NSA. What do you think? That's it. (Applause.) This is 00:17:06.759 --> 00:17:13.366 the battle cry of our hacker generation. This is who we are. 00:17:13.366 --> 00:17:17.803 And so a talk about crypto for hackers should involve some 00:17:17.803 --> 00:17:21.974 crypto, right? So what we're going to do, now that I got you 00:17:21.974 --> 00:17:27.480 excited about getting a T-shirt. If I get really drunk, the 00:17:27.480 --> 00:17:29.749 chances of me giving them all out within five minutes are 00:17:29.749 --> 00:17:32.585 very, very high. Almost a probability of one. So at the 00:17:32.585 --> 00:17:35.521 party I could very well give you my entire backpack full of 00:17:35.521 --> 00:17:37.957 T-shirts. That has happened before. So let's talk about 00:17:37.957 --> 00:17:45.932 Edward Snowden once said encryption is the defense 00:17:45.932 --> 00:17:49.101 against the dark arts. What that means in layman's terms, crypto 00:17:49.101 --> 00:17:53.205 will set us free. I come from a very strong religious background 00:17:53.205 --> 00:17:59.211 years and years ago. But when I grew up in church they talked 00:18:02.248 --> 00:18:05.184 about different things setting us free. As I grew into an 00:18:05.184 --> 00:18:07.753 adult, I realized there's very few things at all that will set 00:18:07.753 --> 00:18:13.359 us free. I think we can set ourselves free, but I also think 00:18:13.359 --> 00:18:16.662 from a technology standpoint, crypto will set us free from an 00:18:16.662 --> 00:18:21.133 infosect perspective. So there's a few terms we're going to talk 00:18:21.133 --> 00:18:25.271 about. I'm not going to review them all just because of lack of 00:18:25.271 --> 00:18:29.575 time here, but we're going to -- these are keywords that 00:18:29.575 --> 00:18:32.478 cryptography. What does that mean? It's such a big word. 00:18:32.478 --> 00:18:37.917 People abbreviate it as crypto. It's a fancy word for just 00:18:37.917 --> 00:18:43.189 describing, the practice and study of techniques for secure 00:18:43.189 --> 00:18:46.325 communication in the presence of third parties. That's still kind 00:18:46.325 --> 00:18:48.995 of geeky. What does it really mean? I want to share 00:18:48.995 --> 00:18:52.465 information to one of you or many of you out there. And I 00:18:52.465 --> 00:18:56.002 don't want to know about it or either know about it or tamper 00:18:56.002 --> 00:19:01.140 with it or do anything or replay it or extend it or anything 00:19:01.140 --> 00:19:08.581 that's going to alter or somehow convey the message to an 00:19:08.581 --> 00:19:15.421 unintended recipient. A cypher is a fancy term for an 00:19:15.421 --> 00:19:23.329 algorithm. That's all it is. Encryption is a fancy word for 00:19:23.329 --> 00:19:26.265 just saying we're going to take what's called plain text and 00:19:26.265 --> 00:19:29.969 we're going to mix it up and create this fancy output called 00:19:29.969 --> 00:19:35.641 cypher test. And it shouldn't have anything to do or look like 00:19:35.641 --> 00:19:40.513 the plain text. When we decrypt it, we convert from cypher text 00:19:40.513 --> 00:19:46.085 back to plain text. To be honest, to be a cryptographer is 00:19:46.085 --> 00:19:48.087 a lifetime per suit. I don't mean to demeanor minimalize the 00:19:48.087 --> 00:19:54.093 lifetime work of cryptographers. To know the basics and use it 00:20:10.443 --> 00:20:15.214 effectively hopefully is a matter of -- and that's what 00:20:15.214 --> 00:20:19.018 we're going to prove out today. A key, it's kind of like a key 00:20:19.018 --> 00:20:25.791 in the real world. It's just a parameter that determines the 00:20:25.791 --> 00:20:31.597 functional output of an encrypted cypher. That key will 00:20:31.597 --> 00:20:36.235 have a unique effect on the cypher text generation. The hash 00:20:36.235 --> 00:20:42.241 function is a one-way function. You can't decrypt it. When you 00:20:46.312 --> 00:20:49.148 hash something you create what's called a digest. There are these 00:20:49.148 --> 00:20:55.454 different types of encryption algorithms called symmetric and 00:20:55.454 --> 00:21:01.694 asymmetric. It just means you have the same key for encryption 00:21:01.694 --> 00:21:07.700 and decryption. Symmetric. I have crypto examples here on 00:21:14.406 --> 00:21:16.809 this slide. I'm going to be talking about five different 00:21:16.809 --> 00:21:22.815 groups of routines. Cyphers, hashes, H-maks, key agreement 00:21:25.484 --> 00:21:30.022 schemes and a password key based function. The code that you see 00:21:30.022 --> 00:21:36.028 here in the coming slides, very, very simple example code. I have 00:21:40.299 --> 00:21:45.137 a 4-hour workshop today at 2:00 p.m. called, for lack of better 00:21:45.137 --> 00:21:48.908 naming at the time, crypto for hackers, the workshop. Probably 00:21:48.908 --> 00:21:53.879 the worst possible name I could come up with. It's from 2:00 to 00:21:53.879 --> 00:21:59.885 6:00 today. Anybody have a seat? Excellent. One brave soul. So in 00:22:02.388 --> 00:22:04.623 that four-hour block what we're going to do, I have eight 00:22:04.623 --> 00:22:07.526 exercises and I'm going to code with you for four hours in C++. 00:22:07.526 --> 00:22:13.532 We are going to write code that implements all of these routines 00:22:16.068 --> 00:22:18.671 and we're going to be sending these across the network and 00:22:18.671 --> 00:22:21.540 even simulating man in the middle attacks. All in the span 00:22:21.540 --> 00:22:25.044 of four hours on Linux and Windows and the code actually 00:22:25.044 --> 00:22:29.782 compiles too, which is a great thing. So for that workshop I 00:22:29.782 --> 00:22:34.320 have written something called demon crypt. All it is is a 00:22:34.320 --> 00:22:37.723 light weight C++ class wrapper around some of the more common 00:22:37.723 --> 00:22:39.725 C++ libraries. Die Monday crypt is -- demon crypt is a 00:22:39.725 --> 00:22:42.061 user-friendly wrapper that makes encrypting a 2-10 line affair. 00:22:42.061 --> 00:22:44.496 We'll be going through all this code later today. I'm most 00:22:44.496 --> 00:22:46.932 excited about coding with you guys in the workshop. I'm a 00:22:46.932 --> 00:22:49.168 coder, I love programming. I'm excited. So T-shirt for you. 00:22:49.168 --> 00:22:51.503 Let's talk about some of these routines. The cypher just 00:22:51.503 --> 00:22:57.509 encrypts or decrypts, right? Cryptography has been around for 00:23:08.988 --> 00:23:14.994 thousands of years in some basic form or another. We're going to 00:23:32.945 --> 00:23:40.719 be implementing what's called Caesar's cypher, by which you 00:23:40.719 --> 00:23:45.024 shift characters over by any number of spaces. Totally no one 00:23:45.024 --> 00:23:47.893 is going to break it especially since I'm limiting the amount of 00:23:47.893 --> 00:23:53.065 shifts, so there's no way we're going to crack this. So Caesar's 00:23:53.065 --> 00:23:57.703 cypher has been around. I probably read it on Wikipedia, 00:23:57.703 --> 00:24:01.573 so maybe it's true. There was a quote about Caesar fighting a 00:24:01.573 --> 00:24:04.209 war and he sent a message to his wife at the time. In the message 00:24:04.209 --> 00:24:06.211 he used Caesar's cypher and when she had decrypted it, the 00:24:06.211 --> 00:24:08.314 message basically said on the front be back in a month, don't 00:24:08.314 --> 00:24:11.884 bathe. So he used crypto for that very sensitive message to 00:24:11.884 --> 00:24:16.055 his wife at the time. I don't know if it's true but it's a 00:24:16.055 --> 00:24:22.061 good story. Cyphers, we're going to be concentrated on the AES 00:24:28.267 --> 00:24:34.273 candidate cyphers. In 1997 NIST sponsored this whereby people 00:24:37.409 --> 00:24:44.616 submitted them for the new standards. And there are a bunch 00:24:44.616 --> 00:24:51.824 of submissions and it was narrowed down to just five. You 00:24:51.824 --> 00:24:58.063 can choose which one you want. That was, I always pronounce 00:24:58.063 --> 00:25:05.304 this wrong. Rain Dale, I always -- my pronunciation is terrible. 00:25:05.304 --> 00:25:10.776 But what became the AES, serpent, two fish, RC 6 and 00:25:10.776 --> 00:25:13.612 Mars. And we're going to be using all of those today in the 00:25:13.612 --> 00:25:18.250 hacker class. The candidate algorithms can have 128 bit 00:25:18.250 --> 00:25:23.288 keys, 256 bit keys. So when you're dealing with cyphers, not 00:25:23.288 --> 00:25:25.591 only are you dealing with a key input, but you've got to choose 00:25:25.591 --> 00:25:31.363 a key size. The larger the key size, ideally the less probable 00:25:31.363 --> 00:25:35.634 collisions and brute force hacking attempts will be. It all 00:25:35.634 --> 00:25:42.941 depends on vulnerabilities and the actual algorithm itself. If 00:25:42.941 --> 00:25:48.947 the vulnerability is found in the algorithm itself key sizes 00:25:51.049 --> 00:25:54.987 aren't important. That's really the goal of a lot of the work. 00:25:54.987 --> 00:25:59.425 Is that if your information is encrypted, it would take more 00:25:59.425 --> 00:26:02.795 than a lifetime to brute force crack it, it's probably good 00:26:02.795 --> 00:26:07.633 enough. What most people don't realize is that it's not a 1 or 00:26:07.633 --> 00:26:11.937 a 0 for crypto. It's an analogue value. There's a decimal point 00:26:11.937 --> 00:26:16.141 in there. It's all up to what your crypto graphic needs are. 00:26:16.141 --> 00:26:19.478 If you don't need the most advanced military strength 00:26:19.478 --> 00:26:22.014 crypto because all you're doing is sharing photos with your 00:26:22.014 --> 00:26:26.185 family, then by all means don't implement and use the most 00:26:26.185 --> 00:26:29.888 advanced crypto. So there's a scale there that goes back and 00:26:29.888 --> 00:26:34.693 forth. That's one reason that makes crypto so much fun because 00:26:34.693 --> 00:26:37.329 we don't always have to choose one or the other. Here is a 00:26:37.329 --> 00:26:43.335 really simple example of crypto using AES with demon crypt. It's 00:26:45.637 --> 00:26:49.274 three lines a code. That's it. You create an AES object with 00:26:49.274 --> 00:26:53.812 cypher, you call set key and you set your key, it be a string, 00:26:53.812 --> 00:26:59.885 whatever you want. And then you crypt. By the way, demon crypt 00:26:59.885 --> 00:27:07.693 is MIT open-source license and that's my gift to you guys 00:27:07.693 --> 00:27:11.363 because it's been helpful to me and I wanted to return this to 00:27:11.363 --> 00:27:19.071 you. I wanted to make crypto easy not only to understand but 00:27:19.071 --> 00:27:24.443 to use. The next topic we want to focus on is going to be hash 00:27:24.443 --> 00:27:28.146 functions. Now, as we mentioned before, a hash is simply a 00:27:28.146 --> 00:27:32.651 one-way conversion. So there's no decryption. Now, you take 00:27:32.651 --> 00:27:37.122 your message and you convert it into a digest. The idea behind 00:27:37.122 --> 00:27:40.559 hashes is they should be practically impossible or 00:27:40.559 --> 00:27:44.730 infeasible to reverse engineer. There are good hash algorithms 00:27:44.730 --> 00:27:50.469 and bad algorithms. Anybody here have MD 5? What do you think? 00:27:50.469 --> 00:27:55.741 Good hash algorithm? Sucks. So, thank you. The three people who 00:27:55.741 --> 00:28:00.946 raised your hand are correct. Thank you for the gentleman who 00:28:00.946 --> 00:28:05.751 screamed it sucks. Even better. There are good hash algorithms, 00:28:05.751 --> 00:28:12.457 there are bad hash algorithms. It's not a 1 and a 0. Even MD 00:28:12.457 --> 00:28:19.231 ahas its place in the world. It's stild used in H-max. It's 00:28:19.231 --> 00:28:23.468 not usually used a lot in normal hashes. You still see it. The 00:28:23.468 --> 00:28:26.438 reason being it doesn't need to be crypto graphically secure. 00:28:26.438 --> 00:28:33.779 You just need an authenticity measure to know that the file 00:28:33.779 --> 00:28:38.584 hasn't been modified. So what are some usages for hash 00:28:38.584 --> 00:28:41.687 functions? We talked about one, file checks. You download a 00:28:41.687 --> 00:28:43.689 file, and there's going to be a hash there. You download the 00:28:43.689 --> 00:28:46.558 file, you reverify the contents of the file and you make sure 00:28:46.558 --> 00:28:52.564 that the hash that I'm reporting and the hash that you're 00:28:54.733 --> 00:28:58.870 reporting match. If they don't, something is wrong. Either I 00:28:58.870 --> 00:29:01.873 fucked up again, which I've done a couple times because it was 00:29:01.873 --> 00:29:05.744 3:00 a.m. and I uploaded a file or somebody has hacked my 00:29:05.744 --> 00:29:11.416 website and exchanged my zip for another zip. Verifying file 00:29:11.416 --> 00:29:14.052 integrity is important, but there's also hashing of 00:29:14.052 --> 00:29:18.390 passwords. We have a lot of awesome pass word dictionary is 00:29:18.390 --> 00:29:22.928 available -- dictionaries now that have extended our rainbow 00:29:22.928 --> 00:29:26.698 table, because of insecure security practices and because 00:29:26.698 --> 00:29:29.968 companies have not hashed passwords in their databases. 00:29:29.968 --> 00:29:33.472 The companies I love are the companies who implement poor 00:29:33.472 --> 00:29:37.743 security measures except when my data is in their systems. When 00:29:37.743 --> 00:29:43.849 they're hacked and a list of a million or two million passwords 00:29:43.849 --> 00:29:47.486 are released, this is a real word indication for what people 00:29:47.486 --> 00:29:50.055 like us create for passwords. Having that real-world data is 00:29:50.055 --> 00:29:54.226 essential. Hashing that password in your database is a common 00:29:54.226 --> 00:30:00.232 thing you can do to prevent these types of leaks. So some 00:30:07.339 --> 00:30:10.142 algorithms we talked about. Sha, sha 2 and sha 3. It's 00:30:10.142 --> 00:30:15.681 interesting to know a few years back, I forget the exact date, 00:30:15.681 --> 00:30:19.918 2007 maybe, that NIST sponsored a competition looking for the 00:30:19.918 --> 00:30:22.854 next generation for hash functions. They thought it was a 00:30:22.854 --> 00:30:25.590 good idea to be pro active. I love it when our government 00:30:25.590 --> 00:30:27.659 starts thinking that we figure that all of our stuff is going 00:30:27.659 --> 00:30:33.665 to be hacked soon, so let's stay ahead of the curve and let's do 00:30:41.707 --> 00:30:48.680 another call for papers. That's what happened with NIST. With 00:30:48.680 --> 00:30:51.416 hash functions there are concerns with collisions. There 00:30:51.416 --> 00:30:54.920 are also concerns with rainbow attacks. They're merely large, 00:30:54.920 --> 00:31:00.092 large tables of precomputed hashes that map up to existing 00:31:00.092 --> 00:31:04.296 passwords or key things. So basically if you've got a list 00:31:04.296 --> 00:31:07.966 of passwords that have been hashed, you can go through and 00:31:07.966 --> 00:31:10.969 you can scan using rainbow tables which are precomputed 00:31:10.969 --> 00:31:15.374 hashes and reverse engineer the password by -- knowing the hash. 00:31:15.374 --> 00:31:20.212 It's a call name but all it is is a table of precomputed hashes 00:31:20.212 --> 00:31:23.815 that are really unsalted. There's also this thing called 00:31:23.815 --> 00:31:27.753 length attacks. That's where you add to your hash length 00:31:27.753 --> 00:31:33.725 extension is a powerful hash that can be done and why people 00:31:33.725 --> 00:31:37.996 use H max for guaranteeing data integrity and authenticity. How 00:31:37.996 --> 00:31:44.469 can you hash whatever you want in your code just by using demon 00:31:44.469 --> 00:31:49.307 crypt? It's really easy. You create an instance of MD 5 or 00:31:49.307 --> 00:31:54.679 sha 1 and you simply call the compute function. I really 00:31:54.679 --> 00:31:59.351 tried, I mean, if you want to take the code and make it much 00:31:59.351 --> 00:32:02.287 more functional and beautiful, I would love to host it. So if you 00:32:02.287 --> 00:32:07.492 want to modify it. I will uploading it to my repository in 00:32:07.492 --> 00:32:14.733 the next week with full access if you want to modify and make 00:32:14.733 --> 00:32:20.739 it awesome, that's cool by me. That's all it takes to use demon 00:32:27.946 --> 00:32:31.917 crypt. The output or the digest output between the two is 00:32:31.917 --> 00:32:36.688 varied. You see the MD 5 has fewer inputs. So once again a 00:32:36.688 --> 00:32:41.393 longer digest, more crypt graphically secure, assuming 00:32:41.393 --> 00:32:46.364 that the algorithm hasn't been compromised. I alluded to this 00:32:46.364 --> 00:32:51.736 earlier, the next thing on the list is H-max. What an H max is 00:32:51.736 --> 00:32:53.905 a hash based message authentication code. Under the 00:32:53.905 --> 00:32:56.274 seams it uses a hash and it applies a key. So what's 00:32:56.274 --> 00:33:02.214 different between an H-MAC and a hash is the hash can be salted. 00:33:09.855 --> 00:33:17.495 You may ask what's a salt. When you're hashing a salt, all that 00:33:17.495 --> 00:33:21.233 means is that you're adding an extra string in the input. So 00:33:21.233 --> 00:33:23.768 you're varying the input before it gets sent into the hash 00:33:23.768 --> 00:33:29.174 function. What an HMAC does is it guarantees or trees to 00:33:29.174 --> 00:33:35.080 guarantee authenticity and data integrity. This talk is probably 00:33:35.080 --> 00:33:37.582 too short to get into the benefits. I'm going to talk 00:33:37.582 --> 00:33:41.419 about it in the workshop. What authenticity is is an indication 00:33:41.419 --> 00:33:47.259 to me as I receive a message that this came from the intended 00:33:47.259 --> 00:33:51.830 origin. So I somehow know that this is coming from at least the 00:33:51.830 --> 00:33:55.000 point of origin. I don't know it's trusted, I don't know if 00:33:55.000 --> 00:33:57.869 the person that sent it is the person expected to press the 00:33:57.869 --> 00:34:03.675 enter key. At a minimum they have same access. Data integrity 00:34:03.675 --> 00:34:07.045 is the idea that the message hasn't been tampered in pay 00:34:07.045 --> 00:34:13.051 load. An HMAC allows us to shove a key in and generate an output 00:34:16.054 --> 00:34:21.026 that guarantees those factors. Building blocks for other 00:34:21.026 --> 00:34:25.697 applications such as my favorite crypto routine right now, in 00:34:25.697 --> 00:34:31.403 fact that would be -- that is a lot of text over there. I'm 00:34:31.403 --> 00:34:35.073 easily distracted by free-flowing text. It's a fault 00:34:35.073 --> 00:34:40.679 of mine. So one of my favorite crypto routines right now I've 00:34:40.679 --> 00:34:46.685 come to fall in love with, it can use under the covers an 00:34:48.787 --> 00:34:51.523 HMAC. It's a really, really cool routine that allows you to take 00:34:51.523 --> 00:34:56.594 any sort of text or input and create a specific sized key or 00:34:56.594 --> 00:35:00.231 out put as a result that can be used for a key to a cypher. So 00:35:00.231 --> 00:35:05.837 HMACs are used under the covers. You can use all the normal 00:35:05.837 --> 00:35:12.944 hashes in your HMAC. Here's an example of using an HMAC with 00:35:12.944 --> 00:35:18.717 demon crypt. Look familiar? It should. I wanted it simple. I 00:35:18.717 --> 00:35:24.255 didn't want to there I about crypto when I was writing 00:35:24.255 --> 00:35:28.093 demonsaw. You set the instance, call compute and you're done. 00:35:28.093 --> 00:35:33.431 Crypto doesn't have to be any more complex than this. Same 00:35:33.431 --> 00:35:39.804 thing, you create an object, set the key call compute and we're 00:35:39.804 --> 00:35:44.442 done. Open source and free. The way everything should be. PBKDF, 00:35:44.442 --> 00:35:50.815 we finally got my favorite. I even found a cute little salt 00:35:50.815 --> 00:35:54.686 guy who is kind of dancing around. But what this is, as I 00:35:54.686 --> 00:35:58.656 mentioned before, this allows us to take a pass phrase or a bunch 00:35:58.656 --> 00:36:02.827 of bytes or any set of arbitrary data and shove it into the 00:36:02.827 --> 00:36:05.063 input, add a salt and basically derive an output that can be 00:36:05.063 --> 00:36:07.265 used to input for a cypher. So a lot of times you'll say hello, 00:36:07.265 --> 00:36:09.768 my name is Eijah and I want to use this to create a key. Why 00:36:09.768 --> 00:36:15.774 don't you just use hello my name is Eijah is the key. Because 00:36:18.143 --> 00:36:23.114 cyphers are very mean. What do I mean? They only like keys of 00:36:23.114 --> 00:36:29.120 certain input size. So an AES 128 will only take an AES 128 00:36:32.957 --> 00:36:37.162 key. You try to give it 127 bits, that's a bad example 00:36:37.162 --> 00:36:41.833 because you can't do that. But if you try to give it 120 bits 00:36:41.833 --> 00:36:45.904 instead of 128 bits, it's just not going to work. So they like 00:36:45.904 --> 00:36:50.708 precise key input for the number of bits that they're going to 00:36:50.708 --> 00:36:55.780 use internally. So you use PBKDF 2 to generate a precise set of 00:36:55.780 --> 00:37:01.719 bytes. Third secret derivation is really a powerful output. In 00:37:06.157 --> 00:37:12.564 addition, PBKDF 2 allows us to add iterations. You can start 00:37:12.564 --> 00:37:16.234 iteration one which is not secured or you can go to 100 --> 000 00:37:16.234 --> 00:37:22.173 iterations. I believe that the NIST standard last I checked was 00:37:22.173 --> 00:37:26.611 100 --> 000 iterations or 10 --> 000. I can't remember. I use 100 --> 000 00:37:26.611 --> 00:37:30.682 normally. I think that's the ideal standard for PBKDF 2 right 00:37:30.682 --> 00:37:36.788 now. So you can iterate multiple times in your algorithm. 00:37:36.788 --> 00:37:41.993 Computationally it's more intense, which is great for 00:37:41.993 --> 00:37:46.030 crypto. We don't want a super easy and highly performing 00:37:46.030 --> 00:37:48.566 crypto routine because it's going to be easier for the 00:37:48.566 --> 00:37:54.572 hackers to brute force. How does this look? A little more complex 00:37:59.410 --> 00:38:03.448 but not too much. The name of the class is a bit bizarre. I 00:38:03.448 --> 00:38:06.050 probably could use your help cleaning up. I think I've 00:38:06.050 --> 00:38:10.221 removed the PKCS 5 prefix by the way. You set the salt and you 00:38:10.221 --> 00:38:16.227 call compute. And that's it. And that is how -- and you can also 00:38:21.900 --> 00:38:29.274 set the iteration count too, but that's how it's done. Four lines 00:38:29.274 --> 00:38:34.512 to take a pass phrase, set the count, set the salt and generate 00:38:34.512 --> 00:38:40.518 the output. Four lines of code is all it takes. Finally, we're 00:38:44.088 --> 00:38:47.926 at our last cryptographic routine. And the good news is we 00:38:47.926 --> 00:38:50.895 are right on time. Key agreement schemes. We're going to talk 00:38:52.964 --> 00:38:55.099 about something called Diffie-Hellman. You probably 00:38:55.099 --> 00:39:01.039 heard of the paint mixing analogy, right? This analogy 00:39:05.143 --> 00:39:08.546 scares the shit out of me. The last thing I want to do is get 00:39:08.546 --> 00:39:12.717 somebody to randomly mix paint colors. The reason why we need 00:39:12.717 --> 00:39:18.723 key agreement schemes, and this is based on asymmetric 00:39:21.125 --> 00:39:25.129 encryption, this will generate a private and a public key, and 00:39:25.129 --> 00:39:30.702 the end result is to generate a shared key between two disparate 00:39:30.702 --> 00:39:35.840 parties without any sort of key exchange. So what happens is you 00:39:35.840 --> 00:39:40.879 generate three things. You generate a base, you generate a 00:39:40.879 --> 00:39:45.183 prime number, and you generate a public key that is sent is cross 00:39:45.183 --> 00:39:48.786 the wire. I generate these things as well as a private key 00:39:48.786 --> 00:39:53.758 that I hold on to and I send these to you. You take these as 00:39:53.758 --> 00:39:58.196 input and you send me back your public key. Meanwhile, you're 00:39:58.196 --> 00:40:01.766 mixing my public key with your private key to generate a shared 00:40:01.766 --> 00:40:04.869 key. When I receive your public key back, I mix it with my 00:40:04.869 --> 00:40:08.740 private key to generate a shared key and our shared keys, because 00:40:08.740 --> 00:40:13.411 of the magic of math and prime numbers and all that good stuff 00:40:13.411 --> 00:40:18.349 results in being the same key without us exchanging it. Dippy 00:40:18.349 --> 00:40:21.319 hell man in a lot of technologies we used today. 00:40:21.319 --> 00:40:27.325 Anybody know reber? TLS uses it as well. SSH uses it. DPNs use 00:40:43.174 --> 00:40:46.311 it. It's a great way for two parties to get a shared key and 00:40:46.311 --> 00:40:50.481 fast. This can be computationally intensive if the 00:40:50.481 --> 00:40:54.752 prime number bits are high. And we'll talk about that in the 00:40:54.752 --> 00:40:59.324 workshop more. If you have a low number of prime bits, like 128 00:40:59.324 --> 00:41:03.594 that's very, very insecure, what that means is that your ability, 00:41:03.594 --> 00:41:07.832 the ability of collisions to happen is more probablistic. So 00:41:07.832 --> 00:41:12.303 if you generate a larger prime number, like 3072 bits, then the 00:41:12.303 --> 00:41:17.375 chance of collisions over T time is going to be probablisticly 00:41:17.375 --> 00:41:22.146 lower. But to generate a 3072 bit prime takes a while 00:41:22.146 --> 00:41:25.883 depending on your computational power. I can generate on my 00:41:25.883 --> 00:41:30.355 four--year-old laptop, I can generate a 1024 or even a 776 or 00:41:30.355 --> 00:41:36.361 even a 17176 bit prime in under 15 seconds. I've got a fairly 00:41:39.030 --> 00:41:42.533 slow laptop with only 8 gigs of memory. But when I bump it up, 00:41:42.533 --> 00:41:49.374 it can take a minute or even up to two minutes. So ideally, the 00:41:49.374 --> 00:41:53.444 down side to this is the prime number generation. You can save 00:41:53.444 --> 00:41:57.148 out your prime and use it. You can imagine that has some other 00:41:57.148 --> 00:42:00.618 security concerns as well. The end result of this is 00:42:00.618 --> 00:42:05.256 Diffie-Hellman is a powerful technique and today we are going 00:42:05.256 --> 00:42:11.829 to be implementing code and not only does a shared key creation 00:42:11.829 --> 00:42:14.232 across multiple clients but we're going to take the key, 00:42:14.232 --> 00:42:19.971 pipe it into PBKDF 2 to create a specific key length, feed it 00:42:19.971 --> 00:42:24.509 into a algorithm of choice and encrypt secure messages back to 00:42:24.509 --> 00:42:28.880 the secure sender all today in just one of the exercises. It's 00:42:28.880 --> 00:42:34.886 going to be a lot of fun. So how does this look? It is a little 00:42:37.922 --> 00:42:41.192 bit more complex than the other examples. I won't go through all 00:42:41.192 --> 00:42:44.195 of it here, but what we do is create our base, we create our 00:42:44.195 --> 00:42:49.467 prime and our public key. We print those out and sent those 00:42:49.467 --> 00:42:57.341 out and returns to me a public key meanwhile generating his or 00:42:57.341 --> 00:43:01.879 her shared key. Then I receive his or her public key back and I 00:43:01.879 --> 00:43:05.049 feed it into my algorithm and generate the shared key without 00:43:05.049 --> 00:43:07.885 actually exchanging it. Even though this was a little bit 00:43:07.885 --> 00:43:12.156 more complex code, it's still about 10 lines of functional 00:43:12.156 --> 00:43:15.460 code to do a key exchange. Has anybody tried to do a 00:43:15.460 --> 00:43:18.930 Diffie-Hellman key exchange on your own? It is fucking nuts. It 00:43:18.930 --> 00:43:24.936 is painful, right? This is way better than doing it manually. 00:43:27.371 --> 00:43:33.377 For those of you who raised your hands, you're very brave, too. 00:43:36.814 --> 00:43:41.252 The next two slides, if you do a 2048 bit prime, it looks 00:43:41.252 --> 00:43:43.354 scarier. Even if you don't read through the numbers. It just 00:43:43.354 --> 00:43:49.360 looks scarier than this. But obviously more secure. So those 00:43:52.063 --> 00:43:56.133 in a nutshell are the five different crypto routines. What 00:43:56.133 --> 00:43:59.170 I want to do right now, now that we've reviewed these algorithms, 00:43:59.170 --> 00:44:03.407 I want to talk a little about unique ways that we can use 00:44:03.407 --> 00:44:06.410 these cryptographic building blocks to create our own secure 00:44:06.410 --> 00:44:11.449 applications. As you know I'm the founder of demonsaw and just 00:44:11.449 --> 00:44:16.821 last night I released demonsaw 2.0. I made it for us to secure 00:44:16.821 --> 00:44:20.191 our communications and secure our content. There's no 00:44:20.191 --> 00:44:24.228 infrastructure, no logging. I don't mind bit coins on your 00:44:24.228 --> 00:44:28.900 computer. I don't do any of this. I don't even know who uses 00:44:28.900 --> 00:44:31.235 it, obviously. I'll give you $10 million if you tell me how many 00:44:31.235 --> 00:44:37.241 people use it, I would not be able to take your money. I have 00:44:40.545 --> 00:44:44.849 no clue. Demonsaw 1.0 was launched last year at Def Con 00:44:44.849 --> 00:44:52.123 22. It was a little buggy. Thank you for helping me test through 00:44:52.123 --> 00:44:56.928 some of the bug fixes. I'm the only person who writes the code 00:44:56.928 --> 00:45:01.032 and I do that part-time when I'm not working at rock star. It was 00:45:01.032 --> 00:45:07.038 a good first step. It was C sharp, windows only. It had some 00:45:11.342 --> 00:45:15.880 bugs. I tried, I did well and learned a lot from it and thank 00:45:15.880 --> 00:45:20.851 you for your patience and your understanding. I set out after 00:45:20.851 --> 00:45:25.957 Def Con with goals. I want it to be everywhere. I want it to be 00:45:25.957 --> 00:45:28.459 on Linux, I want it to be on raspberry pie and everywhere I 00:45:28.459 --> 00:45:31.829 want it to be. Somebody asked I think he was drunk you because I 00:45:31.829 --> 00:45:37.835 was drunk, he asked me when is it coming out on Solaris and I 00:45:43.040 --> 00:45:46.777 was like, I don't know. That's a great question. And please don't 00:45:46.777 --> 00:45:51.248 ask me about BSD either. Perhaps not everywhere but we're getting 00:45:51.248 --> 00:45:56.187 closer. I wanted to simplify the interface, increase security and 00:45:56.187 --> 00:45:59.023 add features that you guys requested. The promise with 00:45:59.023 --> 00:46:02.793 demonsaw and clearly you should still not trust me. But the 00:46:02.793 --> 00:46:08.966 promise I'm making to you is it's 100 % free, no ads, not 00:46:08.966 --> 00:46:11.969 even on the website, no call-backs, no loggings, no 00:46:11.969 --> 00:46:16.941 installs, no malware, no bundled software, no tracking, no 00:46:16.941 --> 00:46:21.412 logging. I'm not going to sabotage your CBU and mine bit 00:46:21.412 --> 00:46:25.082 coins. There's no bullshit. When you download demonsaw you get an 00:46:25.082 --> 00:46:28.486 application that allows you to download it your way, fuck off 00:46:28.486 --> 00:46:30.488 NSA. Thank you. So some of the features in 2.0, I'm not going 00:46:30.488 --> 00:46:36.494 to go through this list. There's cool features. What I want to 00:46:48.005 --> 00:46:53.110 talk about is something called social crypto. Social crypto is 00:46:53.110 --> 00:46:57.048 a new way of thinking about security. This is really the 00:46:57.048 --> 00:47:03.554 core of demonsaw 2.0. It's a new way of thinking about security. 00:47:03.554 --> 00:47:07.591 Security is a lot like water. Security is a lot like water in 00:47:07.591 --> 00:47:12.997 that it should be free, we had need it to survive and companies 00:47:12.997 --> 00:47:19.203 want to package it up and sell it back to us at a premium. What 00:47:19.203 --> 00:47:23.908 social crypto does is it favors individuals in small groups. It 00:47:23.908 --> 00:47:26.977 doesn't require anybody else. No infrastructure, nobody. Your 00:47:26.977 --> 00:47:31.515 data sits on your machine and your machine only and you share 00:47:31.515 --> 00:47:36.353 it with whomever you want. There's no private public keys 00:47:36.353 --> 00:47:40.958 to share, there's none of that. There's no peer-to-peer. It's 00:47:40.958 --> 00:47:47.665 built on a foundation of traditional security. Contextual 00:47:47.665 --> 00:47:53.404 awareness via shared experiences and knowledge is converted into 00:47:53.404 --> 00:47:57.541 URLs or assets that are located somewhere in the world, HTML 00:47:57.541 --> 00:48:02.580 pages, PDFs, images. And instead of using a pass phrase to feed 00:48:02.580 --> 00:48:06.717 into a hash, we use the contents of whatever is at that URL. It 00:48:06.717 --> 00:48:11.589 can be local, it can be remote. So we together, if we want to 00:48:11.589 --> 00:48:13.591 get in a shared group, all we do is share a URL or multiple URLs. 00:48:13.591 --> 00:48:17.061 So let's say demonsaw.com. We could all get into a secure 00:48:17.061 --> 00:48:23.067 group right now that nobody could hack simply by specifying 00:48:26.370 --> 00:48:30.141 demonsaw.com and tweaking a couple of programers. We use the 00:48:30.141 --> 00:48:36.147 binary contents in order to feed that into input. So we map this 00:48:38.482 --> 00:48:42.987 contextual awareness into binary form and this is used as entropy 00:48:42.987 --> 00:48:47.491 into crypto routines. This concept is a little bizarre. 00:48:47.491 --> 00:48:53.130 It's new. But instead of using passwords and user IDs and 00:48:53.130 --> 00:48:57.501 public and private keys, because even PGP requires contextual 00:48:57.501 --> 00:49:01.071 awareness. I have to give you my public key. So if we all wanted 00:49:01.071 --> 00:49:04.742 to e-mail each other, we would all have to swap public keys. So 00:49:04.742 --> 00:49:07.478 there's contextual awareness of where my key is stored. This is 00:49:07.478 --> 00:49:10.681 a new way of thinking about security. And it's not roll your 00:49:10.681 --> 00:49:13.617 own crypto. We use all the traditional algorithms and 00:49:13.617 --> 00:49:17.922 cyphers and routines you saw today. We don't do anything 00:49:17.922 --> 00:49:23.928 different. The only difference is we source the entropy through 00:49:27.531 --> 00:49:30.434 binary data that we acquired from things that are already 00:49:30.434 --> 00:49:36.307 online. That's the key to social crypto. Right now I want to give 00:49:36.307 --> 00:49:40.845 you a quick demo of demonsaw 2.0. It's available to download 00:49:40.845 --> 00:49:45.850 now. I know we're running out of time. But last year I screwed up 00:49:45.850 --> 00:49:53.023 the demo. This year I was hoping not to screw up the demo. By the 00:49:53.023 --> 00:49:56.694 way, there is a video tutorial that is narrated by a very 00:49:56.694 --> 00:50:00.965 professional sounding voice that can walk you through this. This 00:50:00.965 --> 00:50:06.971 router can be a message router or data router or both. The way 00:50:09.640 --> 00:50:12.543 demonsaw works the message routing is kind of like torr in 00:50:12.543 --> 00:50:16.714 that it's separate. So you can have a message router or you can 00:50:16.714 --> 00:50:20.751 have a message router somewhere halfway around the world. You 00:50:20.751 --> 00:50:25.723 can route your data any way you want. You control this. How do 00:50:25.723 --> 00:50:30.127 you set up your message router? Click enable and it's done. We 00:50:30.127 --> 00:50:37.001 now have a demonsaw network running right here locally. Now 00:50:37.001 --> 00:50:39.937 then you add a client. Because I love star trek, I'm going to 00:50:39.937 --> 00:50:45.943 call this Pickard. I basically connect. I'm going to add 00:50:56.253 --> 00:51:03.527 another client here and call it Riker. And I'm going to choose 00:51:03.527 --> 00:51:09.533 for Riker. And I'm going to connect. So what we've done here 00:51:21.645 --> 00:51:25.182 is simply, by specifying my download location and my IP 00:51:25.182 --> 00:51:29.219 address, these two clients are connected to a secure network. 00:51:29.219 --> 00:51:33.257 This is the bare minimum to get into the game. Pickard can go 00:51:33.257 --> 00:51:40.230 over here. The resolution on these projectors are terrible by 00:51:40.230 --> 00:51:42.866 the way. In case you're wondering why doesn't he 00:51:42.866 --> 00:51:48.872 increase the resolution. I tried. Pickard has a couple of 00:51:48.872 --> 00:51:54.812 folders that he wants to share. Riker goes okay, I like that. So 00:51:54.812 --> 00:51:59.950 I'm going to do a search. I'm searching for AC/DC and I want 00:51:59.950 --> 00:52:05.889 to download Highway to Hell. So we are now in a group, it's not 00:52:10.361 --> 00:52:14.965 as secure. It's default security. So let's make it more 00:52:14.965 --> 00:52:19.203 secure. We go to the group tab. What I can do is I can add a 00:52:19.203 --> 00:52:26.210 URL. In this case I'm adding demonsaw.com. Oh, shit. I'm not 00:52:26.210 --> 00:52:32.216 connected to the network. Oh, well. All right. A local file. 00:52:37.254 --> 00:52:41.091 So if we were connected to the network, then we could simply do 00:52:41.091 --> 00:52:44.495 that. Pretend, if you had a network here and I had typed 00:52:44.495 --> 00:52:46.864 demonsaw.com, it would have gone, fetched whatever was at 00:52:46.864 --> 00:52:50.200 the home page, grabbed all the bits from that HTML page, pulled 00:52:50.200 --> 00:52:56.206 it down as entropy and showed me here the size. Instead we did 00:52:58.909 --> 00:53:01.578 the same with a local file. It could be a PDF, it could be an 00:53:01.578 --> 00:53:05.182 image. It doesn't matter what it is. Now, I am now in a 00:53:05.182 --> 00:53:12.189 completely different group than the Pickard. And the router will 00:53:12.189 --> 00:53:15.993 show that here. Riker's group is a different hash value than 00:53:15.993 --> 00:53:21.298 Pickard's. If I go over to Pickard and switch his group and 00:53:21.298 --> 00:53:27.304 I give him the same group, then he will now be in the same group 00:53:31.642 --> 00:53:36.814 as Riker. So by using the entropy that's contained within 00:53:36.814 --> 00:53:39.683 the resource that we're referencing, we are deriving 00:53:39.683 --> 00:53:42.352 cryptographic signatures that we need into algorithms to generate 00:53:42.352 --> 00:53:44.555 our unique group signature. So this is great. What if somebody 00:53:44.555 --> 00:53:46.623 finds the logo .PNG. It's just an image. So let's say everybody 00:53:46.623 --> 00:53:52.629 here knows about that. What you can do is you can modify some of 00:54:00.404 --> 00:54:06.443 these parameters. You can modify the entropy. I'm only going to 00:54:06.443 --> 00:54:11.715 use 50% of the entropy. Refresh. Now they're in different groups. 00:54:11.715 --> 00:54:14.118 Simply by me saying I want to use half the bits instead of all 00:54:14.118 --> 00:54:17.721 the bits, I've already kicked myself into a new group. Pickard 00:54:17.721 --> 00:54:20.657 doesn't know about that. He goes over here and says oh, I've 00:54:20.657 --> 00:54:26.029 caught on, 50%, done. Now they're in the same group. I'm 00:54:26.029 --> 00:54:31.401 running out of time, but you can tweak the cypher, you can tweak 00:54:31.401 --> 00:54:35.038 the bit size, you can tweak the hash. There's a lot of different 00:54:35.038 --> 00:54:39.309 things, the iterations for the PBKDF, the salt, et cetera. All 00:54:39.309 --> 00:54:42.379 these things can be tweaked to set up your group as securely as 00:54:42.379 --> 00:54:48.051 needed to share your content. And you can also add multiple -- 00:54:48.051 --> 00:54:52.055 I can add multiple entries here. So you can extend this. Simply 00:54:52.055 --> 00:54:56.960 by remembering three or four URLs, you can set yourself up 00:54:56.960 --> 00:55:00.998 with a cryptographic signature that is likely infeasible for 00:55:00.998 --> 00:55:05.068 somebody to know the unique ordering of these URLs and be 00:55:05.068 --> 00:55:07.871 able to brute force your key. Here's the thing, you're saying 00:55:07.871 --> 00:55:12.843 you're using multiple layers of encryption. There's a lot of 00:55:12.843 --> 00:55:16.513 studies that make it less secure, yes if the entropy is 00:55:16.513 --> 00:55:18.515 the same. You generate new copies of entropy here. So 00:55:18.515 --> 00:55:20.517 you're using multiple encryption with unique entropy, unique 00:55:20.517 --> 00:55:26.523 cypher, and potentially unique iterations all within your 00:55:34.765 --> 00:55:38.602 control. No government, no companies, free. This is 00:55:38.602 --> 00:55:43.307 demonsaw and I hope you like it. (Applause.)uhm i just gotta do a 00:55:43.307 --> 00:55:48.712 closing for two minutes, i swear, just two minutes, i 00:55:48.712 --> 00:55:50.914 promise, you have? ok