00:00:00.000 --> 00:00:05.305 >>I am Ryan Casataluche and I am here today to talk about 00:00:05.305 --> 00:00:08.041 cracking brainwallets. A quick disclaimer, just because 00:00:08.041 --> 00:00:11.311 someone's password is terrible does not give you the right to 00:00:11.311 --> 00:00:14.214 steel their money. Please don't do it. Don't blame the victim 00:00:14.214 --> 00:00:17.818 don't be a jerk. Pretending people dont choose shitty 00:00:17.818 --> 00:00:22.389 passphrases doesnt help. So brainwallets are not a good idea 00:00:22.389 --> 00:00:26.360 if you want to use something that works like a brainwallet 00:00:26.360 --> 00:00:31.064 but is actually secure there is this thing work wallet and it is 00:00:31.064 --> 00:00:35.435 a lot better and if you use it with [indiscernible] words, it 00:00:35.435 --> 00:00:38.705 will be great. So don't use brainwallets if you are using 00:00:38.705 --> 00:00:45.078 one please move you money out of it. Someone lost $14 --> 000 worth 00:00:45.078 --> 00:00:49.583 of bitcoin just last week. Really quick overview about what 00:00:49.583 --> 00:00:53.387 a cryptocurrency is. Electronic money using cryptography to 00:00:53.387 --> 00:00:57.057 secure it. We don't need a bank or government to run one of 00:00:57.057 --> 00:01:00.761 these. Transfers work very similarly to checks you sign the 00:01:00.761 --> 00:01:03.664 money over to somebody else except for the ink on the paper 00:01:03.664 --> 00:01:10.971 it is cryptographic signatures on the block chain. A big 00:01:10.971 --> 00:01:15.909 problem was to keep people from spending the same money twice. 00:01:15.909 --> 00:01:19.980 The bitcoin solved this with a public transaction log. 00:01:19.980 --> 00:01:25.419 Transfers are identified by account. So super anonymous. 00:01:25.419 --> 00:01:31.992 Bitcoin like coin, dashcoin, at DefCon we have DefCoin. And 00:01:31.992 --> 00:01:34.828 control of the private key, is control of the money. A 00:01:34.828 --> 00:01:41.902 brainwallet is a little thing built on top of this. You need a 00:01:41.902 --> 00:01:45.605 private key but you can't memorize a private key really. 00:01:45.605 --> 00:01:50.610 Its a long string of hacks. So you can turn a passphrase 00:01:50.610 --> 00:01:55.349 into a private key with a hash and control of knowledge of the 00:01:55.349 --> 00:02:00.554 pass phrase becomes control of the money. Why do people like 00:02:00.554 --> 00:02:06.560 this? The first thing they think is plausible deniability. If no 00:02:09.629 --> 00:02:11.765 record on my computer or anything of me making this thing 00:02:11.765 --> 00:02:14.501 then if somebody ask me a about it I can say it doesn't exist. 00:02:14.501 --> 00:02:17.070 They can't prove me wrong. Well thats not actually quite 00:02:17.070 --> 00:02:21.575 true. Because is pseudo anonymous you can track the 00:02:21.575 --> 00:02:26.279 transactions. It is just tricky and the other thing people say 00:02:26.279 --> 00:02:29.750 fifth amendment protection against government seizure. Well 00:02:29.750 --> 00:02:33.854 sure, but you don't need a brainwallet to do that. An 00:02:33.854 --> 00:02:37.824 encrypted wallet gives you the same protection and its not 00:02:37.824 --> 00:02:41.495 more manageable and there is the old meet is a better random 00:02:41.495 --> 00:02:47.501 number generator than silicon because you can't back door meet 00:02:54.041 --> 00:02:57.010 but you don't need to back door meet because it comes up with a 00:02:57.010 --> 00:02:59.012 shitty passwords and pass phrases. So this doesn't really 00:02:59.012 --> 00:03:01.014 work very well. So remember that cryptocurrency transactions are 00:03:01.014 --> 00:03:03.250 public. People are working on adding privacy to do that not 00:03:03.250 --> 00:03:07.220 there yet and brainwallet addresses show up on the 00:03:07.220 --> 00:03:12.159 transaction. And the same password always gives you the 00:03:12.159 --> 00:03:16.530 same address so if you look at addresses you can check them to 00:03:16.530 --> 00:03:19.966 see if there is a matching brainwallet so a weak -- 00:03:19.966 --> 00:03:25.472 password can be guessed. That 14 --> 000 dollars was sent to the 00:03:25.472 --> 00:03:30.110 passphrase of an empty string. There is certain brainwallet 00:03:30.110 --> 00:03:33.780 tool site where that is default pass phrase and someone just 00:03:33.780 --> 00:03:39.052 used it. [Laughter] So here is how brainwallets works you start 00:03:39.052 --> 00:03:45.459 with a pass phrase I'm sure you heard of correct battery horse 00:03:45.459 --> 00:03:52.365 staple. First thing we do is run it through Shot 256. The address 00:03:52.365 --> 00:03:58.472 is treated as 256 bit integer and thats your private key. 00:03:58.472 --> 00:04:02.809 The next thing we do is compute the public key. So an 00:04:02.809 --> 00:04:07.013 interesting thing is well actually for one this step is 00:04:07.013 --> 00:04:12.953 the most CMU step intensive of the process. Its and two, 00:04:12.953 --> 00:04:15.322 theres actually two different ways to represent a public key 00:04:15.322 --> 00:04:20.360 compressed and uncompressed for a long time uncompressed was 00:04:20.360 --> 00:04:24.531 default most brainwallets still default to this. Theres also 00:04:24.531 --> 00:04:27.634 a compressed format which is basically a truncated version 00:04:27.634 --> 00:04:31.738 where you spend a little bit more CPU time to restore the 00:04:31.738 --> 00:04:35.709 part that is left out. And you can usually pick which one you 00:04:35.709 --> 00:04:41.948 want the use. So then you have a public key. We put this through 00:04:41.948 --> 00:04:49.456 trial 56 as well but it is still kind of long so we put it 00:04:49.456 --> 00:04:54.995 through right MD-1 160 which is obscure hash algorithm. Most 00:04:54.995 --> 00:05:00.600 transaction use this as the on network and on disc format. And 00:05:00.600 --> 00:05:06.473 well 160 bits in hex is kind of unwieldily for a person and if 00:05:06.473 --> 00:05:11.912 you make any typos the money would be gone for every so there 00:05:11.912 --> 00:05:15.515 is 58 check. You get the first character identifies which 00:05:15.515 --> 00:05:19.786 cryptocurrency it goes to. The rest of it is basic encoding of 00:05:19.786 --> 00:05:25.392 the check stem. So if you typo it probably will catch your 00:05:25.392 --> 00:05:28.895 typo. So brainwallets make the block chain into the public hash 00:05:28.895 --> 00:05:36.870 data base so what do we ask when password hash database is made 00:05:36.870 --> 00:05:44.077 public. The first thing is are the passwords in fact hashed. 00:05:44.077 --> 00:05:51.318 Well, yes they are. Are they salted? No. Is the hash slow to 00:05:51.318 --> 00:05:57.324 crack? Well, kind of. Not slow enough it turns out. Cracking 00:05:59.526 --> 00:06:04.331 yields money. So this is the fantastic motivation for 00:06:04.331 --> 00:06:09.703 password crackers it turns out. So back in 2013, I came across 00:06:09.703 --> 00:06:17.277 this blog post talking about brainwallets and someone made 00:06:17.277 --> 00:06:21.581 test to see how many could be crack them. I thought this was 00:06:21.581 --> 00:06:25.886 interesting, and you know I had a half hour commute each way in 00:06:25.886 --> 00:06:30.523 the train. So I wrote a crack over the course of a week. To 00:06:30.523 --> 00:06:35.161 see this in SSL. So it would have taken a long list of hash 00:06:35.161 --> 00:06:38.932 160s from a file and then and standard in I could pass it 00:06:38.932 --> 00:06:45.338 passwords and pass phrases. No real reason to build in my own 00:06:45.338 --> 00:06:48.041 passwords generation because there are lots of other tools 00:06:48.041 --> 00:06:50.844 that will do that and spits results out to you standard out. 00:06:50.844 --> 00:06:58.351 So I have a core I7 that is about four or five years-old at 00:06:58.351 --> 00:07:03.857 this point and was able to do 10 --> 000 guesses per second. Like 00:07:03.857 --> 00:07:08.628 a lot of people here, I find it somewhat interesting to go 00:07:08.628 --> 00:07:14.868 through password leaks and crack the hashes so I had word list 00:07:14.868 --> 00:07:18.638 sitting around so I just had to feed it some of them and I was 00:07:18.638 --> 00:07:24.210 not prepared for the results. So I got this going and went to a 00:07:24.210 --> 00:07:28.581 picnic and then I got home and I saw how much wood could a wood 00:07:28.581 --> 00:07:34.587 chuck wood if a wood chuck could chuck wood. This is funny and 00:07:38.792 --> 00:07:40.794 then I ran the balance check script. Turns out the woodchucks 00:07:40.794 --> 00:07:46.032 can chuck about 250 bitcoins worth of wood. [Laughter] At the 00:07:46.032 --> 00:07:49.836 time this was $20 --> 000. So being a good guy is hard. [Laughter] 00:07:49.836 --> 00:07:55.842 Running a dictionary is easy but the hard part the being good so 00:08:04.718 --> 00:08:07.487 I put myself in a wonderful little moral dilemma here 00:08:07.487 --> 00:08:11.324 because if I did absolutely nothing I am not that smart 00:08:11.324 --> 00:08:15.562 somebody else will figure out how to do the same thing I did 00:08:15.562 --> 00:08:20.166 and crack it and hey might not be as nice as me. So I had to 00:08:20.166 --> 00:08:26.272 come up with something to do so I thought the only thing I could 00:08:26.272 --> 00:08:31.511 think of to do was call my friend Dan Kaminsky, a admitted 00:08:31.511 --> 00:08:37.217 white hat. So an hour, hour and a half later I am Dan 00:08:37.217 --> 00:08:41.588 Kaminskys place all I have is Mr. Woodchucks bitcoin address 00:08:41.588 --> 00:08:48.695 and no direct way to contact him. So what do I do? We talked 00:08:48.695 --> 00:08:54.834 a while and we had this idea of sending chunk a few cents and 00:08:54.834 --> 00:09:00.173 taking it back for extra money there is tool called Vanity Gem. 00:09:00.173 --> 00:09:03.943 If youre not familiar with it it generates a shit ton of 00:09:03.943 --> 00:09:06.780 private keys until you get one that starts with a prefix you 00:09:06.780 --> 00:09:10.850 choose. But it has to be short otherwise it takes forever so a 00:09:10.850 --> 00:09:14.687 crude way to send a message. Cool. So my wife was there for 00:09:14.687 --> 00:09:19.726 moral support and listening to this and she pipes up with 00:09:19.726 --> 00:09:25.632 yoinked. If you are not familiar with that. [Laughter] It was 00:09:25.632 --> 00:09:32.005 perfect. So we send some money to chuck and take the money 00:09:32.005 --> 00:09:37.310 back. At this point I should clarify, bitcoin address does 00:09:37.310 --> 00:09:43.149 not hold a balance. It hold a previous transaction output. So 00:09:43.149 --> 00:09:47.954 there a separate 250 bitcoin transaction output that belongs 00:09:47.954 --> 00:09:54.294 the chuck and is . 00031337 bitcoin output that I just put 00:09:54.294 --> 00:09:59.632 there and hopefully Chuck will notice that this address can 00:09:59.632 --> 00:10:06.005 take money back from him after sending it and freak out about 00:10:06.005 --> 00:10:13.413 this and move his bitcoins so this was the plan and I send the 00:10:13.413 --> 00:10:20.854 money to Chuck and try the take it back because it is my money 00:10:20.854 --> 00:10:27.227 anyway but the bitcoin software had other plans so I get the 00:10:27.227 --> 00:10:34.133 money back to yoink address and the rest of it, the rest of 00:10:34.133 --> 00:10:39.439 Chucks 250 bitcoins go to some other address I don't 00:10:39.439 --> 00:10:45.812 recognize. You can imagine my reaction here. So Dan left for a 00:10:45.812 --> 00:10:52.719 while and told me to sort it out. [laughter] So once I calmed 00:10:52.719 --> 00:10:58.558 down a little bit I remember how bitcoin actually works. I 00:10:58.558 --> 00:11:03.863 thought it would just use the right amount transaction output 00:11:03.863 --> 00:11:09.702 which seems reasonable but turns out that it will choose outputs 00:11:09.702 --> 00:11:15.008 automatically based on the product of size and age. Well 00:11:15.008 --> 00:11:20.513 250 bitcoins that was put there several weeks ago is higher 00:11:20.513 --> 00:11:27.186 priority than a few pennies that I just put there. So I got that 00:11:27.186 --> 00:11:33.726 -- I got my fraction of penny of bitcoin and sent back to address 00:11:33.726 --> 00:11:38.565 and my change went to other address that the bitcoin wallet 00:11:38.565 --> 00:11:43.836 generated for me so I put the money back and only borrowed 00:11:43.836 --> 00:11:50.410 Chuck's money for a few minutes. It was fine. So I do this for a 00:11:50.410 --> 00:11:56.149 few days and he doesn't seem to notice that the coin is all 00:11:56.149 --> 00:12:00.086 still there. So cryptocurrency totally hard the trace. Well, 00:12:00.086 --> 00:12:05.792 I'm going to do it anyway. So I follow the bitcoins and quickly 00:12:05.792 --> 00:12:11.497 I find out that he was a minor from a bitcoin mining pool 00:12:11.497 --> 00:12:16.769 called deep bit which just so happens I happened to use back 00:12:16.769 --> 00:12:22.475 in 2011 on the web when GPU mining was a reasonable thing to 00:12:22.475 --> 00:12:29.515 do. So I got in touch with the guy with deep bit and I spent an 00:12:29.515 --> 00:12:34.354 hour on RIC convincing him that I was both crazy [Laughter] 00:12:34.354 --> 00:12:39.626 Im sorry, not crazy and a good guy. He was actually really 00:12:39.626 --> 00:12:45.331 good he was like no I'm not going to give you this guys 00:12:45.331 --> 00:12:49.736 e-mail address but I will pass along contact information for 00:12:49.736 --> 00:12:54.507 you. I cant complain about that. So he does this and the 00:12:54.507 --> 00:12:58.077 next morning I check my e-mail and I have this thing asking 00:12:58.077 --> 00:13:04.350 what the hell who am I what the hell is wrong with his bitcoins. 00:13:04.350 --> 00:13:10.156 The problem is I knew that the person I had gotten in touch 00:13:10.156 --> 00:13:14.627 with was the person that funded Brainwallet. Which is not 00:13:14.627 --> 00:13:19.132 necessarily the rightful owner of the brainwallet and the best 00:13:19.132 --> 00:13:26.272 way to sort this out was talk to guy on phone. So I did. He was 00:13:26.272 --> 00:13:29.642 really nice. I asked him if he knew what the brainwallet was 00:13:29.642 --> 00:13:35.214 and he did and I asked him if I he had money in there and he 00:13:35.214 --> 00:13:41.554 said he did and I said I knew what his pass phrase and I said 00:13:41.554 --> 00:13:47.427 I'm a nice guy but there are people that are not so nice and 00:13:47.427 --> 00:13:53.333 I hear his jaw hit the floor over the phone. He was very, as 00:13:53.333 --> 00:13:58.805 I said, he was very nice. I didn't tell him that I borrowed 00:13:58.805 --> 00:14:03.843 his bitcoins without asking. I felt it was better that way. He 00:14:03.843 --> 00:14:09.315 sent me two bitcoins for my trouble about I sent that to my 00:14:09.315 --> 00:14:14.353 friend as a wedding gift because I didnt want to make money 00:14:14.353 --> 00:14:19.425 off of the whole thing. He used his bitcoin and hes fine. 00:14:19.425 --> 00:14:24.464 Nothing bad happened to him which is great. And he wasn't an 00:14:24.464 --> 00:14:29.102 idiot. I talked to him and he realized that choosing a 00:14:29.102 --> 00:14:33.206 standard password would not protect his bitcoins but how 00:14:33.206 --> 00:14:38.911 many people actually have a good intuition of what is a password 00:14:38.911 --> 00:14:44.650 or pass phrase cracker can actually do. Show of hands, how 00:14:44.650 --> 00:14:50.356 many of you have use obscure quote or song lyrics or 00:14:50.356 --> 00:14:56.095 something like that as the encryption key or GPG wallet as 00:14:56.095 --> 00:15:00.767 the disc encryption. Anyone? I don't believe you. [Laughter] 00:15:00.767 --> 00:15:08.040 Well, lots of people do. I have done it and there is post of 00:15:08.040 --> 00:15:13.780 reddit about year, year and a half ago, somebody had put a 00:15:13.780 --> 00:15:17.617 couple bitcoins in brainwallet and his pass phrase was an 00:15:17.617 --> 00:15:23.956 obscure poem in Africaans and it got stolen. So which is small 00:15:23.956 --> 00:15:29.962 which is okay and the next thing for me to do is see if I can 00:15:32.465 --> 00:15:38.838 make my brainwallet cracker fast in order to just point out this 00:15:38.838 --> 00:15:45.211 is serious problem if you use these things you're going to get 00:15:45.211 --> 00:15:50.516 robbed. So brain flare. There is new [indiscernible] library that 00:15:50.516 --> 00:15:57.423 came out for bitcoin called Live SCPP 256 K1 which is named after 00:15:57.423 --> 00:16:02.728 the bitcoin [indiscernible] uses. Which is way faster. I got 00:16:02.728 --> 00:16:08.568 130 --> 000 pass phrases a second out of my machine. And a 00:16:08.568 --> 00:16:14.407 benchmark thats in SCPP too. 560 million pass phrases checked per 00:16:14.407 --> 00:16:20.246 dollar per instance time on C3 large instances. You can pretty 00:16:20.246 --> 00:16:26.085 easily call Amazon and call your instant limit bumped by is 00:16:26.085 --> 00:16:31.390 currently a couple thousand. With a thousand instances and a 00:16:31.390 --> 00:16:37.230 175 dollars you can check a trillion pass phrases in nine 00:16:37.230 --> 00:16:43.603 hours with this thing. But uh Wait. Yeah. So remember this? X 00:16:43.603 --> 00:16:49.575 case CD. So X case CD is not always right. Brain flare can 00:16:49.575 --> 00:16:53.179 cover that search space with a thousand instances in less than 00:16:53.179 --> 00:16:57.783 a week for about 28 hundred dollars, and bad guys don't use 00:16:57.783 --> 00:17:02.555 ECC2 well maybe but it will be somebody else's ECC2 instances. 00:17:02.555 --> 00:17:06.926 [Laughter] So they dont have to pay for it. And these also 00:17:06.926 --> 00:17:12.498 have BOT nets and these days a small bot net would be a 100 00:17:12.498 --> 00:17:17.670 thousand nodes. IF we want to get a nice lower bound we can 00:17:17.670 --> 00:17:22.441 assume that these nodes are 10 percent as fast as these ECC2 00:17:22.441 --> 00:17:27.613 instances which are not fast. And with that you can try 2 of 00:17:27.613 --> 00:17:33.185 the 48 passwords a day which is 275 trillion that is a lot of 00:17:33.185 --> 00:17:37.957 pass phrases. If is still not fast enough for you there is 00:17:37.957 --> 00:17:42.662 plenty of room for optimization and fancy math to make it go 00:17:42.662 --> 00:17:46.365 faster and this can definitely get your CPU accelerated and it 00:17:46.365 --> 00:17:49.368 can definitely be FTA accelerated. It can even be A6 00:17:49.368 --> 00:17:57.276 accelerated but I don't expect that to happen. Mining A6, mine 00:17:57.276 --> 00:18:00.112 bitcoins they can't do anything else. They cant even hash 00:18:00.112 --> 00:18:04.717 arbitrary data. They only hash blogs and if you want to get A6 00:18:04.717 --> 00:18:08.955 made for something you will drop a few million dollar to get a 00:18:08.955 --> 00:18:13.659 bad run done. I don't see that happening. How Brain Flare 00:18:13.659 --> 00:18:18.731 works. So the first thing you need to do is get a copy of 00:18:18.731 --> 00:18:22.835 block chain. The bitcoin block chain is currently about 40 gigs 00:18:22.835 --> 00:18:26.138 takes a few hours to download usually then you need to extract 00:18:26.138 --> 00:18:30.710 all the unique addresses from it and then preprocess those 00:18:30.710 --> 00:18:34.747 because checking one by one would be slow as hell and then 00:18:34.747 --> 00:18:39.051 we have out candidate pass phrase generation. We feed those 00:18:39.051 --> 00:18:42.054 in and calculate the corresponding addresses. We 00:18:42.054 --> 00:18:48.060 check them for matching address in the block chain and if there 00:19:02.074 --> 00:19:04.310 is a match, win! Bitcoin currently has had about 80 00:19:04.310 --> 00:19:06.746 million addresses used ever. I use a technique called a Bloom 00:19:06.746 --> 00:19:08.748 filter to check all of them, effectively simultaneously. 00:19:08.748 --> 00:19:10.750 Bloom Filter is like second or third year computer science 00:19:10.750 --> 00:19:14.086 stuff. If you don't know what it is go look it up on Wikipedia. I 00:19:14.086 --> 00:19:16.322 will give you a very brief explanation but the important 00:19:16.322 --> 00:19:19.458 thing is it tells you no match or there is a probably a match. 00:19:19.458 --> 00:19:22.128 So it does mean it has false positives but you can clean 00:19:22.128 --> 00:19:24.797 those up later and the likelihood of false positive is 00:19:24.797 --> 00:19:29.168 dependent on how much, it depends on the parameter of the 00:19:29.168 --> 00:19:33.205 filter and how many items have been inserted. The wave grain, 00:19:33.205 --> 00:19:36.809 frankly its built a parameter and you get about one false 00:19:36.809 --> 00:19:42.181 positive in every 380 million pass phrases with a hundred 00:19:42.181 --> 00:19:46.285 million addresses inserted why a hundred million and not 80 00:19:46.285 --> 00:19:50.356 million you can crack multiple block chains at once. Its 00:19:50.356 --> 00:19:54.860 just going to make your false positives a little higher. All 00:19:54.860 --> 00:19:59.498 of the out coins use the same format to load as many of them 00:19:59.498 --> 00:20:05.304 as you want to in there so you can check bitcoin brainwallet, 00:20:05.304 --> 00:20:10.376 dashcoin, lightcoin, whatever, all at the same time and it 00:20:10.376 --> 00:20:15.481 doesn't slow you down. So brainwallet uses, or brain flare 00:20:15.481 --> 00:20:22.088 uses 512 megabyte to filter this is two to three bits nice round 00:20:22.088 --> 00:20:28.194 number and each hash 160 is mapped to 20 different bits in 00:20:28.194 --> 00:20:34.333 the bit mask when we insert a hash 160 we insert the 00:20:34.333 --> 00:20:38.571 corresponding bits to check whether or not the hash 160 is 00:20:38.571 --> 00:20:42.341 present. We look through those bits one by one until we find 00:20:42.341 --> 00:20:45.745 one that is not set. If we find one that is not set we stop 00:20:45.745 --> 00:20:51.083 looking and say no match if we get through the end and they all 00:20:51.083 --> 00:20:55.287 there we say probable match. Normally with the Bloom filter 00:20:55.287 --> 00:21:00.359 you take your input and run it through a bunch of different 00:21:00.359 --> 00:21:04.997 hashes to generate the bits you don't have to use a 00:21:04.997 --> 00:21:09.635 cryptographic hash for this it just has to have a uniform 00:21:09.635 --> 00:21:14.140 distribution. Usually something like XX hash is used. It is 00:21:14.140 --> 00:21:21.347 called hash 160 already hashed so we cheat. We just bit slice 00:21:21.347 --> 00:21:25.584 the thing and cut it up into chunks and combine in different 00:21:25.584 --> 00:21:28.587 ways and this turns out to work very well and it takes huge CMU 00:21:28.587 --> 00:21:33.826 cycles per hash 160. Super fast. Candidate passphrase generation 00:21:33.826 --> 00:21:40.666 is tricky. Wordless for password cracking not so easy to find. 00:21:40.666 --> 00:21:46.972 Passphrase less though so I did some scraping. Song lyrics, 00:21:46.972 --> 00:21:50.676 Wikipedia, WikiQuote, project Gutenberg, reforms, like 00:21:50.676 --> 00:21:54.480 bitcoin, Reddit, the cypher punks mailing list, whatever. 00:21:58.884 --> 00:22:02.988 And then you have all this raw data so you have the clean it 00:22:02.988 --> 00:22:06.091 up. Every source is going to require different clean up so 00:22:06.091 --> 00:22:10.029 I'm not going to go in how to do that but use your favorite 00:22:10.029 --> 00:22:13.132 scripting language. It is not hard. Once youve got a clean 00:22:13.132 --> 00:22:16.702 list of phrases. You can run rules against them. So you can 00:22:16.702 --> 00:22:20.940 try it with normal capitalization, all caps, all 00:22:20.940 --> 00:22:26.946 lower case initial caps with or without punctuation or with or 00:22:30.683 --> 00:22:36.689 without spaces. Some results. [Laughter] So the QTC1 I am sure 00:22:40.426 --> 00:22:46.432 somebody found and they just burned the coins. It got sent to 00:22:48.567 --> 00:22:52.338 an invalid address. So those coins are gone forever, it was 00:22:52.338 --> 00:22:56.141 about 2 bitcoins. I think that is Texas Social Security number. 00:22:56.141 --> 00:23:02.281 And the memory is the name of that melty clock painting made 00:23:02.281 --> 00:23:08.954 by Dahli. That had bitcoin when I found it but I could not 00:23:08.954 --> 00:23:15.094 figure out how to contact that guy. I used gambling sites. But 00:23:15.094 --> 00:23:22.234 those dont make you register so I had no way to get in touch 00:23:22.234 --> 00:23:28.908 with him. I don't know if he cleaned it out himself or got 00:23:28.908 --> 00:23:34.013 robbed. Unfortunately. Even for of these ones are tiny amounts. 00:23:34.013 --> 00:23:38.484 So [Luaghter] There were a lot of and ran quotes. A lot of 00:23:38.484 --> 00:23:43.956 them looks like they were put there for people to find. They 00:23:43.956 --> 00:23:49.895 had like a tiny fraction of the penny of bitcoin in them but 00:23:49.895 --> 00:23:56.302 good times. So I went through all of ones that I was able to 00:23:56.302 --> 00:24:02.241 crack added up to 733 bitcoins. I mean this is starting in 2011 00:24:02.241 --> 00:24:07.279 and going through I think I scraped the block chain last 00:24:07.279 --> 00:24:12.284 some time in June. I didn't necessarily find any of these 00:24:12.284 --> 00:24:18.691 while they had balance but a lot of them did have money in them 00:24:18.691 --> 00:24:23.962 at some point and it is very very hard to tell which ones 00:24:23.962 --> 00:24:28.634 were stolen from and which ones the owner just moved the money 00:24:28.634 --> 00:24:32.438 out. To be clear, I did not take any of it with the exception of 00:24:32.438 --> 00:24:36.241 borrowing a little bit of Chucks bitcoin for a few 00:24:36.241 --> 00:24:40.713 minutes, on accident. So dont be Chuck. Any password or phrase 00:24:40.713 --> 00:24:46.618 phrase that you can come up with on your own, can be found by a 00:24:46.618 --> 00:24:49.288 cleverer guesses algorithm and if somebody else came up with 00:24:49.288 --> 00:24:51.690 it, it will end up in a word list or phrase list at some 00:24:51.690 --> 00:24:59.031 point and there is better ways to do this. There is a light 00:24:59.031 --> 00:25:02.735 weight bitcoin wallet called Electrum. It does a nice little 00:25:02.735 --> 00:25:07.039 thing. It will randomly generate a master key and export this for 00:25:07.039 --> 00:25:11.343 you as 12 words just memorize those 12 words and you can 00:25:11.343 --> 00:25:14.446 restore your wallet. It doesnt give you just one 00:25:14.446 --> 00:25:18.183 address, it gives you as many addresses as you want. Pretty 00:25:18.183 --> 00:25:22.888 convenient. And then I mentioned earlier, work wallet which does 00:25:22.888 --> 00:25:27.059 support a salt. They recommend you use your e-mail address you 00:25:27.059 --> 00:25:32.197 can use your full name or ID number or whatever. And it uses 00:25:32.197 --> 00:25:37.336 S crypt for hardening but I have not benchmarked it but I would 00:25:37.336 --> 00:25:42.107 be impressed if you could make a hundred guesses a second against 00:25:42.107 --> 00:25:45.644 it. Then theres my personal favorite encrypted paper wallet. 00:25:45.644 --> 00:25:50.015 Which is where you print out an encrypted version of your 00:25:50.015 --> 00:25:54.753 private key. The encryption is hardened with s crypt so even if 00:25:54.753 --> 00:26:00.292 you find one of these things you still have the crack it and if 00:26:00.292 --> 00:26:04.630 you know somebody found it and you have another one somewhere 00:26:04.630 --> 00:26:10.335 else you keep one in the bank vault and one under your bed you 00:26:10.335 --> 00:26:12.337 can get the other copy and remove your funds before they 00:26:12.337 --> 00:26:18.477 crack it. Im a big fan of this one. So a lot of people 00:26:18.477 --> 00:26:23.615 spend a lot of time trying to figure out how to determine how 00:26:23.615 --> 00:26:27.953 strong a password corps phrase is. Really easy when computer 00:26:27.953 --> 00:26:30.956 generated randomness. If youre willing to assume the 00:26:30.956 --> 00:26:33.058 random number generator is good, then all you have to do is count 00:26:33.058 --> 00:26:37.129 the bits. Each bits doubles the strength, each 10 bits increases 00:26:37.129 --> 00:26:42.701 by a thousand fold. When is person chooses it is more 00:26:42.701 --> 00:26:46.705 complicated. Randomness and unpredictableness end up being 00:26:46.705 --> 00:26:50.976 more or less the same thing and needs predictable and I know you 00:26:50.976 --> 00:26:55.881 have used pony sites that will give you a password strength 00:26:55.881 --> 00:26:59.585 meter and you noticed that password strength meters do not 00:26:59.585 --> 00:27:04.957 agree with each other and the best ones I have seen a team by 00:27:04.957 --> 00:27:09.328 drop box, its called ZXCVBNM. If you are confused by that 00:27:09.328 --> 00:27:12.431 name, look at the bottom of the pretty keyboard. And It works 00:27:12.431 --> 00:27:16.935 pretty well but does have limitations and failure cases. 00:27:16.935 --> 00:27:22.040 Most of which are caused by the inherently limited dictionary 00:27:22.040 --> 00:27:27.012 size that is such a tool can have. I ran a few things through 00:27:27.012 --> 00:27:34.319 it. Quick Evo Hash read it has 42 bits of entropy but that word 00:27:34.319 --> 00:27:41.293 that Bart played on the Simpson and that is on the word list. 00:27:41.293 --> 00:27:46.865 1234567 which is the kind of [indiscernible] an idiot would 00:27:46.865 --> 00:27:53.805 use on his brainwallet. Rated as 92.90 bits of entropy, which 00:27:53.805 --> 00:27:58.877 would take centuries to crack. So clearly, these estimates are 00:27:58.877 --> 00:28:03.448 not credible. Microsoft did a study where that determined that 00:28:03.448 --> 00:28:07.586 the average users password was about 40 bits in strength. 00:28:07.586 --> 00:28:13.325 Rat. You can make things better with key stretching which is a 00:28:13.325 --> 00:28:18.330 must have in any modern encryption or password hashing 00:28:18.330 --> 00:28:25.003 application. The idea is you just make the hash take a lotted 00:28:25.003 --> 00:28:31.109 of CPU time. If it take a hundred mill seconds for 00:28:31.109 --> 00:28:37.783 legitimate users the password to be checked not a big deal be 00:28:37.783 --> 00:28:42.421 youre going to make a cracker really sad if they have to spend 00:28:42.421 --> 00:28:44.990 a hundred milliseconds each time. Even if they super 00:28:44.990 --> 00:28:48.293 optimize it, they are checking dozens of hundreds of passwords 00:28:48.293 --> 00:28:53.599 a second. Which sucks for them. And brain flare does 130 --> 000 a 00:28:53.599 --> 00:28:58.971 second on one computer and stretching could make that one 00:28:58.971 --> 00:29:03.241 per second. Easily. Common algorithms S crypt, d crypt, 00:29:03.241 --> 00:29:06.511 shop [indiscernible] which is not the same as shop I 12. 00:29:06.511 --> 00:29:12.184 [Indiscernible] to some sort of stuff. There is a password 00:29:12.184 --> 00:29:16.488 hashing competition which was just recently completed. They 00:29:16.488 --> 00:29:24.363 announced the winner as argon 2. I need to read up about that, it 00:29:24.363 --> 00:29:29.034 sounds really interesting. You end up being able to increase 00:29:29.034 --> 00:29:34.740 strength by about a million fold using key stretching. And it is 00:29:34.740 --> 00:29:42.414 not that expensive of a trade off. But you can do more. There 00:29:42.414 --> 00:29:46.251 is extreme key stretching. I came up with this but I have 00:29:46.251 --> 00:29:49.388 seen other people talk about it as well, so its not that 00:29:49.388 --> 00:29:55.327 clever of an idea. So what you want to so a have a short value 00:29:55.327 --> 00:30:01.199 say five digits, six digits something like that that is 00:30:01.199 --> 00:30:06.204 written down or stored on a disc, this is shortcut and run 00:30:06.204 --> 00:30:12.744 through its own key function. And if you have the shortcut and 00:30:12.744 --> 00:30:17.582 the pass phrase it takes hundred mill seconds a second to 00:30:17.582 --> 00:30:22.154 recompute the key or verify it. If youre missing the shortcut 00:30:22.154 --> 00:30:27.125 you have to brute force it. The legitimate user having the pass 00:30:27.125 --> 00:30:31.697 phrase as a password can recovery their shortcut in a few 00:30:31.697 --> 00:30:38.003 hours or a day or so but the attacker has to spend that long 00:30:38.003 --> 00:30:42.407 on every pass phrase or password they check. But then, who has 00:30:42.407 --> 00:30:46.478 time for that? Pretty easy to generate a secure password or 00:30:46.478 --> 00:30:49.047 pass phrase. Generate it randomly. [Indiscernible] is 00:30:49.047 --> 00:30:54.553 great. You might not be able -- if you have a lot of these you 00:30:54.553 --> 00:31:00.092 may not be able to remember them all but you need a back up the 00:31:00.092 --> 00:31:04.496 password managers can do that. But you need a master password 00:31:04.496 --> 00:31:07.566 for your password manager and you need to back up the password 00:31:07.566 --> 00:31:12.938 manager. And then the back ups can be cracked and turtles all 00:31:12.938 --> 00:31:16.908 the way down. You still have to memorize at least one strong 00:31:16.908 --> 00:31:23.148 pass phrase or password. I want to go over about what I have 00:31:23.148 --> 00:31:27.919 seen actual brainwallet thieves actually doing in the wild. 00:31:27.919 --> 00:31:33.892 There seems to be about half a dozen of them currently. 00:31:33.892 --> 00:31:37.062 Theyre pretty sophisticated. I have seen them do crazy things 00:31:37.062 --> 00:31:42.501 like looking for brainwallets as part of multi stig addresses. If 00:31:42.501 --> 00:31:47.139 you don't know what that means don't worry about it. And they 00:31:47.139 --> 00:31:52.544 compete with each other and they have to be fast and they are not 00:31:52.544 --> 00:31:57.315 going to be fast enough manually so they have BOTs. Cracking with 00:31:57.315 --> 00:32:00.452 brain flare or something like it, isnt real time. It would 00:32:00.452 --> 00:32:06.158 be too slow. Rainbow tables are lot faster than actually fully 00:32:06.158 --> 00:32:10.428 graphing but they are also kind of slow so look up tables are 00:32:10.428 --> 00:32:16.368 the only option. And some of these guys seem to have a big 00:32:16.368 --> 00:32:22.707 look up tables. If I were going to build these things I have not 00:32:22.707 --> 00:32:29.548 but if I were, I would go with a disc key that the value store 00:32:29.548 --> 00:32:34.553 using you know whatever sequel data base is popular that day. 00:32:34.553 --> 00:32:40.692 Use a truncated hash 256 as the key. The pass phrase or private 00:32:40.692 --> 00:32:44.596 key has a value whichever one is shorter. Then you just have to 00:32:44.596 --> 00:32:47.966 monitor the transaction. You can't monitor the block chain. 00:32:47.966 --> 00:32:52.470 You have to actively monitor the network. Because by the time it 00:32:52.470 --> 00:32:55.841 is in a block, somebody else has, whos monitoring 00:32:55.841 --> 00:32:59.978 transactions. has already gotten it. So you have to talk to 00:32:59.978 --> 00:33:04.516 network and then when you see a private key, or an address that 00:33:04.516 --> 00:33:07.886 you a private key for you sweep it off to your own address and 00:33:07.886 --> 00:33:13.959 do this faster than the other guys that are doing this. So a 00:33:13.959 --> 00:33:20.031 $120. 04 tera byte hard drive should be big enough for that 64 00:33:20.031 --> 00:33:25.637 billion pass codes or pass phrases or words. In the wild, I 00:33:25.637 --> 00:33:31.209 am pretty sure I can confidently say that somebody has one with 00:33:31.209 --> 00:33:35.881 at least a hundred billion entries. Because they are able 00:33:35.881 --> 00:33:40.552 to instantly crack any 5 character password I put out. 00:33:40.552 --> 00:33:44.289 Like including any numbers, letters and special characters, 00:33:44.289 --> 00:33:47.692 symbols. Instantly. Anything on common word lists also is done 00:33:47.692 --> 00:33:55.367 instantly. Many songs, lyrics, lyrics that sort of thing that 00:33:55.367 --> 00:34:00.372 vanishes instantly. Six random characters I tried a few of and 00:34:00.372 --> 00:34:04.743 the ones that I have made have not been stolen yet. So this is 00:34:04.743 --> 00:34:09.147 clearly a little bit too big. But brain flare can go through 00:34:09.147 --> 00:34:15.253 that space on EC2 for 1300 dollars. If you actually want to 00:34:15.253 --> 00:34:20.325 memorize something secure,crypto neumonics are the way to go. A 00:34:20.325 --> 00:34:25.897 device that has been around forever, the idea is that you 00:34:25.897 --> 00:34:30.902 take a big list of words and you roll some casino dice. So you 00:34:30.902 --> 00:34:34.606 pick words from that list and your pass phrase is made up of 00:34:34.606 --> 00:34:41.246 those words. Electro images as I said earlier, also exist. It is 00:34:41.246 --> 00:34:43.682 also pronounce able password generators I don't think they 00:34:43.682 --> 00:34:47.018 work that well but some people like them. Then there is 00:34:47.018 --> 00:34:52.190 structured generators. Um this is trying to not only come up 00:34:52.190 --> 00:34:57.128 with words but to put those words together in meaningful 00:34:57.128 --> 00:35:04.569 combinations. You can do adjective noun verb topples, use 00:35:04.569 --> 00:35:09.441 a mark up chain to generate what looks like sentences. That sort 00:35:09.441 --> 00:35:16.581 of thing. It seems like it's go to be easy to remember but a lot 00:35:16.581 --> 00:35:22.153 of research going on this and I expect this to improve in the 00:35:22.153 --> 00:35:28.159 wild soon. So your meet is predictable. Don't use it to 00:35:30.395 --> 00:35:34.265 generate passcode or pass phrases. Dont be robbed. So I 00:35:34.265 --> 00:35:40.872 figured I would make this fun for everyone. So DefCoin exists. 00:35:40.872 --> 00:35:45.744 Its a crypto currency for Defcon. Coin based contests, 00:35:45.744 --> 00:35:52.417 they use it. The Crack Me if You Can folks were helpful enough, 00:35:52.417 --> 00:35:56.321 or kind enough to make me a bunch of passwords and pass 00:35:56.321 --> 00:36:01.493 phrases to use as brain wallets. So brain flare will be online 00:36:01.493 --> 00:36:07.866 shortly. And I'm going to over the next hour of so make a bunch 00:36:07.866 --> 00:36:13.271 of DefCoin brain wallets. So if you want some DefCoin, you can 00:36:13.271 --> 00:36:17.776 download brain flare and hopefully you can be faster than 00:36:17.776 --> 00:36:22.280 everybody else here. And I will announce this on twitter when it 00:36:22.280 --> 00:36:28.286 is done which should be within an hour or two. Any questions? 00:36:35.994 --> 00:36:42.000 Got it? Are we doing a line or just shouting at people? 00:36:52.310 --> 00:36:56.881 [Inaudible question from audience] Yup, in fact somebody, 00:36:56.881 --> 00:37:01.853 theres a.. Alright, he asked it seems the big problem here is 00:37:01.853 --> 00:37:07.826 that brainwallets dont just use shot 56. He is exactly 00:37:07.826 --> 00:37:12.464 right. A popular site for making these things is brainwallet.org 00:37:12.464 --> 00:37:16.768 and theyre on Github and somebody actually submitted a 00:37:16.768 --> 00:37:21.873 patch to upgrade to, upgrade it to a hardened hash and the guy 00:37:21.873 --> 00:37:27.712 rejected the patch with some explanation of well elliptic or 00:37:27.712 --> 00:37:33.651 public key derivation is slow so this is unnecessary. This guy 00:37:33.651 --> 00:37:38.323 has been accused of cracking brainwallets himself. And yeah 00:37:38.323 --> 00:37:44.329 his site will default to empty string as a pass phrase and no 00:37:46.631 --> 00:37:52.403 complexity requirements enforced so okay. Who is next? You. 00:37:54.939 --> 00:37:57.509 [Inaudible question from audience] He asked if inserting 00:37:57.509 --> 00:38:03.882 spaces in a password or pass phrase would strengthen it 00:38:03.882 --> 00:38:08.987 sufficiently? No adding spaces does not significantly increase 00:38:08.987 --> 00:38:14.359 the strength of the password length. It really doesnt 00:38:14.359 --> 00:38:18.530 matter, its complexity that matters. I think you were first. 00:38:26.037 --> 00:38:28.506 [Inaudible question from audience] He asked if 00:38:28.506 --> 00:38:32.410 deterministic wallets can have the same problem. BitCoin has 00:38:32.410 --> 00:38:37.081 hierarchical deterministic wallets. If you seeded them with 00:38:37.081 --> 00:38:44.088 a pass phrase that you chose yourself then yes, it would have 00:38:44.088 --> 00:38:50.528 the same problem depending upon whether or not if hardening or 00:38:50.528 --> 00:38:54.332 salting was used. Electrum is the most popular took that does 00:38:54.332 --> 00:38:56.467 this and it will choose a pass phrase for you so you dont 00:38:56.467 --> 00:39:02.473 have that problem. [Inaudible question from audience] Does 00:39:06.344 --> 00:39:10.248 adding spaces or capitalization to a password actually weaken it 00:39:10.248 --> 00:39:16.321 under any circumstances? Oh if like someone hears you type it. 00:39:16.321 --> 00:39:22.627 If someone is hearing you type passwords and is using this 00:39:22.627 --> 00:39:28.132 against you have other problems. [Laughter] But I mean the 00:39:28.132 --> 00:39:30.702 weakest version of any pass phrase is going to be one that 00:39:30.702 --> 00:39:34.806 appears verbatim somewhere. So if you strip all the spaces it 00:39:34.806 --> 00:39:39.177 would be very, very, very slightly stronger but if 00:39:39.177 --> 00:39:42.914 youre relying on this to save you will be disappointed. Anyone 00:39:42.914 --> 00:39:49.287 else? [Inaudible question from audience] There was that one in 00:39:49.287 --> 00:39:55.660 Afrikaans. I found some in Chinese and Russian. You said 00:39:55.660 --> 00:40:00.932 any multi language,like two languages in them. I didn't find 00:40:00.932 --> 00:40:06.170 one but I don't think the list I was using had anything like that 00:40:06.170 --> 00:40:08.906 in them. So there might be I just didn't find them. 00:40:12.110 --> 00:40:16.080 [Inaudible question from audience] I can't hear you. 00:40:16.080 --> 00:40:19.384 [Inaudible question from audience] I had slides with 00:40:19.384 --> 00:40:23.554 examples on there. There was definitely Use the Force, Luke 00:40:23.554 --> 00:40:29.560 in there. Anybody else? [Inaudible question from 00:40:40.972 --> 00:40:43.341 audience] Oh yeah, Im sorry I did skip over that. He is asking 00:40:43.341 --> 00:40:47.178 how I figured out what people are actually doing. The answer 00:40:47.178 --> 00:40:54.118 is I made bait wallets. So you know I made this mental model of 00:40:54.118 --> 00:40:58.156 how I would steal brain wallets if I were going to do it. I 00:40:58.156 --> 00:41:03.995 realized they are going to have BOTS and so if I send a small 00:41:03.995 --> 00:41:08.533 amount of bitcoin to a weak brainwallet any BOTS capable of 00:41:08.533 --> 00:41:13.471 stealing it will steal it. So I was able to use their theft BOTS 00:41:13.471 --> 00:41:18.710 as an oracle against their look up tables; and then by doing 00:41:18.710 --> 00:41:23.614 some [indiscernible] forensics, I was able to get some idea, a 00:41:23.614 --> 00:41:29.620 rough idea of how many of them there are. Anyone else? Way in 00:41:32.357 --> 00:41:37.428 the back. [Inaudible question from audience] Are you saying it 00:41:37.428 --> 00:41:43.434 is too small or too big by a factor of 10. [Inaudible comment 00:41:45.903 --> 00:41:51.542 from audience] He is saying that my math was wrong. One second. 00:41:51.542 --> 00:41:57.715 My assumption is that storing a single pass phrase takes a 00:41:57.715 --> 00:42:02.820 hundred bites. [Inaudible] Right. If you know what the 00:42:02.820 --> 00:42:07.892 dictionaries are you still have to store the dictionaries 00:42:07.892 --> 00:42:14.298 somewhere. So your dictionary is taking up space either way. So 00:42:14.298 --> 00:42:20.304 you can't optimize it that much. [Inaudible] Im sorry I am 00:42:23.641 --> 00:42:29.647 having a little bit of trouble hearing you. [Inaudible comment 00:42:32.517 --> 00:42:39.157 from audience] Right but the look up table has the dictionary 00:42:39.157 --> 00:42:45.163 words or the private keys themselves. Find me later and we 00:42:47.298 --> 00:42:51.002 can talk about this. (Applause)