1 00:00:00,000 --> 00:00:08,800 Welcome our next speaker, Bob Wall and Colt Fedrickson, on implementing a library for 2 00:00:08,800 --> 00:00:10,840 pairing-based transform cryptography. 3 00:00:18,580 --> 00:00:19,780 Thanks everyone. 4 00:00:20,020 --> 00:00:23,280 Thanks for sticking around until the bitter end, almost the bitter end. 5 00:00:24,840 --> 00:00:27,780 I imagine some of you might have been out partying last night. 6 00:00:27,780 --> 00:00:32,540 I'll try not to assault anyone's hangover, but special warning, there is some math in 7 00:00:32,540 --> 00:00:34,620 here, so consider yourself warned. 8 00:00:37,880 --> 00:00:40,880 Colt and I both work together at a company called Ironcore Labs. 9 00:00:42,080 --> 00:00:46,440 We'll talk about this transform cryptography library that we've implemented and some of 10 00:00:46,440 --> 00:00:47,300 the background about it. 11 00:00:49,820 --> 00:00:53,440 Obviously, we've known the answer to this question for quite a while before Facebook 12 00:00:53,440 --> 00:00:54,300 got facepalmed. 13 00:00:55,360 --> 00:00:57,760 But you can maybe tell by my gray hair that I'm not a fan of this. 14 00:00:57,760 --> 00:01:02,960 I've actually got to watch the World Wide Web get started, and it took off, and then 15 00:01:02,960 --> 00:01:06,320 the cloud stuff started, and it seemed like, hey, this might be really pretty cool. 16 00:01:08,260 --> 00:01:10,880 Especially people that were doing IT and setting up data centers. 17 00:01:11,120 --> 00:01:12,340 Like, wow, this might be great. 18 00:01:13,160 --> 00:01:15,740 And then we started getting some breach notifications. 19 00:01:15,760 --> 00:01:16,680 We heard about Yahoo. 20 00:01:17,480 --> 00:01:18,680 We heard about Anthem. 21 00:01:18,760 --> 00:01:21,720 We heard about the Office of Personnel Management, or the OMB. 22 00:01:22,160 --> 00:01:23,160 We heard about Facebook. 23 00:01:24,000 --> 00:01:27,180 I imagine at least a few of you out there have gotten a breach notification. 24 00:01:28,040 --> 00:01:29,420 From some company. 25 00:01:30,720 --> 00:01:33,420 So, started to get a little bit iffier about the cloud. 26 00:01:33,880 --> 00:01:39,720 And even if you disregard the breaches and think about the weird things that happen when 27 00:01:39,720 --> 00:01:43,660 somebody sends you an email, or you send somebody an email, and then you go to some 28 00:01:43,660 --> 00:01:49,680 social media site or Google and look at the ads that get presented to you, it's a little 29 00:01:49,680 --> 00:01:49,940 creepy. 30 00:01:50,220 --> 00:01:51,520 I find it a little creepy anyway. 31 00:01:51,740 --> 00:01:55,920 So, maybe the cloud has some downsides after all. 32 00:01:56,080 --> 00:01:57,740 So, what can we do? 33 00:01:57,760 --> 00:01:58,420 What can we do about that? 34 00:01:58,520 --> 00:02:02,740 What are some things that we can do to start fighting back against that? 35 00:02:03,600 --> 00:02:06,320 And one of the obvious answers is end-to-end encryption. 36 00:02:06,640 --> 00:02:12,440 So, if I've got a device, a browser, a phone, a tablet, and I want to generate some data, 37 00:02:12,620 --> 00:02:18,880 and I want to make it available to someone else, well, if I can use public key cryptography, 38 00:02:18,980 --> 00:02:24,700 I get their public key encrypted on the device, send it off, and it stays encrypted until it gets 39 00:02:24,700 --> 00:02:27,020 to their device, and they can decrypt it. 40 00:02:27,100 --> 00:02:27,480 So, hopefully. 41 00:02:27,760 --> 00:02:32,740 So, their private key that unlocks it stays on their device, and in between, it doesn't 42 00:02:32,740 --> 00:02:33,000 matter. 43 00:02:33,080 --> 00:02:34,460 We don't have to trust anyone. 44 00:02:34,620 --> 00:02:40,160 We don't have to believe that somebody's going to be upstanding in the middle. 45 00:02:40,500 --> 00:02:47,320 So, including cloud vendors, if we send that stuff through, we store it on Dropbox or Box, 46 00:02:47,500 --> 00:02:51,200 say, it doesn't matter if they want to look at it or not. 47 00:02:51,260 --> 00:02:52,160 They're not going to be able to. 48 00:02:52,900 --> 00:02:56,900 And so, we've seen kind of a takeoff of end-to-end encryption apps. 49 00:02:56,900 --> 00:02:59,660 And there are a few of them that are more popular, maybe. 50 00:03:00,900 --> 00:03:05,340 And you'll notice that most of these end-to-end encrypted applications now have something 51 00:03:05,340 --> 00:03:10,200 in common, and that is that they're primarily designed for messaging, and they're mostly 52 00:03:10,200 --> 00:03:12,820 designed for person-to-person channels. 53 00:03:14,660 --> 00:03:19,700 So they're not really designed for something where you might want to send something to 54 00:03:20,300 --> 00:03:21,420 a group of people. 55 00:03:21,500 --> 00:03:26,220 And they're especially not designed for something where that group of people might be big and 56 00:03:26,220 --> 00:03:29,080 or very dynamic, the membership of the group changing a lot. 57 00:03:29,300 --> 00:03:33,120 And there's a reason for that, because it's just not that easy. 58 00:03:33,260 --> 00:03:40,860 If you think about, say, you're a masochist and you want to encrypt some data to a group 59 00:03:40,860 --> 00:03:46,860 of people and you want to use GPG to do it, you get all of those people's public keys. 60 00:03:47,760 --> 00:03:51,720 You stuff those all into the GPG command line and say, hey, encrypt this document. 61 00:03:51,840 --> 00:03:52,360 It does it. 62 00:03:52,680 --> 00:03:55,780 And every one of those people can use their private key to decrypt it. 63 00:03:56,220 --> 00:03:56,440 OK. 64 00:03:56,520 --> 00:03:57,300 That's pretty good. 65 00:03:57,440 --> 00:04:01,620 And just kind of a side note here, and this will be kind of important as we talk through 66 00:04:01,620 --> 00:04:01,800 this. 67 00:04:01,920 --> 00:04:05,820 What we're talking about, what GPG does and what everything that does public key crypto 68 00:04:05,820 --> 00:04:08,360 pretty much does is envelope encryption. 69 00:04:08,520 --> 00:04:15,380 So they don't actually use public key crypto to encrypt that whole document, because it's 70 00:04:15,380 --> 00:04:16,200 slow and painful. 71 00:04:16,720 --> 00:04:19,560 They generate a random key, probably an AES key. 72 00:04:19,660 --> 00:04:23,940 They encrypt a document with that, and then they take that random key and they encrypt 73 00:04:23,940 --> 00:04:26,140 it with each of those public keys and stuff that on. 74 00:04:26,220 --> 00:04:29,500 The start of the document or at the end of the document or somewhere in that file. 75 00:04:30,980 --> 00:04:32,540 So I've got this file now. 76 00:04:32,620 --> 00:04:34,380 I've encrypted it to, say, three or four people. 77 00:04:34,740 --> 00:04:35,340 Everything's good. 78 00:04:37,020 --> 00:04:39,500 But now suppose I want to add another person. 79 00:04:41,820 --> 00:04:46,860 Well, that means that one of the people that can unlock the document needs to decrypt it, 80 00:04:48,080 --> 00:04:52,060 get those list of public keys that were already used, get the list of the extra public key 81 00:04:52,060 --> 00:04:55,320 that they want to add, and re-encrypt the document and save it back out there. 82 00:04:55,320 --> 00:05:01,860 So that's not tremendously convenient, and it's really not convenient if the group is 83 00:05:01,860 --> 00:05:02,480 changing fast. 84 00:05:02,680 --> 00:05:05,280 You wouldn't want to have to do that 20 times a day, for sure. 85 00:05:07,160 --> 00:05:09,400 Removing the access is pretty much the same thing. 86 00:05:09,500 --> 00:05:13,840 You have to go get the document, you have to decrypt it, re-encrypt it with a list 87 00:05:13,840 --> 00:05:16,660 of keys that excludes the people you want to remove access from. 88 00:05:16,860 --> 00:05:19,240 So obviously that is not scalable. 89 00:05:22,480 --> 00:05:24,880 So we want to build a system that has... 90 00:05:24,880 --> 00:05:29,620 We call it orthogonal access control, and that just means that we would like users to 91 00:05:29,620 --> 00:05:36,600 decide which groups of people should be able to access their data without knowing who belongs 92 00:05:36,600 --> 00:05:41,620 to the group, and then independently from that, the administrators of those groups should 93 00:05:41,620 --> 00:05:44,660 be able to add or remove members without me knowing about it. 94 00:05:44,760 --> 00:05:47,560 So this is obviously not a new idea. 95 00:05:47,780 --> 00:05:53,040 I mean, Unix groups are essentially this, but we want something that relies on cryptographic 96 00:05:53,040 --> 00:05:54,000 access control. 97 00:05:54,000 --> 00:05:56,280 We want something that relies on cryptographic access control instead of policy, so it's 98 00:05:56,280 --> 00:05:58,100 harder to break it, harder to mess it up. 99 00:05:58,100 --> 00:06:04,400 If somebody makes a programming error, it will matter a lot less, because unless you 100 00:06:04,400 --> 00:06:06,020 have the keys, you can't unlock it. 101 00:06:06,240 --> 00:06:11,840 And we want a system where each change in group membership or an access grant or revocation 102 00:06:12,740 --> 00:06:18,680 is basically a very fast, a constant time operation that's independent of the number 103 00:06:18,680 --> 00:06:22,560 of users that we're managing, or the number of documents, the number of files, or the 104 00:06:22,560 --> 00:06:23,700 number of groups that we have. 105 00:06:24,880 --> 00:06:26,740 So what's a way to do that? 106 00:06:27,940 --> 00:06:31,620 There's a field of study in cryptography called proxy re-encryption. 107 00:06:31,740 --> 00:06:34,020 It's been around for around 20 years. 108 00:06:35,720 --> 00:06:41,080 It hasn't really gotten too widespread of an adoption, but it provides a lot of these 109 00:06:41,080 --> 00:06:43,680 properties that we need to do this orthogonal access control. 110 00:06:45,140 --> 00:06:50,440 So most of the proxy re-encryption algorithms are based on public key cryptography, and 111 00:06:50,780 --> 00:06:53,000 almost all of them are actually based on pairings. 112 00:06:53,280 --> 00:06:53,980 Which was a good point. 113 00:06:54,000 --> 00:06:57,380 We'll talk about it in a little more detail, and that's where the math might start to sneak 114 00:06:57,380 --> 00:06:57,640 in. 115 00:06:59,460 --> 00:07:05,360 Proxy re-encryption was originally designed to allow someone who receives encrypted messages 116 00:07:05,360 --> 00:07:11,980 to delegate the ability to decrypt those messages to someone else, without having to 117 00:07:11,980 --> 00:07:13,640 give them her private key. 118 00:07:14,120 --> 00:07:18,740 So you can imagine, say we've got a mail server that's running with proxy re-encryption, 119 00:07:18,920 --> 00:07:21,320 and we've got a group of people that are using it. 120 00:07:21,360 --> 00:07:23,980 So Alice has a public private key. 121 00:07:24,000 --> 00:07:28,380 She's set up on the mail server, and she's getting encrypted mails, and she decrypts 122 00:07:28,380 --> 00:07:28,520 them. 123 00:07:28,700 --> 00:07:30,340 And then she's going to go on vacation. 124 00:07:30,520 --> 00:07:34,580 She wants Bob to take over for her while she's gone, but she would really rather not 125 00:07:34,580 --> 00:07:38,320 give Bob her public key, because he's kind of a doofus, and he will probably lose it. 126 00:07:38,500 --> 00:07:45,980 So with proxy re-encryption, she says, okay, I'm going to delegate to Bob. 127 00:07:46,040 --> 00:07:51,120 She calculates this re-encryption token, and sends it to the proxy server, the email 128 00:07:51,120 --> 00:07:51,480 server. 129 00:07:51,720 --> 00:07:53,980 And then when the email server sees emails coming in, she says, okay, I'm going to delegate 130 00:07:54,000 --> 00:07:54,120 to Bob. 131 00:07:54,120 --> 00:07:56,300 And then when the email server sees emails coming in encrypted to Alice, it can apply 132 00:07:56,300 --> 00:08:02,820 that transform key and do a transformation that makes that data encrypted to Bob without 133 00:08:02,820 --> 00:08:03,660 decrypting it. 134 00:08:03,740 --> 00:08:05,780 The mail server never saw the plain text. 135 00:08:06,320 --> 00:08:11,180 It only had this token that allowed it to transform from encrypted to Alice to encrypted 136 00:08:11,180 --> 00:08:11,620 to Bob. 137 00:08:11,920 --> 00:08:15,160 So that's what proxy re-encryption was designed to do. 138 00:08:16,820 --> 00:08:21,380 Proxy re-encryption algorithms usually have five primitives, key generation, and again, 139 00:08:21,940 --> 00:08:23,900 almost everyone I've seen is just straight up. 140 00:08:23,900 --> 00:08:28,060 So we have step, elliptic curve key generation, transform key generation, which is a little 141 00:08:28,060 --> 00:08:32,580 more involved, encryption, and transformation or re-encryption. 142 00:08:33,000 --> 00:08:37,360 We've taken to calling this transform encryption and calling this step transformation instead 143 00:08:37,360 --> 00:08:41,860 of re-encryption, because typically when I think of re-encryption, I think of what 144 00:08:41,860 --> 00:08:42,900 I talked about with GPG. 145 00:08:42,960 --> 00:08:47,480 It's like, oh, I have to go take the file, decrypt it, get a new key, and encrypt it 146 00:08:47,480 --> 00:08:48,060 with a new key. 147 00:08:48,180 --> 00:08:49,300 And this is not that. 148 00:08:49,360 --> 00:08:50,900 So we call it transformation instead. 149 00:08:51,340 --> 00:08:52,800 And then the decryption operation. 150 00:08:53,480 --> 00:08:53,880 Okay. 151 00:08:53,900 --> 00:08:59,800 So transform key generation with proxy re-encryption takes the private key of the person that wants 152 00:08:59,800 --> 00:09:04,060 to delegate the access, the public key of the person that they want to delegate the 153 00:09:04,060 --> 00:09:08,920 access to, and run some math, and it comes out with this transform key. 154 00:09:09,440 --> 00:09:13,620 So this transform key, again, doesn't allow anyone to decrypt any data. 155 00:09:14,080 --> 00:09:19,740 It can only be used to take data that's encrypted to the delegator and re-encrypt it or transform 156 00:09:19,740 --> 00:09:21,560 it so it's encrypted to the delegatee. 157 00:09:21,620 --> 00:09:21,820 Okay. 158 00:09:22,420 --> 00:09:26,080 And then, you know, once you get that done, you can send it to a proxy that's going to 159 00:09:26,080 --> 00:09:29,280 keep track of it, and it's going to apply it as necessary. 160 00:09:29,660 --> 00:09:34,320 And the fortunate thing is because it can't decrypt anything, you don't really have to 161 00:09:34,320 --> 00:09:36,380 trust the proxy when you send that key to it. 162 00:09:36,440 --> 00:09:41,360 You can't use it to do anything except what you basically told it it could do, which is 163 00:09:41,360 --> 00:09:45,460 transform messages that are encrypted to you so they're encrypted to someone else. 164 00:09:45,580 --> 00:09:49,920 And the nice thing is that you are the only one who can do that because it takes your 165 00:09:49,920 --> 00:09:51,360 private key to do that. 166 00:09:51,360 --> 00:09:55,860 So as long as you're not Bob, who, like, leaves his private key on the desk, you should 167 00:09:55,860 --> 00:09:56,180 be good. 168 00:09:57,840 --> 00:10:01,940 So if you want to delegate access, it's as simple as taking a file that's encrypted 169 00:10:01,940 --> 00:10:07,880 to the delegator, applying the key, and running the transformation algorithm, and sending 170 00:10:07,880 --> 00:10:14,940 the transformed file or data to the new recipient, they take their private key and they decrypt 171 00:10:14,940 --> 00:10:19,060 it pretty much the same way they would have decrypted something that was encrypted directly 172 00:10:19,060 --> 00:10:19,600 to them. 173 00:10:22,300 --> 00:10:25,840 So how can we use this to build this orthogonal access control system? 174 00:10:25,940 --> 00:10:27,100 We just use groups. 175 00:10:27,220 --> 00:10:31,160 We create a group, and we encrypt documents to the group. 176 00:10:31,400 --> 00:10:35,980 And then independently of that operation, the person who's kind of an administrator 177 00:10:35,980 --> 00:10:41,360 or owner of the group can create transform keys from the group to each of the users that's 178 00:10:41,360 --> 00:10:41,960 going to be a member. 179 00:10:43,340 --> 00:10:48,120 Once they add a member to the group, immediately that member can decrypt anything that's been 180 00:10:48,120 --> 00:10:50,040 encrypted to the group in the past. 181 00:10:50,800 --> 00:10:51,340 And that's pretty simple. 182 00:10:51,360 --> 00:10:55,860 Anything that will be encrypted to the group in the future, and at some point maybe you 183 00:10:56,320 --> 00:11:00,560 are removed from the group, that also immediately revokes access. 184 00:11:01,360 --> 00:11:06,860 And the nice thing is that both of those operations don't require you to go and find 185 00:11:06,860 --> 00:11:09,160 all of the documents that were encrypted to the group and mess with them. 186 00:11:09,260 --> 00:11:11,160 You don't ever have to touch any of the documents. 187 00:11:11,680 --> 00:11:13,400 You just do these transform keys. 188 00:11:15,060 --> 00:11:16,780 So creating a group is simple. 189 00:11:17,120 --> 00:11:20,060 It's just you create a public-private key pair for the group. 190 00:11:20,780 --> 00:11:26,240 What we do usually is take the group's private key and we encrypt it to the user that created 191 00:11:26,240 --> 00:11:26,560 it. 192 00:11:26,820 --> 00:11:30,620 And that makes that person essentially an administrator for the group. 193 00:11:30,780 --> 00:11:35,120 So an administrator is just someone who can access the private key of the group, which 194 00:11:35,120 --> 00:11:37,720 means they can add new people to the group when they want to. 195 00:11:40,380 --> 00:11:45,720 And again, adding a member to the group is as simple as computing that transform key. 196 00:11:45,880 --> 00:11:48,580 And that's why the administrator needs access to the private key. 197 00:11:50,860 --> 00:11:55,420 Granting access, if you've got a file and you want to let a group access that file, 198 00:11:55,620 --> 00:11:57,560 you just encrypt it to that group's public key. 199 00:11:57,680 --> 00:11:58,400 Very simple. 200 00:11:59,620 --> 00:12:05,580 If a group member wants access, they request the file that's been encrypted to the group. 201 00:12:05,820 --> 00:12:08,980 They give that to this proxy server that's got the transform key. 202 00:12:09,120 --> 00:12:13,300 It applies the transform to make the file so that it's encrypted to them. 203 00:12:13,700 --> 00:12:16,160 Sends that transformed file back. 204 00:12:16,340 --> 00:12:20,040 And then I've got a private key on my device that unlocks the data and records. 205 00:12:22,480 --> 00:12:26,780 Removing a member from a group is as simple as just forgetting the transform key. 206 00:12:26,920 --> 00:12:27,840 You just throw it away. 207 00:12:28,060 --> 00:12:33,360 As soon as it's gone, that user can no longer decrypt anything that's encrypted to the group. 208 00:12:35,600 --> 00:12:39,780 So now we've got all of the pieces and parts that we need to put together an orthogonal 209 00:12:39,780 --> 00:12:49,320 access control system and using a proxy re-encryption algorithm, we notice that, really, users don't 210 00:12:49,320 --> 00:12:50,020 use one key. 211 00:12:50,040 --> 00:12:56,100 I don't always use the same browser on my laptop to access things. 212 00:12:56,220 --> 00:12:58,880 I don't always use my cell phone to access things. 213 00:12:58,980 --> 00:13:05,180 So we can make this better if instead of, if we wanted to do that, we would basically 214 00:13:05,180 --> 00:13:07,360 have to do the thing that you do a lot of times now. 215 00:13:07,480 --> 00:13:10,480 It's like, okay, I've got my private key and I want to use three or four different devices. 216 00:13:10,960 --> 00:13:15,640 I have to figure out a way to get my private key onto all of those devices, which is, you 217 00:13:15,640 --> 00:13:18,000 know, you can do that, but that's not the greatest experience. 218 00:13:18,000 --> 00:13:20,020 So if we basically add another key. 219 00:13:20,020 --> 00:13:24,960 If we add another level here of delegation, we can treat a user as a group of devices 220 00:13:24,960 --> 00:13:28,140 and just do another transform from a user to a device. 221 00:13:28,300 --> 00:13:30,480 That means every device gets their own private key. 222 00:13:30,620 --> 00:13:31,700 You don't have to share them. 223 00:13:31,740 --> 00:13:32,720 You don't have to copy them around. 224 00:13:33,020 --> 00:13:38,360 If somebody drops their phone in the toilet, they can just basically revoke access to that 225 00:13:38,360 --> 00:13:42,060 phone and they don't have to worry about if somebody had somehow hacked their phone 226 00:13:42,060 --> 00:13:43,900 and gotten the private key for the phone. 227 00:13:44,020 --> 00:13:47,820 As soon as that transform key is gone, that phone can't access their data. 228 00:13:47,940 --> 00:13:49,980 You know, maybe you left it on the conveyor in the air. 229 00:13:49,980 --> 00:13:50,100 Maybe you left it at the airport. 230 00:13:51,440 --> 00:13:57,840 So the private keys for the devices are always on the device and it gives you this nice revocation 231 00:13:57,840 --> 00:13:58,160 property. 232 00:13:58,360 --> 00:14:03,080 But in order to do this, the proxy re-encryption algorithm needs to have a special property 233 00:14:03,080 --> 00:14:06,160 that's typically referred to as multi-use or multi-hop. 234 00:14:06,960 --> 00:14:11,940 So, you know, we already talked about if you had a data that's encrypted to a user and 235 00:14:11,940 --> 00:14:15,960 there's a transform key to another user, you can transform the document and then the 236 00:14:15,960 --> 00:14:17,120 other user can unlock it. 237 00:14:17,200 --> 00:14:19,960 But with multi-hop proxy re-encryption, you don't have to worry about that. 238 00:14:19,980 --> 00:14:24,920 You can take that transformed document and you can apply a second transform to it, maybe 239 00:14:24,920 --> 00:14:30,760 to another user, Carol, and produce this doubly transformed document, send that to Carol and 240 00:14:30,760 --> 00:14:34,460 she takes her private key and the decrypt algorithm and gets the plain text back. 241 00:14:34,680 --> 00:14:39,840 So this multi-hop proxy re-encryption allows you to build this hierarchical system. 242 00:14:40,380 --> 00:14:43,340 And in fact, you could build a hierarchy deeper if you wanted. 243 00:14:43,380 --> 00:14:44,560 You could have groups of groups. 244 00:14:46,940 --> 00:14:49,960 So adding a device to a user is the same as adding a user to a device. 245 00:14:49,960 --> 00:14:52,040 You just create a transform key. 246 00:14:52,940 --> 00:15:00,600 So if I'm logged into one of my devices and I want to access a document, I say, hey, I've 247 00:15:00,600 --> 00:15:02,920 got this document and I want to unlock it. 248 00:15:03,040 --> 00:15:08,500 And the proxy figures out the best way to get the transformation from something that 249 00:15:08,500 --> 00:15:12,160 document's encrypted to, to the device that I'm using to request it. 250 00:15:12,240 --> 00:15:17,620 So that might be because the document was actually shared with me, my user directly, 251 00:15:17,820 --> 00:15:19,940 and then there's one transform between me and the user. 252 00:15:19,940 --> 00:15:21,360 And that will work. 253 00:15:21,800 --> 00:15:23,980 Maybe it was shared with a group that I belong to. 254 00:15:24,180 --> 00:15:29,960 So if there's a path from a group to me to my device, the proxy can take those two transforms 255 00:15:29,960 --> 00:15:34,800 and apply them in a chain, transform it twice and return it to me so I can decrypt it. 256 00:15:37,220 --> 00:15:40,320 So we now have scalable end-to-end encryption. 257 00:15:41,460 --> 00:15:46,300 It can handle arbitrarily large groups of users and it can handle dynamic groups of 258 00:15:46,300 --> 00:15:46,580 users. 259 00:15:46,840 --> 00:15:49,840 We can grant and revoke access to a group, to documents. 260 00:15:49,920 --> 00:15:52,140 And to groups in constant time. 261 00:15:52,260 --> 00:15:56,080 It doesn't matter how many documents, doesn't matter how many groups, doesn't matter how 262 00:15:56,080 --> 00:15:56,540 many users. 263 00:15:56,880 --> 00:16:01,040 And we got rid of the need, like, to copy private keys around if we're trying to manage 264 00:16:01,040 --> 00:16:01,680 multiple devices. 265 00:16:03,600 --> 00:16:08,980 So just one place that this could be useful is say you want to be able to protect someone's 266 00:16:08,980 --> 00:16:11,220 PII, personally identifiable information. 267 00:16:11,240 --> 00:16:16,240 And I imagine there are more than a few of you out here who have been thinking about 268 00:16:16,240 --> 00:16:19,240 this a little bit in the last six months or so. 269 00:16:19,240 --> 00:16:21,800 So in the GDPR framework, right? 270 00:16:22,260 --> 00:16:27,580 So if you could take a user's private data and just encrypt it to that user and then 271 00:16:27,580 --> 00:16:33,200 say that user is going to decide, hey, I'm going to provide consent for this company 272 00:16:33,200 --> 00:16:34,460 to use my private data. 273 00:16:34,900 --> 00:16:36,600 It's as simple as creating a transform. 274 00:16:36,800 --> 00:16:40,280 If the company's got a public key, maybe the company is considered to be one of these 275 00:16:40,280 --> 00:16:40,600 groups. 276 00:16:40,740 --> 00:16:46,580 I create a transform key between me and that group that will allow that group to read my 277 00:16:46,580 --> 00:16:46,920 data. 278 00:16:46,920 --> 00:16:51,540 And then maybe a couple months down the road or a year down the road, I decide I don't 279 00:16:51,540 --> 00:16:55,120 want that company to continue to have access to my data. 280 00:16:55,240 --> 00:16:58,260 I want to invoke my right to be forgotten. 281 00:16:59,060 --> 00:17:03,860 So I just tell the proxy service that's holding these transform keys, hey, throw that one 282 00:17:03,860 --> 00:17:04,080 away. 283 00:17:04,720 --> 00:17:09,220 And that means that that company or people that belong to that company no longer can 284 00:17:09,220 --> 00:17:11,980 access that if they haven't already accessed it. 285 00:17:12,080 --> 00:17:15,460 So that's an example of what we can do with this. 286 00:17:16,940 --> 00:17:20,620 So we have implemented the primitives in Scala library. 287 00:17:21,640 --> 00:17:24,500 We use Scala.js to generate a client-side JavaScript library. 288 00:17:24,740 --> 00:17:25,460 It's open source. 289 00:17:26,920 --> 00:17:29,560 We actually built a JavaScript SDK around it. 290 00:17:30,960 --> 00:17:35,740 That talks to a service that is the public key repository and the transform proxy. 291 00:17:37,240 --> 00:17:38,240 We've got it out there. 292 00:17:38,280 --> 00:17:42,400 That part is an open source, but we let people do free signups if you wanted to play around 293 00:17:42,400 --> 00:17:42,700 with it. 294 00:17:42,740 --> 00:17:46,900 The library is open source, but it doesn't have some of the things around it to do with 295 00:17:46,900 --> 00:17:48,560 it to make it easy to manage the keys and stuff. 296 00:17:49,700 --> 00:17:55,000 So now I wanted to talk a little bit about like under the hood, some of the math stuff 297 00:17:55,000 --> 00:17:55,740 that makes this work. 298 00:17:55,780 --> 00:18:00,560 I said is pairing-based cryptography and pairings are built on top of elliptic curves. 299 00:18:01,660 --> 00:18:05,500 So it's, you know, elliptic curves, crypto is pretty standard, but pairings are less 300 00:18:05,500 --> 00:18:05,960 standard. 301 00:18:06,540 --> 00:18:10,580 Although I did, I think I heard two or three different talks in here this weekend that 302 00:18:10,580 --> 00:18:12,080 we're talking about pairings a little bit. 303 00:18:12,180 --> 00:18:16,880 So the basic operation that pairing-based crypto is based on is that it's built on a 304 00:18:16,880 --> 00:18:20,080 is called a bilinear pairing or sometimes called the bilinear mapping. 305 00:18:21,260 --> 00:18:26,600 And that mapping, that pairing is simply a function that takes an element from some group 306 00:18:27,700 --> 00:18:33,220 and an element from some other group and combines them together and produces an element 307 00:18:33,220 --> 00:18:34,420 in yet another group. 308 00:18:35,680 --> 00:18:41,220 So you know, the first group, spoiler alert, might be the set of points on an elliptic 309 00:18:41,220 --> 00:18:42,360 curve over a prime field. 310 00:18:44,240 --> 00:18:44,800 So. 311 00:18:44,960 --> 00:18:46,860 . . 312 00:18:46,860 --> 00:18:53,240 a bilinear pairing, it needs to satisfy some constraints. It needs to provide some properties. 313 00:18:53,460 --> 00:18:59,680 I won't read these to you, but that last one in particular is important because it allows you to 314 00:18:59,680 --> 00:19:05,140 basically swap scalar multiples of points. And we'll see why that's useful in a second. 315 00:19:07,520 --> 00:19:12,760 So how we use pairings, that first group that we talk about is exactly the set of points 316 00:19:12,760 --> 00:19:19,920 on an elliptic curve over a prime field. The second group is related to that. It's the same 317 00:19:19,920 --> 00:19:24,780 elliptic curve changed a little bit. It's called the twisted curve. And it's defined over a set of 318 00:19:24,780 --> 00:19:30,040 points in the second degree extension of that field. And so the math for that gets a little 319 00:19:30,040 --> 00:19:36,180 deeper, and I won't go into that. But when you do the pairing, you produce values that are in 320 00:19:36,180 --> 00:19:41,360 another group, this G sub T group. And that group is not a set of points. It's actually a set of 321 00:19:41,360 --> 00:19:42,740 values that are the set of points. And that's the set of points that are the set of points. 322 00:19:42,760 --> 00:19:48,140 That's the rth roots of unity. And those values are all contained in the degree 12 extension of 323 00:19:48,140 --> 00:19:54,800 that prime field. So these things are basically numbers that consist of 12 different values that 324 00:19:54,800 --> 00:20:01,220 are between 0 and prime minus 1. So it's a big number that the pairing produces. All of these 325 00:20:01,220 --> 00:20:04,780 groups have the same number of elements in the group. They all have the same order. 326 00:20:06,540 --> 00:20:11,720 So the reason pairings work for crypto, and there might be other ways to use them, 327 00:20:11,760 --> 00:20:12,740 but the way that we use them is to use them in the same order. So the reason pairings work for 328 00:20:12,740 --> 00:20:12,820 crypto, and there might be other ways to use them is to use them in the same order. So the reason 329 00:20:12,820 --> 00:20:17,280 we use them, and the way most of the proxy or encryption stuff does, is it allows you, like I 330 00:20:17,280 --> 00:20:23,200 said, it allows you to swap scalar multiples. So if you think of a public key, it's just some 331 00:20:23,200 --> 00:20:30,260 generator point in your group, your elliptic curve group, times some randomly chosen private key or 332 00:20:30,260 --> 00:20:39,300 secret key, right? So that's just a scalar multiple of some point that you know. So if Alice and Bob 333 00:20:39,300 --> 00:20:42,720 have key pairs that are computed that way, they both pick the same number of points, they both pick 334 00:20:42,720 --> 00:20:48,140 a random secret key, they compute a public key, they send that out there to a key server. Alice 335 00:20:48,140 --> 00:20:54,160 can encrypt a message to Bob by using a pairing, where she takes Bob's public key and pairs it with 336 00:20:54,160 --> 00:21:00,160 her secret key times this generator point that's predefined in that second group of elements for 337 00:21:00,160 --> 00:21:06,840 the pairing. And then she takes that pairing value and multiplies it by the message, and that gets 338 00:21:06,840 --> 00:21:12,600 an encrypted message. So Bob can recover that by basically taking Alice's public key, 339 00:21:13,620 --> 00:21:20,620 pairing it with the negation of his secret key times that second point G2. I won't go into this, 340 00:21:20,720 --> 00:21:27,160 but basically you can prove that this works by just doing simple arithmetic rewrites. It's like, 341 00:21:27,220 --> 00:21:31,260 well, okay, if I rewrite the public key as the secret key times the generator point, 342 00:21:31,480 --> 00:21:36,720 and then I remember that because of bilinearity, I can swap these two things. And then if I get 343 00:21:36,720 --> 00:21:42,340 down to the bottom, I know the fact that if I pair something times zero, it basically returns one. 344 00:21:42,720 --> 00:21:50,880 That shows you that I do, in fact, get out my original message when I decrypt it. So this is 345 00:21:50,880 --> 00:21:57,180 how pairings are used to make encryption work. So I'm going to make one more side note, and then 346 00:21:57,180 --> 00:22:01,820 I'll turn it over to Colt to talk about the library and some cooler, a little bit less 347 00:22:01,820 --> 00:22:09,380 theoretical ways to use it. But a note on the security of this stuff. The security of pairing 348 00:22:09,380 --> 00:22:12,700 based cryptography relies on two different hard problems. The first one is that the security of 349 00:22:12,700 --> 00:22:15,400 pairing is not a problem. The first is the standard elliptic curve Diffie-Hellman problem 350 00:22:15,400 --> 00:22:22,120 that protects all elliptic curve crypto. And that problem is what keeps you from being able to 351 00:22:22,120 --> 00:22:26,840 recover a secret key, even though you know the public key and you know the generator point. 352 00:22:27,160 --> 00:22:33,060 So that's a hard problem that protects the elliptic curve part of this. 353 00:22:33,160 --> 00:22:38,240 The other hard problem is the straight discrete log problem. And that's what protects the pairing 354 00:22:38,240 --> 00:22:42,120 part of that. Because remember, the pairing produces a value that's not in an elliptic 355 00:22:42,700 --> 00:22:50,940 group. It's just in a field, a big field. So it's the just straight discrete log problem that 356 00:22:50,940 --> 00:22:58,840 protects that part of the work. Recent advances in the use of number field sieves have improved 357 00:22:58,840 --> 00:23:05,580 the ability to solve the discrete log problem. It's still hard, but it's not as hard as we thought 358 00:23:05,580 --> 00:23:11,740 it was a while ago. So in the past, we thought the kind of conventional wisdom was that if you used 359 00:23:11,740 --> 00:23:12,680 a 200-digit number field sieve, you could solve a discrete log problem. And if you used a 200-digit 360 00:23:12,700 --> 00:23:15,220 number field sieve, you could solve a discrete log problem. And if you used a 256-bit private key, 361 00:23:15,420 --> 00:23:21,300 the elliptic curve discrete log problem would provide you with roughly 128 bits of security. 362 00:23:22,200 --> 00:23:28,300 And if you're doing this discrete log problem in the 12th degree extension of that field, 363 00:23:28,500 --> 00:23:33,640 that would also provide you roughly 128 bits of security against the straight discrete log 364 00:23:33,640 --> 00:23:39,220 problem. They've been working on this number field sieve, and that improves the ability to 365 00:23:39,220 --> 00:23:42,420 solve the discrete log problem. And some researchers, 366 00:23:43,420 --> 00:23:49,320 have been grinding away on this and concluded that in like the start of this year and the end 367 00:23:49,320 --> 00:23:55,580 of last year, that if you have a degree 12 extension of a 256-bit prime, that really only 368 00:23:55,580 --> 00:24:01,600 provides you with right around 100 bits of security instead of 128. So if you want to go and 369 00:24:01,600 --> 00:24:06,900 tell everybody, hey, my crypto is 128 bits secure, you know, some people kind of expect that. 370 00:24:07,240 --> 00:24:12,180 Um, you actually need more bits in your, in your, um, 371 00:24:12,720 --> 00:24:17,900 your prime number in your field. And so getting back up to 128 bit equivalent security, 372 00:24:18,200 --> 00:24:24,560 you actually need a prime that's, um, 400. These are all estimates in the, in the computations are 373 00:24:24,560 --> 00:24:29,620 really complicated and involved, and you kind of have to do it for each different case. But 374 00:24:29,620 --> 00:24:36,320 the estimates are that you would have to have at least 461 bits in your prime in order to get back 375 00:24:36,320 --> 00:24:41,460 to 128 bit security for the discrete log problem. So, um, we've been playing around with this a 376 00:24:41,460 --> 00:24:42,680 little bit and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, 377 00:24:42,700 --> 00:24:46,780 and, you know, it's probably something that we, that everyone should be aware of in the future, 378 00:24:46,900 --> 00:24:50,700 that you're probably going to have to start bumping up the size of the prime pretty soon 379 00:24:50,700 --> 00:24:55,680 because of these advances. So now I want to turn it over to Colton. He'll kind of talk about the 380 00:24:55,680 --> 00:25:09,680 library. Sure. So, um, first, like, uh, all this code, uh, I'm just going to show basically code 381 00:25:09,680 --> 00:25:11,620 snippets from the transcript library. 382 00:25:12,700 --> 00:25:17,860 find it out. Recrypt, I mean the library itself doesn't do all the storing of transform keys 383 00:25:17,860 --> 00:25:22,200 and all that stuff, so everything on the slide is like, well I'm just doing this in sequence 384 00:25:22,200 --> 00:25:27,480 in code, but some of it would be done by servers, some of it would be done by devices, so I'll 385 00:25:27,480 --> 00:25:31,760 just kind of talk to that as I go, so obviously there should be private keys everywhere, and 386 00:25:33,000 --> 00:25:39,820 just pretend that they're on different devices for now. So who here has used GPG to try to 387 00:25:39,820 --> 00:25:47,560 keep secrets encrypted to different people? Almost everybody. This is a very common thing 388 00:25:47,560 --> 00:25:55,860 we do, IT organizations use complicated, expensive key management systems to have groups and 389 00:25:55,860 --> 00:26:04,660 try to make this slightly less painful, but it's really a pain in the ass. So we have 390 00:26:04,660 --> 00:26:09,340 Bob, he's in charge, and I'm not just saying that because he's sitting behind me, and he 391 00:26:09,340 --> 00:26:09,800 can't hear me. 392 00:26:09,820 --> 00:26:16,960 But Bob's in charge, and he's the IT manager, so his job is to keep all these secrets encrypted 393 00:26:16,960 --> 00:26:21,900 to his IT organization. Some keys he wants encrypted to the whole organization, some 394 00:26:21,900 --> 00:26:29,280 keys he wants subgroups, whatever he wants. So these are one of his groups that he's working 395 00:26:29,280 --> 00:26:37,340 with, and sadly for him the turnover in IT organization is high, and every day he's re-encrypting 396 00:26:37,340 --> 00:26:38,720 things or removing people. 397 00:26:39,900 --> 00:26:45,680 He's doing all this work to try to just keep the same secrets encrypted to his organization. 398 00:26:45,960 --> 00:26:51,240 It's taking up a severe amount of his time. So he's using GPG to do that right now, and 399 00:26:51,240 --> 00:26:55,800 so every time he adds somebody like Charlie here, he has to go through and do what Bob 400 00:26:55,800 --> 00:27:00,940 talked about where you decrypt it, you re-encrypt it to everybody, and you send it back out 401 00:27:00,940 --> 00:27:01,140 there. 402 00:27:01,980 --> 00:27:02,420 Okay? 403 00:27:03,040 --> 00:27:03,780 I'll go back. 404 00:27:05,640 --> 00:27:08,240 So Alice, brings Alice on board, same thing. 405 00:27:08,340 --> 00:27:08,700 I'm going to go back. 406 00:27:08,720 --> 00:27:11,100 So hiring is painful. 407 00:27:13,680 --> 00:27:19,180 Unfortunately, Alice is also a quitter, so she quit, and now he has a problem again. 408 00:27:19,280 --> 00:27:20,940 He has to go through and do it again. 409 00:27:21,060 --> 00:27:25,400 So both hiring and people quitting, it's a major ordeal. 410 00:27:27,380 --> 00:27:29,300 So we can solve that. 411 00:27:29,880 --> 00:27:35,240 So let's talk about, I'm just going to show some of the code from re-crypt here. 412 00:27:35,940 --> 00:27:37,000 This is Scala code. 413 00:27:37,300 --> 00:27:38,700 So if you've never seen it, I'll show you. 414 00:27:38,720 --> 00:27:44,160 If you've never seen Scala before, or you haven't read it, types are on the right side 415 00:27:44,160 --> 00:27:46,560 of colons, and values are on the left side. 416 00:27:47,220 --> 00:27:53,180 So we've got a class API that takes the random byte vector and a thing that does signing. 417 00:27:55,180 --> 00:27:56,160 So it's a little weird. 418 00:27:56,300 --> 00:27:58,980 We had to do this because we wanted to cross-compile the JavaScript. 419 00:27:59,380 --> 00:28:02,180 Has anybody tried to do cryptography in JavaScript? 420 00:28:03,500 --> 00:28:04,280 It's not great. 421 00:28:06,140 --> 00:28:08,700 So yeah, the problem with cryptography is JavaScript doesn't work. 422 00:28:08,700 --> 00:28:11,760 Crypt is, how do you get random numbers, cryptographically secure random numbers? 423 00:28:12,240 --> 00:28:13,940 Well, that depends on the platform you're on. 424 00:28:14,000 --> 00:28:14,680 Are you in the browser? 425 00:28:14,840 --> 00:28:15,420 Are you on Node? 426 00:28:15,880 --> 00:28:19,200 So we wanted to allow this to be more flexible. 427 00:28:19,540 --> 00:28:25,100 So this thing they pass in, this IO, you can just think of it as a function that every 428 00:28:25,100 --> 00:28:27,260 time you invoke it, it basically could return you a different value. 429 00:28:29,760 --> 00:28:34,760 So basically, anywhere you see IO, you can just replace it with a function in your brain. 430 00:28:35,600 --> 00:28:38,680 We won't get into IOs today, because that's not the kind of talk we're going to be talking 431 00:28:40,080 --> 00:28:44,140 So every time you call that, you're going to get a different set of cryptographically 432 00:28:44,140 --> 00:28:44,960 secure random values. 433 00:28:45,160 --> 00:28:48,380 And the signing is just a pair of functions, sign and verify. 434 00:28:48,800 --> 00:28:56,200 And we did that with ED25519, because it's fast, it's known to be secure, and we didn't 435 00:28:56,200 --> 00:29:01,640 want to use the same set of keys for both encryption and signing, because that's generally 436 00:29:01,640 --> 00:29:03,200 considered not the best practice. 437 00:29:04,340 --> 00:29:08,380 So we take these things because of platform nonsense. 438 00:29:08,500 --> 00:29:08,660 Okay. 439 00:29:11,620 --> 00:29:14,040 So generate key pair, it's a pretty simple thing. 440 00:29:14,140 --> 00:29:19,680 We basically just take the random bytes and we map them over, multiply it times generator 441 00:29:19,680 --> 00:29:21,400 point to create a public key. 442 00:29:22,840 --> 00:29:28,100 So that's pretty simple, and that parentheses syntax is just a two-tuple. 443 00:29:31,820 --> 00:29:32,700 Generate plaintext. 444 00:29:32,940 --> 00:29:37,640 So when you are doing pairings like Bob was talking about, you have to have these elements 445 00:29:37,640 --> 00:29:40,980 that are in different groups, and they have to be members of the groups, and they have 446 00:29:40,980 --> 00:29:46,060 to be roots of unity and all kinds of other math jargon, otherwise it doesn't work. 447 00:29:47,520 --> 00:29:52,800 So we, instead of having to push that jargon onto the user of the library, we just said, 448 00:29:52,880 --> 00:29:54,900 we'll just write a function that generates you a plaintext. 449 00:29:55,180 --> 00:30:02,640 It returns this type that says it's a plaintext, so it is, and just trust me, that way you 450 00:30:02,640 --> 00:30:03,980 don't have to worry about how to generate it. 451 00:30:04,540 --> 00:30:07,180 So it's using that random byte vector under the hood as well. 452 00:30:10,440 --> 00:30:16,960 So generateTransformKey, basically this is the thing that delegates, so this is the 453 00:30:16,960 --> 00:30:21,260 function that delegates from one private key to a public key. 454 00:30:24,800 --> 00:30:30,160 Transform, that's the thing that actually, it takes a transform key and does that transformation 455 00:30:30,160 --> 00:30:30,840 for you. 456 00:30:31,320 --> 00:30:37,620 So this is the thing that like a server would do, or somebody, whoever is the proxy, and 457 00:30:37,640 --> 00:30:41,740 in all of Bob's terminology, the person that has access to these transform keys and the 458 00:30:41,740 --> 00:30:45,400 public keys and all that stuff, that would be where this runs. 459 00:30:48,440 --> 00:30:57,440 Encrypt, pretty straightforward, encrypting a plaintext to a public key, and decrypt. 460 00:30:57,640 --> 00:31:01,460 So it either returns an error message or the plaintext. 461 00:31:02,600 --> 00:31:06,180 So let's go through like a little sample here. 462 00:31:06,180 --> 00:31:09,120 So we're basically going to go through the sample that we were talking about earlier. 463 00:31:09,280 --> 00:31:15,400 We were talking about Charlie and Bob and Alice and this IT type organization. 464 00:31:17,560 --> 00:31:22,060 So this is basically just generating two different key pairs over here. 465 00:31:22,140 --> 00:31:28,720 So Bob's key pair and the IT group's key pair, the reason I wrote it out at all, because 466 00:31:28,720 --> 00:31:34,940 key pair generation is boring, is because it's really important in the scheme to remember 467 00:31:34,940 --> 00:31:35,960 that groups. 468 00:31:35,960 --> 00:31:37,840 Groups and users are really the same. 469 00:31:38,820 --> 00:31:42,520 So users can be treated as groups, groups can be treated as subgroups. 470 00:31:42,780 --> 00:31:49,240 So public private keys, and especially with our system, you can use these things for many 471 00:31:49,240 --> 00:31:53,440 purposes and you can delegate to people, you can delegate to groups, you can, there's all 472 00:31:53,440 --> 00:31:54,700 kinds of fancy stuff you can do. 473 00:31:54,800 --> 00:31:58,900 So don't get stuck in your brain about like, oh, well, this is a user key, because you 474 00:31:58,900 --> 00:31:59,660 can treat it as a group. 475 00:32:02,280 --> 00:32:02,680 Okay. 476 00:32:02,740 --> 00:32:04,660 So encrypting a value to... 477 00:32:05,540 --> 00:32:05,940 Okay. 478 00:32:05,960 --> 00:32:06,540 So we have a group, an IT group. 479 00:32:06,860 --> 00:32:11,820 I mean, our goal with this library is to make the public API as simple as possible. 480 00:32:12,220 --> 00:32:20,300 Anybody who's used OpenSSL or any other cryptographic library is god awful to try to figure out 481 00:32:20,300 --> 00:32:20,920 what's going on. 482 00:32:21,280 --> 00:32:24,540 You're passing in mutable values that they're gonna fill out and pass back. 483 00:32:25,020 --> 00:32:26,400 It's just bad. 484 00:32:26,580 --> 00:32:30,160 We want it to read exactly like the pseudo code algorithm should read. 485 00:32:30,500 --> 00:32:32,460 So here we just generate a plain text. 486 00:32:32,760 --> 00:32:35,660 We encrypt that plain text and yield the encrypted value. 487 00:32:35,820 --> 00:32:35,940 Okay. 488 00:32:35,940 --> 00:32:40,860 So it reads like pseudo code and we're encrypting to the group public key. 489 00:32:41,080 --> 00:32:45,780 And so a little note about signing keys, I kind of pointed out earlier, but because 490 00:32:45,780 --> 00:32:55,920 we did the signing keys separate from our keys, we use ED25519, that means we pass 491 00:32:55,920 --> 00:33:00,460 in these signing keys to detect if somebody's screwed with the encrypted values. 492 00:33:01,720 --> 00:33:03,600 So it makes the API a little messier. 493 00:33:03,960 --> 00:33:05,920 But I think it's still pretty straightforward. 494 00:33:05,940 --> 00:33:12,360 So another thing to note here is that this encrypted value never has to change ever. 495 00:33:12,660 --> 00:33:16,980 You can put it on the blockchain, you can put it in a database, you can put it in Kafka, 496 00:33:17,320 --> 00:33:22,100 immutable key value stores, whatever you want to do, you can do that and you never, 497 00:33:22,160 --> 00:33:23,820 ever, ever have to change this encrypted value. 498 00:33:24,560 --> 00:33:30,600 So no matter who you want to share it with or add to the group later with, you never 499 00:33:30,600 --> 00:33:31,220 have to change that. 500 00:33:33,460 --> 00:33:33,860 Okay. 501 00:33:33,860 --> 00:33:35,200 So we hire Charlie. 502 00:33:35,360 --> 00:33:38,080 So we generate Charlie's key pair. 503 00:33:38,160 --> 00:33:39,320 So that would happen on her device. 504 00:33:39,500 --> 00:33:41,800 So that piece would happen on her device. 505 00:33:42,140 --> 00:33:49,200 And then Bob takes her public key and he just generates a transform key from the IT group 506 00:33:49,200 --> 00:33:51,500 private key to Charlie's public key. 507 00:33:52,080 --> 00:33:52,960 And that's it. 508 00:33:53,040 --> 00:33:57,780 So he generates that transform key and he sends it off to the public key repository 509 00:33:57,780 --> 00:33:59,120 that's holding onto all this information. 510 00:33:59,720 --> 00:34:01,080 So now we have... 511 00:34:01,880 --> 00:34:03,800 Basically, this is how Charlie gets added. 512 00:34:03,860 --> 00:34:04,300 To the group. 513 00:34:04,680 --> 00:34:05,600 She's now in the group. 514 00:34:08,080 --> 00:34:13,840 So hiring again, just to show that it's the same, no matter what, Alice, the same thing. 515 00:34:14,120 --> 00:34:18,040 She generates key pairs, you generate a transform key and you send it off. 516 00:34:19,040 --> 00:34:22,560 So this is what you would call adding her to the group. 517 00:34:22,880 --> 00:34:25,460 It also doesn't matter how many documents are shared with the group. 518 00:34:25,740 --> 00:34:30,920 This operation is constant time, just the one thing, doesn't matter how many millions 519 00:34:30,920 --> 00:34:32,960 of AWS secrets you have. 520 00:34:33,400 --> 00:34:33,840 Okay. 521 00:34:33,860 --> 00:34:34,380 So it's encrypted. 522 00:34:36,020 --> 00:34:36,540 It's encrypted. 523 00:34:36,680 --> 00:34:39,400 But what if Alice quits? 524 00:34:40,200 --> 00:34:40,720 Sorry. 525 00:34:40,960 --> 00:34:42,600 What if Alice wants to decrypt this? 526 00:34:43,000 --> 00:34:43,320 Sorry. 527 00:34:43,460 --> 00:34:48,000 So Alice comes in and basically needs the transformed value. 528 00:34:48,200 --> 00:34:53,100 So this transform function that's happening at the top, that would happen on the proxy 529 00:34:53,100 --> 00:34:53,440 server. 530 00:34:54,660 --> 00:34:59,620 So we'll just pretend that that has happened there and then the transformed data would 531 00:34:59,620 --> 00:35:03,560 be sent back to Alice and her request. 532 00:35:03,660 --> 00:35:03,840 Okay. 533 00:35:03,840 --> 00:35:14,320 So the important thing here is that the transformed data and the original encrypted data have the 534 00:35:14,320 --> 00:35:14,900 same shape. 535 00:35:15,320 --> 00:35:17,880 That's what Bob was talking about when he was talking about multi-hop. 536 00:35:18,360 --> 00:35:24,120 So if you wanted to transform that data again, you could take that transformed data and transform 537 00:35:24,120 --> 00:35:28,700 it again to give it access to a device or give access to a subgroup or whatever. 538 00:35:30,020 --> 00:35:33,420 So it's important when you look at the... 539 00:35:33,420 --> 00:35:38,160 Like, I put all the types on the left side there, but that encrypted value is the same 540 00:35:38,160 --> 00:35:39,620 thing we got out of the encrypt function. 541 00:35:40,140 --> 00:35:45,040 So it could be encrypted or it could be already one step transformed and you could do it over 542 00:35:45,040 --> 00:35:45,500 and over again. 543 00:35:48,800 --> 00:35:52,580 So if Alice quits, we don't need to do anything special. 544 00:35:52,760 --> 00:35:57,160 All we need to do is just forget her transform key and we just walk away. 545 00:35:58,800 --> 00:36:02,140 Now, that's what a lot of people are starting to call this, like... 546 00:36:03,700 --> 00:36:07,640 Crypto shredding or cryptography erasing things. 547 00:36:08,200 --> 00:36:12,480 All these terminology that just means, well, they can't decrypt it anymore. 548 00:36:12,860 --> 00:36:17,440 So I don't know why this is, like, a new thing that we're doing as an industry, but 549 00:36:17,440 --> 00:36:17,900 I guess we are. 550 00:36:20,020 --> 00:36:22,980 So as you can see, like, this API is, like, super approachable. 551 00:36:23,060 --> 00:36:23,900 There's nothing crazy here. 552 00:36:25,520 --> 00:36:32,020 So if you're at all interested in this, we have a ton of property-based tests in our 553 00:36:32,140 --> 00:36:38,040 core API tests on the GitHub repo, and it goes through, like, two and three and four 554 00:36:38,040 --> 00:36:43,300 level re-encryption steps with different, like, devices and subgroups and all kinds 555 00:36:43,300 --> 00:36:47,360 of augmentations of keys, and there's some really neat stuff that you can do there. 556 00:36:47,680 --> 00:36:51,780 If you have any questions at all, like, feel free to open an issue, say, like, it's not 557 00:36:51,780 --> 00:36:55,520 clear what's happening in this test case or what about this other thing that I'd like 558 00:36:55,520 --> 00:36:55,880 to do. 559 00:36:57,020 --> 00:37:02,060 I'm wide open to, like, answering any questions on that, but I think the property-based tests 560 00:37:02,140 --> 00:37:04,620 give a pretty good overview of that. 561 00:37:05,220 --> 00:37:06,500 So what else? 562 00:37:06,840 --> 00:37:12,360 Like, Bob mentioned quite a few of these things, but just to bring it back around again, multi-hop 563 00:37:12,360 --> 00:37:19,740 proxy re-encryption is super, super, super cool because you can treat users as groups 564 00:37:19,740 --> 00:37:26,180 and groups as subgroups, and there's just really no limit to the things you could do 565 00:37:26,780 --> 00:37:27,620 with that kind of stuff. 566 00:37:28,300 --> 00:37:30,080 Every hop makes things slower. 567 00:37:30,580 --> 00:37:36,020 So that is one thing that happens when you do all these transformations, obviously you 568 00:37:36,020 --> 00:37:38,580 have to unroll them, like, math isn't free. 569 00:37:39,660 --> 00:37:44,180 So that's a struggle there, but it's really some pretty, there's some pretty cool stuff 570 00:37:44,180 --> 00:37:44,620 you could do. 571 00:37:45,780 --> 00:37:49,940 And he mentioned the GDPR, which is a big deal. 572 00:37:50,980 --> 00:37:56,300 So the right to forget and being able to just say, like, oh, well, we quote unquote crypto 573 00:37:56,300 --> 00:37:59,800 shredded this data and we can't unlock it anymore. 574 00:37:59,800 --> 00:38:01,280 So we forgot who you are. 575 00:38:01,880 --> 00:38:06,160 Like being able to do that in a constant time, instead of, you know, sending your IT guy 576 00:38:06,160 --> 00:38:11,480 off to just like search through databases for three days, like that's, that's a, that's 577 00:38:11,480 --> 00:38:12,360 a game changer in my opinion. 578 00:38:13,260 --> 00:38:15,760 Key rotation could also be encoded with an extra hop. 579 00:38:16,420 --> 00:38:21,520 So if you wanted to say like, oh, I want to like get a new key, you could make your old 580 00:38:21,520 --> 00:38:26,040 key just delegate to your new key and you could not have to re-encrypt all your old 581 00:38:26,040 --> 00:38:26,280 data. 582 00:38:28,140 --> 00:38:29,780 There's some caveats there, but we'll deal with that later. 583 00:38:29,800 --> 00:38:31,180 We'll just, we'll leave it at that. 584 00:38:33,200 --> 00:38:35,340 So it is all out there on GitHub. 585 00:38:36,700 --> 00:38:39,280 So we just open sourced it pretty recently. 586 00:38:40,120 --> 00:38:41,880 It's only on the JVM and in JavaScript. 587 00:38:42,900 --> 00:38:47,520 So it's pretty limiting as far as platforms are concerned, but we have some other stuff 588 00:38:47,520 --> 00:38:50,820 coming that's pretty exciting, but we're not quite ready to talk about it yet. 589 00:38:51,400 --> 00:38:53,400 It's also not that fast yet. 590 00:38:53,480 --> 00:38:58,460 We have a benchmark thing in your, in the repo, so feel free to clone it and like see 591 00:38:58,460 --> 00:38:59,200 the benchmarks. 592 00:39:00,320 --> 00:39:06,360 But it certainly could use some work there while working on it and are open to any suggestions 593 00:39:06,360 --> 00:39:07,360 or anything like that. 594 00:39:08,900 --> 00:39:15,380 And really managing the groups, managing the public keys, managing the transform keys and 595 00:39:15,380 --> 00:39:17,760 identities, like that's where the struggle comes in here. 596 00:39:17,880 --> 00:39:22,540 I showed the code and the code is super simple, but like all the, all the identity management 597 00:39:22,940 --> 00:39:27,840 is really the, the harder part of this in terms of, of, of getting it right. 598 00:39:28,180 --> 00:39:28,660 So. 599 00:39:29,800 --> 00:39:31,240 With that, questions. 600 00:39:41,780 --> 00:39:43,320 I actually have two questions. 601 00:39:43,520 --> 00:39:47,220 The first one is about the transform key storage. 602 00:39:47,740 --> 00:39:52,520 As far as I can tell, mathematically speaking, possession of the transform key and the destination 603 00:39:52,520 --> 00:39:56,340 private key is equivalent to holding the original private key. 604 00:39:56,480 --> 00:39:59,320 Because once you have them both, you can just transform and decrypt. 605 00:39:59,440 --> 00:39:59,780 So I was wondering if you could talk about that a little bit. 606 00:40:00,600 --> 00:40:04,680 So you clearly need to store these transform keys in some way that's secure. 607 00:40:05,620 --> 00:40:10,120 You know, you don't want somebody who, you know, has a transform key issued, breaks into 608 00:40:10,120 --> 00:40:13,080 the proxy server, takes the transform key, and then you can never revoke them. 609 00:40:13,920 --> 00:40:18,180 So, I mean, is there any plan to implement this on secure hardware, secure elements, 610 00:40:18,340 --> 00:40:21,800 things like that, so that a proxy can securely store these transform keys? 611 00:40:23,280 --> 00:40:27,960 So, yeah, if you have the private key of the person that has been transformed to, and you 612 00:40:27,960 --> 00:40:28,940 have the transform key, you're right. 613 00:40:28,980 --> 00:40:29,780 Like that's, you know, it's, it's, it's a very, very complicated thing to do. 614 00:40:29,800 --> 00:40:33,660 That's equivalent to having, like, access to all the data. 615 00:40:34,880 --> 00:40:39,860 The transform key is only, is only stored in the proxy, but you're right. 616 00:40:39,920 --> 00:40:40,560 You could break in there. 617 00:40:40,760 --> 00:40:49,560 We don't have plans to do anything special there, at least not in the very near future. 618 00:40:50,900 --> 00:40:57,220 It is basically the compromising of multiple systems, including, you know, their device. 619 00:40:57,220 --> 00:41:00,180 And that could actually be revoked. 620 00:41:00,660 --> 00:41:07,720 We can use some key augmentation tricks to make sure that, that values that are encrypted 621 00:41:08,040 --> 00:41:13,700 to a certain user can't be unlocked by their private key and can only be unlocked by devices. 622 00:41:13,800 --> 00:41:15,180 And that's something I didn't get into here. 623 00:41:16,420 --> 00:41:19,220 But I think, I guess the short answer to your question is no. 624 00:41:20,380 --> 00:41:24,080 And, yeah, that's, that's a problem, but not as big a problem as... 625 00:41:25,260 --> 00:41:27,200 The other question I had was, so the issuance of the, you know, the, you know, the, you know, 626 00:41:27,200 --> 00:41:28,940 the issuance of transform keys requires the private key. 627 00:41:29,580 --> 00:41:35,940 Is it possible to use the same trick to delegate that authority so I could use my private key 628 00:41:35,940 --> 00:41:39,260 to generate a transform key that I then transform into another transform key? 629 00:41:42,340 --> 00:41:43,560 I'm sorry if your head explodes. 630 00:41:43,900 --> 00:41:47,220 No, I'd have to think about that a little more. 631 00:41:47,380 --> 00:41:48,700 Let's, yeah, let's talk about... 632 00:41:48,700 --> 00:41:50,920 I'm just thinking of a group of people that are the admins, you know. 633 00:41:52,180 --> 00:41:54,500 So that might be possible. 634 00:41:54,580 --> 00:41:57,180 But I think a lot easier approach than that. 635 00:41:57,200 --> 00:42:02,420 And one that we haven't implemented, but we're going to, is basically doing a key splitting idea. 636 00:42:02,760 --> 00:42:08,360 So if I've got a group of admins that have a, you know, that have access to the private key for a group, 637 00:42:08,620 --> 00:42:11,400 and it's an important group like the IT group for my organization, 638 00:42:12,480 --> 00:42:16,220 I take that private key and I basically split it M ways. 639 00:42:16,440 --> 00:42:21,480 I've got M employees and then I require that, you know, some subgroup of them that's more than one 640 00:42:21,480 --> 00:42:25,380 have to work together to put the key back together before they can use it. 641 00:42:25,460 --> 00:42:26,440 I think that's a... 642 00:42:28,280 --> 00:42:32,000 accomplishes maybe not exactly the same things, but close to the same things. 643 00:42:32,140 --> 00:42:36,320 And it's a significantly easier thing to think about in your head, so. 644 00:42:36,500 --> 00:42:36,700 Thanks. 645 00:42:38,980 --> 00:42:41,720 Thank you for the amazing tool and talk. 646 00:42:41,860 --> 00:42:42,180 Thank you. 647 00:42:42,560 --> 00:42:43,140 Thank you. 648 00:42:43,260 --> 00:42:50,940 I have some questions about the performance of this proxy server as it is applying these transform keys, 649 00:42:51,020 --> 00:42:52,880 because it can't give out the transform key. 650 00:42:53,060 --> 00:42:56,320 So when doing this transform, 651 00:42:56,320 --> 00:42:59,180 that would basically... 652 00:42:59,180 --> 00:43:02,540 That's a computationally expensive operation, correct? 653 00:43:02,900 --> 00:43:03,060 Yeah. 654 00:43:04,120 --> 00:43:14,680 Would there potentially be any downsides to taking a play out of GNU PG, this book, 655 00:43:14,820 --> 00:43:22,020 and doing the initial encryption with a symmetric key that is very fast, 656 00:43:22,240 --> 00:43:26,300 and then only doing a transform on the encryption of that subgroup? 657 00:43:28,460 --> 00:43:29,320 That's what we're doing. 658 00:43:29,520 --> 00:43:29,700 Yeah. 659 00:43:29,820 --> 00:43:31,300 I mean, this is envelope encryption. 660 00:43:31,480 --> 00:43:35,220 So, like, the only thing we're encrypting is the AES key. 661 00:43:35,380 --> 00:43:35,680 Oh, cool. 662 00:43:35,760 --> 00:43:35,920 Okay. 663 00:43:36,180 --> 00:43:36,580 So... 664 00:43:36,580 --> 00:43:37,340 That makes it moot. 665 00:43:37,400 --> 00:43:37,900 But you're right. 666 00:43:38,020 --> 00:43:39,700 The transform is expensive. 667 00:43:40,820 --> 00:43:47,260 So, I mean, the performance of the library is not where we want it to be. 668 00:43:48,100 --> 00:43:51,020 But, you know, we're focused on making it faster and working on that. 669 00:43:51,100 --> 00:43:55,380 And there's another thing that the proxy server can actually cache those transform values. 670 00:43:55,380 --> 00:43:57,200 If it wants to. 671 00:43:57,780 --> 00:44:01,640 Because, I mean, every time it asks for one, I mean, it's gonna get... 672 00:44:01,640 --> 00:44:05,220 Well, not quite the same answer, but almost the same answer every time. 673 00:44:05,520 --> 00:44:07,920 So you could actually cache those if you were worried about performance. 674 00:44:08,860 --> 00:44:11,300 You could cache the transform value for some period of time 675 00:44:11,300 --> 00:44:14,460 if somebody was just asking over and over and over again for that same value. 676 00:44:14,760 --> 00:44:15,880 That was my next question. 677 00:44:15,980 --> 00:44:16,380 Thank you. 678 00:44:19,240 --> 00:44:20,180 Any other questions? 679 00:44:24,080 --> 00:44:24,640 All right. 680 00:44:24,660 --> 00:44:25,100 Thank you.