1 00:00:00,000 --> 00:00:05,160 Caudill and Taylor Hornby will be presenting the underhanded crypto contest winners. Take 2 00:00:05,160 --> 00:00:12,900 the way, guys. Thank you so much. And thank you, everybody, for showing up today. So here we 3 00:00:12,900 --> 00:00:21,400 are at the end of the fifth annual underhanded crypto contest. Underhanded cryptography 4 00:00:21,400 --> 00:00:30,120 contest. Let's make that clear. So I am Adam Caudill, one of the co-founders of the 5 00:00:30,120 --> 00:00:34,740 contest here with Taylor Hornby. And Taylor, I will let you take it away. All right. Cool. 6 00:00:34,980 --> 00:00:41,360 Thanks. So just in case you haven't heard about us, we've been doing this for five years. 7 00:00:42,660 --> 00:00:47,300 Basically the way it works is every year we ask you to send us your best ideas for 8 00:00:47,300 --> 00:00:51,380 cryptography back doors, whether it's in the protocols or in the code that we're 9 00:00:51,380 --> 00:00:55,900 implementing or whatever, as long as it has something to do with back doors and something to 10 00:00:55,900 --> 00:01:01,660 do with cryptography, then we're going to be interested in it. And you really do want to send 11 00:01:01,660 --> 00:01:08,560 us your ideas because we hand out prizes every year. So why do we do this? Obviously we're 12 00:01:08,560 --> 00:01:13,780 derived from the underhanded C contest. And one of the things I really liked about the 13 00:01:13,780 --> 00:01:18,700 underhanded C contest was it's the perfect thing you can point to if someone says, oh, all 14 00:01:18,700 --> 00:01:21,360 these people have looked over this code and they haven't found anything. So we're going to 15 00:01:21,360 --> 00:01:26,280 try to find out if there's any problems in it. So it must be okay. You can kind of point to the 16 00:01:26,280 --> 00:01:31,500 underhanded C contest and say, no, actually if someone's trying to hide mistakes in code, it 17 00:01:31,500 --> 00:01:37,260 can be actually quite hard to find them. And we're kind of the same thing for cryptography. So 18 00:01:37,260 --> 00:01:42,600 if a company is claiming their product is secure because they're using AS256 and all these 19 00:01:42,600 --> 00:01:47,020 secure primitives, no, that's actually not enough. You need to dive deeper and look at the 20 00:01:47,020 --> 00:01:51,220 protocol and look at the designs and look at the implementation and find the problem 21 00:01:51,220 --> 00:01:58,480 there. Another reason we do this is because I think once we start to collect a lot of 22 00:01:58,480 --> 00:02:06,260 examples of what people do when they try to put backdoors into things, we'll start to catch on to 23 00:02:06,260 --> 00:02:11,260 the patterns that people try to use to hide backdoors. And once we see enough examples, maybe 24 00:02:11,260 --> 00:02:18,100 we'll get better at finding actual intentional backdoors in crypto in practice. And my favorite 25 00:02:18,100 --> 00:02:21,200 reason for doing this is it's kind of like a, it's kind of like a, it's kind of like a 26 00:02:21,980 --> 00:02:27,460 playground where you can invent your own vulnerability. So imagine, imagine you're doing a 27 00:02:27,460 --> 00:02:34,800 security audit and you're chasing a vulnerability and it just turns out that by some accident the 28 00:02:34,800 --> 00:02:38,420 vulnerability isn't exploitable and you can't write it up in your audit report because it's not 29 00:02:39,080 --> 00:02:43,260 exploitable. Well, submit it to this contest because that would be a good backdoor. If it's 30 00:02:43,260 --> 00:02:48,080 something that could happen by accident, that's a great property of a backdoor because it's 31 00:02:48,080 --> 00:02:51,200 deniable. Yeah. So, yeah, I think that's it. Thank you. Thank you. Thank you. Thank you. Thank you. 32 00:02:51,200 --> 00:03:00,440 That's why we do this. So this year we were sponsored by the Zcash Foundation and NCC Group 33 00:03:00,440 --> 00:03:07,760 Cryptography Services. So just a little bit about our sponsors. The Zcash Foundation is a 501c3 34 00:03:07,760 --> 00:03:14,800 non-profit supporting research and development for Internet payments and privacy stuff. So they 35 00:03:14,800 --> 00:03:19,980 focus on Zcash but I think their scope is a little broader than that. So if you work in that area, you 36 00:03:19,980 --> 00:03:21,180 might want to check out Zcash.com. All right. Thank you. Thank you. Thank you. Thank you. Thank you. 37 00:03:21,180 --> 00:03:21,460 All right. Thank you. Thank you. Thank you. Thank you. Thank you. They have a meeting. 38 00:03:21,460 --> 00:03:24,180 Don't worry if they're doing the first part there. They're by annual grants. They might be able to 39 00:03:24,180 --> 00:03:28,960 help you fund your work. NCC Group, if you haven't heard of them, they're one of the top 40 00:03:28,960 --> 00:03:34,800 firms doing security consulting, especially with their cryptography services division. They're 41 00:03:34,800 --> 00:03:41,640 really talented people. And before we get into the actual three submissions that we got this 42 00:03:41,640 --> 00:03:47,240 year, I want to give a really special thanks to J.P. for helping us judge again. He's been with 43 00:03:47,240 --> 00:03:51,160 us since the beginning. And to be honest, sometimes some of the NCC group people don't know who we're 44 00:03:51,160 --> 00:03:55,260 trees are way above my level of understanding. So if it wasn't 45 00:03:55,260 --> 00:04:00,760 for his expertise, it would be hard to do this contest. So, 46 00:04:00,860 --> 00:04:07,040 okay. Let's see who came in third. This is a bash script 47 00:04:07,720 --> 00:04:13,140 James sent us. And basically what it is, is you're supposed 48 00:04:13,140 --> 00:04:17,200 to give it a bunch of files as command line arguments. And what 49 00:04:17,200 --> 00:04:20,500 it's going to do is it's going to encrypt each file with a 50 00:04:20,500 --> 00:04:23,540 random password and then at the end print out all the passwords 51 00:04:23,540 --> 00:04:26,000 so that you can save them and then decrypt your files later. 52 00:04:26,740 --> 00:04:31,040 But the way it does that is it's appending the passwords to a 53 00:04:31,040 --> 00:04:36,220 temporary file, which is fine. But then it reads the entire 54 00:04:37,920 --> 00:04:41,720 file full of passwords into an array. And so the password we 55 00:04:41,720 --> 00:04:44,580 want to use to encrypt this file is going to be the last 56 00:04:44,580 --> 00:04:46,680 element in the array. It's the last password that was 57 00:04:46,680 --> 00:04:50,100 generated. And what this code here in bold does is it 58 00:04:50,500 --> 00:04:53,760 supposed to access the last element of the array. But of 59 00:04:53,760 --> 00:04:57,400 course it doesn't. It accesses one past the last element. And 60 00:04:57,400 --> 00:05:00,220 that means all the files are going to be basically encrypted 61 00:05:00,220 --> 00:05:04,280 with the empty string. So trivially decryptable files. 62 00:05:06,340 --> 00:05:14,280 Moving on to second place, Ella Rose sent us a neat key 63 00:05:14,280 --> 00:05:20,460 agreement protocol. And the way this works is there's two public parameters called e 64 00:05:20,500 --> 00:05:25,600 and n. And so when Alice is generating her key pair, she just 65 00:05:25,600 --> 00:05:30,080 generates a random 256-bit number called x and that's her private 66 00:05:30,080 --> 00:05:33,900 key. And then to get her public key, she takes x, multiplies it 67 00:05:33,900 --> 00:05:39,060 by this huge number e, adds another random number r, which I 68 00:05:39,060 --> 00:05:44,280 won't tell you the details of, and then does that modulo n. And 69 00:05:44,280 --> 00:05:48,260 then that's her public key. Bob does the same thing to get a 70 00:05:48,260 --> 00:05:50,480 public and private key pair. And then she takes the public key and 71 00:05:50,500 --> 00:05:54,360 then when Alice and Bob come together and they want to agree on a shared 72 00:05:54,360 --> 00:06:00,760 secret, they, um, basically Alice will take her private key, multiply it with Bob's 73 00:06:00,760 --> 00:06:05,000 public key, and Bob will take his private key and multiply that with Alice's public key. 74 00:06:05,180 --> 00:06:12,100 And because of the way the sizes of all these numbers are tuned, if they just chop off 75 00:06:12,100 --> 00:06:19,160 everything except the first 256 bits, those 256 bits that are left will agree and they can use 76 00:06:19,160 --> 00:06:19,900 those as a key. 77 00:06:20,500 --> 00:06:24,920 So this is the backdoor key agreement scheme. Where's the backdoor? Well, the backdoor is in 78 00:06:24,920 --> 00:06:33,440 this parameter e here. And I'll explain how that works. So basically we're going to pick e to be 79 00:06:33,440 --> 00:06:40,440 special in some way. And the way that we're going to do that is, um, well, first idea, the 80 00:06:40,440 --> 00:06:48,680 simplest way to do this is just pick e so that its multiplicative inverse is small, modulo n. And 81 00:06:48,680 --> 00:06:50,480 so we'll call its multiplicative inverse d. And then we're going to pick e so that its multiplicative 82 00:06:50,500 --> 00:06:56,620 inverse is d. And if you have a small multiplicative inverse d, then you can just take Alice's, uh, 83 00:06:56,880 --> 00:07:04,820 Alice's public key, which is, uh, x, uh, sorry, it's ey plus z. So, uh, sorry, no, that's not it. 84 00:07:04,920 --> 00:07:12,880 It's ex plus r. And if you multiply that with d, the d and the e are going to cancel out because d is 85 00:07:12,880 --> 00:07:20,480 e's multiplicative inverse, mod n. And so what you're left with, um, is x plus dr, which is 86 00:07:20,500 --> 00:07:27,540 mod n. And now you can actually pick, uh, you can pick g so that d is small enough so that x plus 87 00:07:27,540 --> 00:07:35,820 dr is less than n. So taking the mod is not doing anything. You actually have x plus dr. And then 88 00:07:35,820 --> 00:07:44,100 once you have x plus dr, you can further constrain e so that d has the property that x is less 89 00:07:44,100 --> 00:07:50,480 than d. And once you have x plus dr you just take that mod d, the dr turns into zero. And if you go to mod 90 00:07:50,480 --> 00:07:56,160 and you just get X. So we've recovered Alice's private key. That's kind of too easy because 91 00:07:56,160 --> 00:08:02,200 everybody in the world knows E. It's a public parameter of the crypto system. So we need to 92 00:08:02,200 --> 00:08:08,560 make this a little bit harder for other people to exploit. And the way that this works is 93 00:08:08,560 --> 00:08:16,100 instead of making E have a small multiplicative inverse mod N, you make it have a small 94 00:08:16,100 --> 00:08:22,720 multiplicative inverse mod N minus K, where K is some random number. And it turns out that if 95 00:08:22,720 --> 00:08:31,320 you pick the size of K just right, then it's still true that if you multiply by D and then do 96 00:08:31,320 --> 00:08:38,120 mod D, you still get Alice's private key. So it still works. But it also, the contestant makes 97 00:08:38,120 --> 00:08:44,080 an argument that actually if you don't know K, if you don't know the secret K, then you can't 98 00:08:44,080 --> 00:08:46,080 actually use the back door. It's as hard as breaking the code. So if you don't know the 99 00:08:46,100 --> 00:08:54,960 secret K, you can't actually use the back door. So yeah, I think that's pretty cool. Now on to 100 00:08:54,960 --> 00:09:00,880 the first place winner. This one is actually really simple, but it's kind of effective. So the 101 00:09:00,880 --> 00:09:07,760 idea is if you're going to do elliptic curve cryptography, then you ought to just use a 102 00:09:07,760 --> 00:09:13,040 standard curve that like people have researched and studied and like believe is like a good curve 103 00:09:13,040 --> 00:09:16,080 to use for elliptic curve crypto. But if you're going to do elliptic curve cryptography, then 104 00:09:16,100 --> 00:09:21,900 maybe someone might want to make a protocol where the curve itself is negotiated as part of the 105 00:09:21,900 --> 00:09:29,660 protocol. And obviously there are curves that aren't safe for use with elliptic curve crypto. So 106 00:09:29,660 --> 00:09:33,240 the protocol is going to need to check some properties of the curve to make sure that's 107 00:09:33,240 --> 00:09:41,340 secure. And what this submission does is it's basically saying you can have the protocol make a 108 00:09:41,340 --> 00:09:46,080 bunch of checks of properties of the curve that's checking for all of the curves. And then you can 109 00:09:46,080 --> 00:09:50,060 see all of these properties it needs to have in order to be secure. But unless you're a 110 00:09:50,060 --> 00:09:54,720 cryptographer and you're familiar with elliptic curve crypto, you're probably not going to be 111 00:09:54,720 --> 00:09:59,840 aware of every single check that needs to be made. So you can just leave one of them out and 112 00:09:59,840 --> 00:10:06,260 then everybody who doesn't read obscure elliptic curve papers will not realize that the protocol 113 00:10:06,260 --> 00:10:16,060 is actually vulnerable to using a curve that's insecure. So yeah, that's the winner. And then 114 00:10:16,080 --> 00:10:21,500 that's the winner. So now that we've seen the entries, there are only three this year. But I'll 115 00:10:21,500 --> 00:10:27,920 talk a little bit about what our plans are for the future. So over the five years that we've been 116 00:10:27,920 --> 00:10:36,760 doing this, we've accumulated 32 backdoors that people have designed. And I think that's enough of a 117 00:10:36,760 --> 00:10:43,880 sample size that we can start to draw some general conclusions about what maybe we can classify backdoors 118 00:10:46,080 --> 00:10:51,780 as techniques or something like that. Or come up with some strategies to be able to detect them and 119 00:10:51,780 --> 00:10:56,820 things like that. And I actually think that this would be a really good project for an 120 00:10:56,820 --> 00:11:04,200 undergraduate if they're doing a research project. So if you are an undergraduate or you know 121 00:11:04,200 --> 00:11:10,260 one who might be interested in looking over all of the entries we've received so far and 122 00:11:10,260 --> 00:11:15,440 distilling knowledge out of that and writing a paper, definitely get in touch with us because I will 123 00:11:15,440 --> 00:11:24,180 provide as much support for that research as I can. And of course if you missed participating this 124 00:11:24,180 --> 00:11:29,700 year, we're going to be doing this again next year. Hopefully we'll get a little more entries next 125 00:11:29,700 --> 00:11:36,440 year, maybe some better prizes. So stay tuned for that. And before I wrap up, I just want to thank 126 00:11:36,440 --> 00:11:43,480 our sponsors, the Zcash Foundation and NCC Group Cryptography Services again because really the 127 00:11:43,480 --> 00:11:45,040 prizes are white people. 128 00:11:45,560 --> 00:11:49,120 Sound entries. So yeah, thank you for your attention.