1 00:00:00,000 --> 00:00:01,300 All right. 2 00:00:01,300 --> 00:00:03,120 Welcome back, everybody. 3 00:00:03,140 --> 00:00:06,900 Next up, please welcome Steve, who will be speaking about EasyPake Oven. 4 00:00:10,020 --> 00:00:11,020 I'm Steve. 5 00:00:11,020 --> 00:00:12,460 You may know me as Scoobs. 6 00:00:12,460 --> 00:00:14,460 Thank you for coming to my talk. 7 00:00:15,840 --> 00:00:23,440 So, a quick overview of my talk. 8 00:00:23,440 --> 00:00:34,640 It's going to be, you know, what, why, which, password, KDFs, APIs, and HSMs, secret salt, and recovery. 9 00:00:35,740 --> 00:00:37,960 So, what is a Pake? 10 00:00:38,080 --> 00:00:40,140 A Pake is a password key... 11 00:00:43,940 --> 00:00:46,220 This always happens in, like, the first five minutes. 12 00:00:46,220 --> 00:00:48,220 I always get super nervous. 13 00:00:48,220 --> 00:00:49,200 I know. 14 00:00:49,520 --> 00:00:50,800 Anyways. 15 00:00:50,800 --> 00:00:51,560 Woo! 16 00:00:55,540 --> 00:00:56,980 Anyway. 17 00:00:57,000 --> 00:01:01,640 So, a password authenticated key exchange is just that. 18 00:01:01,640 --> 00:01:15,280 It's a key exchange that has a password involved such that anyone trying to do any, like, malicious attacks or anything like that gains nothing from it. 19 00:01:15,280 --> 00:01:25,220 It's a zero knowledge proof, and the only thing that leaks is yes or no for whether your password was correct or wrong. 20 00:01:25,480 --> 00:01:31,360 It also has... there's two different types of Pakes. 21 00:01:31,600 --> 00:01:33,300 Balanced and unbalanced. 22 00:01:33,300 --> 00:01:37,440 Sometimes it's called symmetric and asymmetric or augmented. 23 00:01:37,720 --> 00:01:44,220 So, a balanced Pake is where it's peer-to-peer. 24 00:01:45,820 --> 00:01:51,380 So, sorry. 25 00:01:54,180 --> 00:01:58,620 So, a balanced Pake is where you're peer-to-peer. 26 00:01:58,640 --> 00:02:12,080 So, this is, like, two people that have a shared low entropy key, such as, like, a short password or something that you prearranged or whatever. 27 00:02:12,080 --> 00:02:18,080 You can do a key exchange, and it can be secure. 28 00:02:18,520 --> 00:02:25,820 The other way, the augmented asymmetric unbalanced way, is server client. 29 00:02:25,820 --> 00:02:42,340 So, the server has a password, and the client has a password, and the server has a verifier that... so, the verifier, it can't be used as a way to authenticate to the server. 30 00:02:42,340 --> 00:02:48,780 So, if the database ever leaks, that verifier data can't be used to authenticate to the server. 31 00:02:48,780 --> 00:02:54,170 But basically, it's a password hash equivalent, but not a password equivalent. 32 00:02:55,550 --> 00:02:58,490 So, why should you use Pake? 33 00:02:58,490 --> 00:03:11,010 Well, it may seem overly complex or scary or something, but there are some use cases where it helps with security. 34 00:03:14,510 --> 00:03:27,470 So, one of these cases is recently, over the last... over a span of about a year, these tech companies accidentally were logging passwords. 35 00:03:27,470 --> 00:03:36,950 And if the password is never sent to the server, then you can't log the password. 36 00:03:37,050 --> 00:03:50,130 You might think, oh, I could hash the password first and send it over, but... so, you secure the database really well, but you still log, like, a simple hash of the password, and that's in the log. 37 00:03:50,130 --> 00:03:51,790 Those can be cracked easily. 38 00:03:51,950 --> 00:04:01,970 But even if you logged all the Pake data that's being going... that's going back and forth, you would gain nothing from that as an attacker. 39 00:04:03,510 --> 00:04:12,170 There... since this isn't, like, implemented in the browser, you'd have to be... you'd have to implement it in JavaScript. 40 00:04:13,050 --> 00:04:17,630 And sometimes people have JavaScript disabled, so you'd have to still have a fallback. 41 00:04:17,630 --> 00:04:21,030 But that's, you know, like, 1%. 42 00:04:21,030 --> 00:04:27,790 So, some other uses, as I was saying, peer-to-peer. 43 00:04:27,830 --> 00:04:34,110 What you can do is secure peer-to-peer file transfer with magic wormhole. 44 00:04:35,590 --> 00:04:40,210 You can also... so, that's the GitHub page for it. 45 00:04:40,330 --> 00:04:44,010 You can also... it's in package managers for Linux. 46 00:04:44,870 --> 00:05:13,990 I actually don't know which ones, but... so, anyway, so, basically what it does is you have this small shared secret that you send... that you tell someone, they type it in, and then you can get a secure connection between the two of you, assuming that someone didn't man the middle and guess what it was with one try. 47 00:05:14,670 --> 00:05:25,610 Another good thing Pakes are for are for encrypted cloud services, like password managers and encrypted backups. 48 00:05:25,610 --> 00:05:30,190 Because they have to do authentication and encryption with your password. 49 00:05:30,210 --> 00:05:35,490 And there's a lot of things that you can do incorrectly with passwords. 50 00:05:35,490 --> 00:05:43,110 Such as... so, there's downgrade attacks that Pakes prevent. 51 00:05:43,110 --> 00:05:55,990 So, a bug that last pass had was you would log in, it would say error... well, if the server was compromised, the server could reply with error iterations one. 52 00:05:56,270 --> 00:05:59,150 You would be like, oh, oops, I had the iterations wrong. 53 00:05:59,150 --> 00:06:04,670 So, then you would do one iteration, which would be a really fast hash, and then send that. 54 00:06:04,670 --> 00:06:10,530 And then it would say error iterations, the correct amount of iterations for your account. 55 00:06:10,530 --> 00:06:15,090 And all the user would see is that it took twice as long to log in. 56 00:06:15,670 --> 00:06:16,880 And they'd just be like... 57 00:06:19,330 --> 00:06:22,290 Then there was keeper. 58 00:06:22,730 --> 00:06:25,760 This was on full disclosure. 59 00:06:31,140 --> 00:06:35,360 And so, the bug here was... 60 00:06:40,570 --> 00:06:51,570 so, the way authentication and encryption worked on this is there was a salt and iteration count for the authentication key. 61 00:06:51,590 --> 00:06:54,410 And then there was a salt and iteration count for the encryption key. 62 00:06:54,410 --> 00:06:57,150 And both of those were run through PBKDF2. 63 00:06:57,150 --> 00:07:00,930 And then you would get the authentication key or encryption key. 64 00:07:00,930 --> 00:07:14,870 But if you sent the... if an evil server sent the encryption salt and iteration count for the authentication stage, the client would just send the encryption key. 65 00:07:15,810 --> 00:07:18,210 So, that would be really bad. 66 00:07:18,930 --> 00:07:22,830 I forgot which way I decided on doing this. 67 00:07:24,150 --> 00:07:34,910 So, the fix... well... so, they don't like people not praising them. 68 00:07:34,910 --> 00:07:38,070 So, I'm not gonna say this one. 69 00:07:39,470 --> 00:07:45,250 But it was very obvious from the previous slide what they're doing wrong. 70 00:07:45,250 --> 00:07:52,210 Because they're doing exactly the same thing except for the authentication key is now hashed. 71 00:07:52,210 --> 00:07:55,890 So, you can probably figure out what's wrong. 72 00:07:56,110 --> 00:08:07,770 But if any... well, I guess I'm still... if they were using pigs for authentication, then none of these attacks would work. 73 00:08:08,890 --> 00:08:11,470 So, there's a bunch of pigs. 74 00:08:11,470 --> 00:08:13,310 And which one do you use? 75 00:08:13,730 --> 00:08:22,050 So, you may have heard recently about dragon fly and the pony award for dragon blood. 76 00:08:24,350 --> 00:08:31,310 So, basically, it was a timing attack on their hash to point algorithm. 77 00:08:31,310 --> 00:08:35,310 Because it was like an iterated loop which would then leak information. 78 00:08:35,570 --> 00:08:39,830 This is actually known to be bad a while ago. 79 00:08:39,830 --> 00:08:42,450 I don't know why anyone uses dragon fly. 80 00:08:42,450 --> 00:08:44,910 I guess their marketing team is good or something. 81 00:08:45,330 --> 00:08:45,430 But 82 00:08:50,390 --> 00:08:59,430 no one's actually done a real life test on such as with dragon blood, which is the cool part. 83 00:09:00,630 --> 00:09:05,550 Anyway, so, there's SRP 6A. 84 00:09:06,810 --> 00:09:09,070 So, the client's on the left. 85 00:09:09,210 --> 00:09:10,610 Server's on the right. 86 00:09:10,630 --> 00:09:14,050 And those are just... the arrows are just packets going back and forth. 87 00:09:14,050 --> 00:09:29,210 When you see a key, that means at that stage, the... that side can encrypt or send... well, and send the authentication key. 88 00:09:29,210 --> 00:09:30,530 Or, yeah. 89 00:09:30,530 --> 00:09:32,030 Verifier thing. 90 00:09:32,030 --> 00:09:38,310 So, only need to authenticate the user. 91 00:09:38,310 --> 00:09:42,810 Such as, like, logging into an account. 92 00:09:42,810 --> 00:09:46,430 Then you wouldn't need to do the last step. 93 00:09:49,450 --> 00:09:57,870 There's... so, on the server side, the key is actually available after the first packet. 94 00:09:57,970 --> 00:10:12,410 But if you send encrypted data or you... or send the authentication token from the server to the client, the client actually has all the information necessary to do offline brute force. 95 00:10:12,510 --> 00:10:17,570 So, if you were to do that, your implementation would be really, really bad. 96 00:10:18,090 --> 00:10:25,890 So, when I was doing my slides, I remembered seeing something weird on Wikipedia like a year ago. 97 00:10:25,890 --> 00:10:29,490 And being like, wait a minute. 98 00:10:30,390 --> 00:10:32,290 This is wrong. 99 00:10:32,410 --> 00:10:36,050 So, I haven't actually had time to fix this. 100 00:10:36,050 --> 00:10:44,490 But according to this, you can skip M1, which is the authentication method... 101 00:10:45,570 --> 00:10:48,450 verification from the client to the server. 102 00:10:48,450 --> 00:10:51,570 And M2 is verification from the server to the client. 103 00:10:51,570 --> 00:11:12,550 If you skip M1 or... well, if you skip M1 and M2 and then you encrypt data to the client before verifying the encrypted data from the client, then the client has everything it needs to do a offline password cracking. 104 00:11:13,590 --> 00:11:19,990 So, opaque, that's the new hotness. 105 00:11:22,650 --> 00:11:35,840 So, this pig was presented at real world crypto a few years ago. 106 00:11:36,440 --> 00:11:43,500 So, what they introduced was blind salt. 107 00:11:43,500 --> 00:11:45,620 It has this interesting property. 108 00:11:45,620 --> 00:11:52,740 So, with other pigs, the salt is given to the client or, you know, assumed or whatever. 109 00:11:54,240 --> 00:12:01,660 And, you know, like, when I say assumed, I mean, like, the user name combined with the domain name. 110 00:12:01,660 --> 00:12:03,320 That's the salt. 111 00:12:04,240 --> 00:12:15,160 So, what happens with these other pigs is you can run the password KDF, which is expensive, on a bunch of password guesses. 112 00:12:16,040 --> 00:12:19,280 So, you store all those keys. 113 00:12:19,280 --> 00:12:33,620 And then when you want to, what you do is, well, once you're done with enough, you go and break into the server, grab the verification data, and run through all those passwords extremely fast. 114 00:12:33,620 --> 00:12:45,900 So, if you are in a limited time scale from when you get in to when they're going to change passwords or something, you would want to do this. 115 00:12:46,040 --> 00:12:48,160 It's like a theoretical attack. 116 00:12:48,180 --> 00:13:02,180 But with opaque, with the blind salt, there's basically it prevents that by, well, actually, so, you don't really have to read this. 117 00:13:02,180 --> 00:13:03,680 It's just sort of there. 118 00:13:05,320 --> 00:13:08,340 So, this is how blind salt works. 119 00:13:10,260 --> 00:13:20,000 Basically, after it runs through, if you had the wrong password at the beginning, so, H, that's a fast hash. 120 00:13:20,000 --> 00:13:22,340 That's not like a password KDF or anything. 121 00:13:22,560 --> 00:13:25,180 There's no information linkage on this. 122 00:13:25,180 --> 00:13:33,080 There's no way to, you know, from the client's message to know, oh, hey, the password could have been like that or something. 123 00:13:33,640 --> 00:13:43,900 But, so, if the password is wrong at the beginning, then when you get back your blind salt, it will be the wrong salt. 124 00:13:43,900 --> 00:13:48,400 And then when you're doing the password KDF, it will be also wrong. 125 00:13:49,440 --> 00:13:51,940 So, basically, you have to do this all. 126 00:13:52,820 --> 00:13:59,300 There's one small thing with, so, the S column. 127 00:14:01,160 --> 00:14:02,040 Okay. 128 00:14:02,040 --> 00:14:03,300 You can't really see that. 129 00:14:03,440 --> 00:14:18,140 So, server, the part where that's doing its work, if you're doing that with elliptic curves, basically, what's happening is the server is receiving a point and then applying a private value to that. 130 00:14:18,140 --> 00:14:21,200 The same private value every single time. 131 00:14:21,200 --> 00:14:36,560 And what you can do with that is if there's a implementation error, such as this one implementation had a rare carry bug. 132 00:14:37,140 --> 00:14:39,860 And Sean and Filippo, 133 00:14:43,700 --> 00:14:48,400 they did a black hat talk about breaking that. 134 00:14:48,400 --> 00:14:54,960 They were able to, so, every now and then, given a point, it would cause an error. 135 00:14:54,960 --> 00:15:00,240 And when the value was incorrect, they could then determine some information about the private key. 136 00:15:00,240 --> 00:15:03,720 They were able to recover the entire private key. 137 00:15:03,720 --> 00:15:24,170 So, if the secret, the server is ever leaked in a case like that, then it would completely break opaque because that would give you all the data as an attacker to do line password cracking. 138 00:15:25,130 --> 00:15:26,650 So, 139 00:15:31,860 --> 00:15:40,500 SPake 2 plus EE with blind salt. 140 00:15:40,560 --> 00:15:42,360 That's a mouthful. 141 00:15:42,360 --> 00:15:51,660 So, basically, what I did was I added blind salt to SPake 2 plus EE. 142 00:15:51,940 --> 00:15:59,360 And I ended up making the name smaller to BSpake or BSpake. 143 00:15:59,380 --> 00:16:06,660 So , basically, it's similar to the round trips. 144 00:16:06,660 --> 00:16:12,140 Well, it is the same as the round trips for SRP. 145 00:16:14,360 --> 00:16:20,360 Except for this has an extra property that not many Pakes have. 146 00:16:20,360 --> 00:16:28,000 Well, it also has the property that opaque has where it prevents precomputations. 147 00:16:29,800 --> 00:16:35,580 So, this also has a property that is fairly interesting. 148 00:16:35,660 --> 00:16:39,080 So, it's sort of quantum resistant. 149 00:16:39,080 --> 00:16:40,900 I call it quantum annoying. 150 00:16:40,900 --> 00:16:42,660 It's not really a quantum easy problem. 151 00:16:42,660 --> 00:16:44,980 It's not a quantum hard problem. 152 00:16:44,980 --> 00:17:00,300 Basically, most Pakes, you have to solve one DLP and then you can do offline classical computer password guessing. 153 00:17:00,300 --> 00:17:08,720 But with BSpake, you have to solve one DLP for every password guess. 154 00:17:08,720 --> 00:17:19,620 So, it's fairly expensive because even if we did have quantum computers, I forgot to look this up. 155 00:17:19,620 --> 00:17:36,780 There's this paper that tells you, like, how many quantum operations you have to do to solve a DLP for a 256-bit elliptic curve, which is on the order of a few billion. 156 00:17:37,080 --> 00:17:51,580 So, even if you could do, if your theoretical quantum computer could do a billion quantum operations per second, you're looking at, you know, .1 passwords per second with a very expensive computer. 157 00:17:51,580 --> 00:17:55,720 There is a PQPake. 158 00:17:55,720 --> 00:17:58,660 I haven't actually looked into it that much. 159 00:17:58,740 --> 00:18:07,840 But, basically, with post-quantum algorithms, we don't really trust them that well yet. 160 00:18:07,840 --> 00:18:17,040 So, we usually run them in parallel with classical cryptography, like elliptic curves and whatnot. 161 00:18:17,040 --> 00:18:28,040 And so, with a Pake, you can't really run a PQPake next to a BSPake . 162 00:18:29,440 --> 00:18:33,480 Because you wouldn't get the combination. 163 00:18:33,480 --> 00:18:36,740 It would be whichever is the weakest one. 164 00:18:37,220 --> 00:18:44,100 So, basically , I think the best Pake to use is BSPake. 165 00:18:44,100 --> 00:18:49,400 So, this brings us to password KDFs. 166 00:18:49,400 --> 00:18:52,120 So, there's many different ones. 167 00:18:52,180 --> 00:19:00,320 One that you probably have heard of, or most common, probably, is just computationally hard. 168 00:19:00,320 --> 00:19:02,540 It's called PBKDF2. 169 00:19:02,540 --> 00:19:05,440 There's just one small problem with it. 170 00:19:05,440 --> 00:19:07,420 It has a foot gun. 171 00:19:07,760 --> 00:19:13,060 So, it runs in iterations times output length. 172 00:19:13,060 --> 00:19:25,880 So, if you ask for so, if you're doing PBKDF2 HMAC SHA-256, each block of output of SHA-256 is 256 bits. 173 00:19:25,880 --> 00:19:33,380 So, if you ask for 256 bits of key, then you only do iterations amount of work. 174 00:19:33,380 --> 00:19:44,860 But if you ask for 257 bits, then it has to do two blocks, and thus, it needs to do twice as much work. 175 00:19:45,540 --> 00:20:05,540 So, one password, they generated an IV and a key from PBKDF2, and an attacker only needed to generate one of those blocks and decrypt some stuff. 176 00:20:05,680 --> 00:20:09,400 And it was Adam from Hashcat that found that. 177 00:20:09,400 --> 00:20:19,440 And then, technically, Google Sync isn't on this list, but I like bringing them up because they did fairly bad. 178 00:20:19,440 --> 00:20:32,400 Basically, for Google Sync, they use Nigori, which the first thing that they do is they use PBKDF2 on constant data to generate assault. 179 00:20:32,400 --> 00:20:39,500 Then they do three more runs of PBKDF2 to generate three different keys. 180 00:20:39,520 --> 00:20:48,120 Technically, they could have done PBKDF2 with just like a long output, which is kind of like what the foot gun would have done. 181 00:20:48,800 --> 00:21:04,880 And then Microsoft, they were using was SHA1 base, so 160 bits, and they were asking for, or they were storing 256 bits. 182 00:21:04,880 --> 00:21:12,300 So, their servers had to do twice as much calculations as an attacker would have to. 183 00:21:12,900 --> 00:21:18,480 But, good thing, each block of output is independently generated. 184 00:21:18,560 --> 00:21:23,960 So, is the foot gun to actually make PBKDF2 better? 185 00:21:23,960 --> 00:21:28,280 Because what they're doing, each block is independently generated. 186 00:21:28,280 --> 00:21:34,540 So, you can use SIMD, which is single instruction multiple data. 187 00:21:34,540 --> 00:21:43,000 So, with x86, you have SC2, AVX, AVX2, AVX512. 188 00:21:43,380 --> 00:21:53,380 AVX512, that can run 16 iterations of PBKDF2 SHA256 at the same time. 189 00:21:53,540 --> 00:22:00,480 So, it would be 16 times more work being done in the same amount of time, and then you have multiple cores. 190 00:22:00,480 --> 00:22:07,960 So, you can make PBKDF a little bit better, but still, other algorithms are better. 191 00:22:08,420 --> 00:22:15,680 You really shouldn't be using a script at this point, because of the time memory tradeoff. 192 00:22:15,980 --> 00:22:26,710 Basically, an attacker is the only one that actually uses this, to their advantage, because they use less memory, and they do a little bit more work. 193 00:22:27,850 --> 00:22:31,790 And it ends up being faster overall. 194 00:22:31,950 --> 00:22:45,070 So, instead, you should be using Argon2, but the problem with Argon2 is for short runs, for like authentication, you can't use enough memory. 195 00:22:45,070 --> 00:22:47,070 It's just too slow. 196 00:22:47,430 --> 00:22:58,210 So, technically, a better algorithm would be a cache hard algorithm. 197 00:22:59,130 --> 00:23:08,770 Bcrypt isn't actually a KDF, but there are some weird ones like PBKDF, Bcrypt, or whatever. 198 00:23:08,850 --> 00:23:10,810 And then there's also Pufferfish. 199 00:23:10,810 --> 00:23:13,570 There are issues, but whatever. 200 00:23:14,590 --> 00:23:25,570 Really, I would say, currently, Argon2 would probably be the ideal way to go. 201 00:23:26,550 --> 00:23:45,030 So, with, so, the problem with pick APIs is, so, this is what you usually see when you see an implementation of SRP. 202 00:23:45,330 --> 00:23:49,570 So, calculate B, calculate M2, what's V? 203 00:23:49,870 --> 00:23:56,210 And, you know, so, basically, the developer has to figure out what all these are. 204 00:23:56,270 --> 00:24:11,950 And then they're like, okay, and some implementations leave it up to the developer to figure out whether, how they're supposed to check M1, M2, which one they send first, and whatnot. 205 00:24:11,950 --> 00:24:20,410 And as I said before, with SRP, this can lead to very bad bugs. 206 00:24:21,210 --> 00:24:29,770 So, a good API would be one that is easy to use and hard to misuse. 207 00:24:30,390 --> 00:24:37,210 So, basically, you start, you say who you are, who the other person is, and your secret. 208 00:24:37,210 --> 00:24:43,110 If you're a client, or, you know, it's a symmetric pick, this would be a password. 209 00:24:43,230 --> 00:24:46,870 If you're the server, then this would be your server secret data. 210 00:24:47,350 --> 00:24:56,250 Then you say, you let the API know what type of user you are and what type of mode you're using. 211 00:24:56,290 --> 00:25:00,050 And it will return a message status. 212 00:25:00,490 --> 00:25:03,630 You check the status for whatever. 213 00:25:03,670 --> 00:25:07,470 And the message, you may or may not get a message back. 214 00:25:07,470 --> 00:25:12,770 If you do, you send it to the other side. 215 00:25:17,450 --> 00:25:23,710 So, when you receive a message, you pass it into receive message. 216 00:25:23,710 --> 00:25:26,530 And then you get another message and a status. 217 00:25:26,730 --> 00:25:29,650 And every time you get a message, you send it to the other side. 218 00:25:29,650 --> 00:25:33,530 And you check to see if you're finished by the status. 219 00:25:34,090 --> 00:25:38,510 And then there's certain other things that you can do. 220 00:25:38,550 --> 00:25:41,190 Like, get server secret. 221 00:25:41,330 --> 00:25:43,890 Get user key. 222 00:25:44,310 --> 00:25:49,910 So, user key is a little bit different. 223 00:25:49,910 --> 00:25:52,650 It's kind of unrelated to pigs. 224 00:25:52,650 --> 00:25:58,410 But so, you're supposed to only run the password KDF once. 225 00:25:59,390 --> 00:26:01,790 And derive two keys from it. 226 00:26:01,790 --> 00:26:04,390 An authentication key and an encryption key. 227 00:26:04,390 --> 00:26:17,770 And since we're using blind salt and we can't generate two keys beforehand and give it to the API, we have the API run the password KDF. 228 00:26:19,250 --> 00:26:28,410 If you need a user key, which is user specific based on the password to encrypt data that only the user can read. 229 00:26:28,950 --> 00:26:34,930 So, you know, like a password vault or a, you know, encrypted backup or something. 230 00:26:35,510 --> 00:26:40,770 So, you know, what's client server. 231 00:26:40,990 --> 00:26:43,350 So, those are for augmented. 232 00:26:43,350 --> 00:26:46,750 And then Alice, Bob. 233 00:26:46,750 --> 00:26:51,130 So, there are some pigs where you have to say, I'm Alice, they're Bob. 234 00:26:51,190 --> 00:26:53,150 And vice versa. 235 00:26:53,150 --> 00:26:57,570 Or you can say, I'm either Alice or Bob. 236 00:26:57,570 --> 00:26:59,570 And the pig figures it out. 237 00:27:00,490 --> 00:27:05,110 And then mode uses, you know, you're using the pig. 238 00:27:05,110 --> 00:27:08,830 And then register. 239 00:27:08,830 --> 00:27:13,950 That just generates the server and gets sent to the server. 240 00:27:13,970 --> 00:27:19,170 Then the other two are special for a special case that we'll talk about later. 241 00:27:21,350 --> 00:27:23,770 You know, so, these are just the flags. 242 00:27:23,850 --> 00:27:24,990 Session key available. 243 00:27:24,990 --> 00:27:26,470 That means you can encrypt. 244 00:27:26,470 --> 00:27:28,490 So, that's there. 245 00:27:28,490 --> 00:27:34,530 Then you can get the session key and then start encrypting data to the other side. 246 00:27:34,710 --> 00:27:36,310 Server secret available. 247 00:27:36,410 --> 00:27:38,430 Fairly self explanatory. 248 00:27:39,070 --> 00:27:40,610 Verified other. 249 00:27:40,990 --> 00:27:44,850 You have already authenticated the other party. 250 00:27:44,850 --> 00:27:54,490 So, in the event that, like, you only want to verify the user, you could stop right then. 251 00:27:54,490 --> 00:28:03,530 Because if you're the server, because that's the whole entire goal is just verify that the user's password is correct. 252 00:28:04,770 --> 00:28:07,130 So, fairly straightforward. 253 00:28:11,690 --> 00:28:16,650 So, this is just, so, Carol, client, Steve, server. 254 00:28:16,650 --> 00:28:17,810 Hey, that's me. 255 00:28:18,710 --> 00:28:27,370 Those are actually the common names that are used for describing client and user. 256 00:28:28,910 --> 00:28:31,290 Just like, you know, Alice, Bob. 257 00:28:31,850 --> 00:28:35,670 So, fairly easy. 258 00:28:36,570 --> 00:28:42,850 So, the server doesn't have a server secret yet because it's on register. 259 00:28:42,850 --> 00:28:44,030 So, no. 260 00:28:44,490 --> 00:28:49,470 And, you know, for using, fairly straightforward. 261 00:28:49,910 --> 00:28:55,870 The common, this is for using or it's all pseudocode. 262 00:28:55,870 --> 00:28:59,890 But for using or registering. 263 00:28:59,890 --> 00:29:03,670 Because all you're doing is waiting until it's finished or errored out. 264 00:29:03,670 --> 00:29:07,130 And then you're just passing messages back and forth. 265 00:29:10,150 --> 00:29:12,990 There we go. 266 00:29:13,150 --> 00:29:17,250 So, HSM. 267 00:29:19,470 --> 00:29:35,410 So, basically, what you can do as a server is you can have an HSM that store, that has, that you give it encrypted data. 268 00:29:35,910 --> 00:29:42,370 And what it does is it does the whole PAKE algorithm on its own. 269 00:29:42,370 --> 00:29:56,270 So, that if your database ever gets leaked, then the an attacker wouldn't have the decryption key necessary to decrypt the verifying data. 270 00:29:56,270 --> 00:30:03,410 And they wouldn't be able to crack any passwords. 271 00:30:03,970 --> 00:30:09,690 So, the way it would work is, so, the is on the far left. 272 00:30:09,830 --> 00:30:11,250 Out of the picture. 273 00:30:11,250 --> 00:30:12,390 One goes that way. 274 00:30:12,390 --> 00:30:13,730 That's basically. 275 00:30:14,190 --> 00:30:16,830 So, finds the user. 276 00:30:16,830 --> 00:30:17,730 Gets the encrypted data. 277 00:30:17,730 --> 00:30:22,170 Sends it to the HSM. 278 00:30:22,250 --> 00:30:23,150 Decrypts it. 279 00:30:23,150 --> 00:30:25,710 And then it has the server secret data. 280 00:30:25,710 --> 00:30:29,490 Then it runs the PAKE and gets the session key. 281 00:30:29,970 --> 00:30:39,370 Then this is actually a slide from another talk that I gave a few years ago at B sides. 282 00:30:39,630 --> 00:30:45,990 So, this was for when you have, like, an encrypted service. 283 00:30:45,990 --> 00:30:48,370 So, you would have an encrypted master key. 284 00:30:48,370 --> 00:30:52,850 So, that when you change your password, you didn't have to reencrypt everything. 285 00:30:52,850 --> 00:31:00,130 So, what some does is, it encrypts the master key with the session key. 286 00:31:00,130 --> 00:31:02,950 Sends that over to the client. 287 00:31:02,950 --> 00:31:10,790 No one in between the HSM and the client can read these packets because of the PAKE session. 288 00:31:11,390 --> 00:31:37,730 And then a little bonus feature is, you can drive a second key from the session key or another session key from the session key and give that to the server so that they can talk to the client in a way such that no one in between the server and the client can man in the middle of that without knowing the password. 289 00:31:40,050 --> 00:31:41,850 So, secret salt. 290 00:31:45,350 --> 00:31:51,670 So, this is used by, well, they call it something else. 291 00:31:51,670 --> 00:31:53,590 They changed the name a few times. 292 00:31:53,590 --> 00:31:55,730 This is used by one password. 293 00:31:58,750 --> 00:32:04,350 So, what this allows you to do is, it's basically a key that's on your device. 294 00:32:04,390 --> 00:32:08,910 And you never send it to the server or anything like that. 295 00:32:09,210 --> 00:32:14,550 And you basically transfer it to all your devices some way. 296 00:32:14,770 --> 00:32:33,510 And then what it does is, it makes it so that an attacker would have to get your device, get the secret salt, and then they can then do online password guessing to the server. 297 00:32:34,870 --> 00:32:45,230 Which means that if it was in, like, a password manager, it would be actually more secure than an offline password manager. 298 00:32:50,170 --> 00:32:55,230 So, there is one small thing about one password. 299 00:32:57,610 --> 00:33:27,030 So, they require you to use a, their web client, which means if their servers are ever attacked or, you know, infiltrated, then when you do use the web client, then they can extract, send malicious JavaScript, which then can extract your key, which would be bad. 300 00:33:27,030 --> 00:33:40,610 But that's only during administration because that's not actually implemented in any of the other apps that they have. 301 00:33:43,210 --> 00:33:50,390 So, recovering a lost secret salt. 302 00:33:50,490 --> 00:33:52,450 I wrote a blog post about it. 303 00:33:52,450 --> 00:33:55,730 You can actually just go to tab2.com slash blog. 304 00:33:56,410 --> 00:34:05,990 I was lazy and it's just, like, you can, it's just directories. 305 00:34:06,690 --> 00:34:15,250 So, so, to the basic idea behind recovering a secret salt. 306 00:34:16,030 --> 00:34:21,890 So, if you ever lose the secret salt, then you're screwed. 307 00:34:22,490 --> 00:34:28,430 Even though you know your password, you just can't log in. 308 00:34:28,430 --> 00:34:37,190 And this would be really bad for users, which is why you need to make paper copies, which they won't make and what. 309 00:34:37,190 --> 00:34:54,930 But so, taking a recovery option for secret salt would invalidate the entire idea of having a secret salt, except there's this little trick. 310 00:34:54,990 --> 00:35:10,810 So, when you're doing, so, the recovery method is you do the password KDF with the, with another blind salt and your password and this guessing salt. 311 00:35:10,810 --> 00:35:13,290 It's, like, 16 bits. 312 00:35:13,290 --> 00:35:19,430 And what you do is after you run the password KDF, you throw away those 16 bits. 313 00:35:19,450 --> 00:35:30,950 And what you have to do from then is you have to, when you're recovering, you have to brute force those 16 bits that you don't know. 314 00:35:31,050 --> 00:35:45,770 So, if you ran a password KDF that was Argon 2 with 256 meg, one thread, three iterations, it would run for about one second on your computer. 315 00:35:45,830 --> 00:35:48,230 So, it would be, like, 18 hours. 316 00:35:48,230 --> 00:35:57,610 You probably have a few less bits than that so that it would run in a more reasonable amount of time, like, a couple hours. 317 00:35:58,250 --> 00:36:04,250 The thing is, you never actually, you're rarely ever doing this. 318 00:36:04,250 --> 00:36:17,210 So, from the user standpoint, it's, I never get my account back or I have to do two hours of hard computations on my computer. 319 00:36:18,010 --> 00:36:32,970 And since it takes, you know, two hours for one password guess, if a password cracker got this, that is a ridiculously slow speed. 320 00:36:33,170 --> 00:36:43,110 So, the recovery method also uses a pake and whatnot. 321 00:36:43,270 --> 00:36:49,450 But that's what those two extra ones were, the blind salt. 322 00:36:49,450 --> 00:36:58,350 So , you would actually need to do... there we go. 323 00:36:58,350 --> 00:37:06,870 So, these two, blind salt, only blind salt, you would do that with your password and then you would get back your blind salt. 324 00:37:06,870 --> 00:37:14,730 Then you would go and do your, basically, brute force the guessing salt. 325 00:37:14,730 --> 00:37:23,010 And then after that, you would have a bunch of candidates, which you would then use after blind salt. 326 00:37:23,050 --> 00:37:28,030 You're also given a very short, a smaller hash than the guessing salt. 327 00:37:28,030 --> 00:37:36,370 So, you'll have a few, like, 10 or whatever that you would have to do. 328 00:37:38,810 --> 00:37:41,550 Pake operations with the server. 329 00:37:42,450 --> 00:37:51,910 Then you would have a session key and then you would decrypt the secret salt that you lost. 330 00:37:51,910 --> 00:37:53,270 And then you would have it back. 331 00:37:55,630 --> 00:37:56,670 Questions? 332 00:37:57,170 --> 00:37:57,890 Yeah. 333 00:37:57,890 --> 00:38:00,250 All right. 334 00:38:00,290 --> 00:38:02,110 Thank you very much. 335 00:38:02,470 --> 00:38:03,530 Any questions? 336 00:38:03,530 --> 00:38:06,270 I'm slowly making my way up to the front. 337 00:38:09,850 --> 00:38:12,050 Can we have this with the mic, please? 338 00:38:12,050 --> 00:38:13,170 I'll be right there. 339 00:38:15,250 --> 00:38:15,930 Thanks. 340 00:38:15,930 --> 00:38:17,150 Sorry, I walked in late. 341 00:38:17,150 --> 00:38:19,410 I missed what a blind salt is. 342 00:38:19,470 --> 00:38:22,530 I missed what a blind salt is. 343 00:38:22,530 --> 00:38:23,430 Oh! 344 00:38:23,510 --> 00:38:24,210 I walked in. 345 00:38:24,210 --> 00:38:24,770 Sorry. 346 00:38:24,770 --> 00:38:25,910 There we go. 347 00:38:27,490 --> 00:38:33,590 So, basically, blind salt prevents pre-computational attacks. 348 00:38:34,650 --> 00:38:40,410 It was first added into a pake with opaque. 349 00:38:42,710 --> 00:39:04,080 So, basically, with this, so, basically, after you run through this, if you had the wrong password, you have the wrong salt for when you run your password KDF. 350 00:39:04,080 --> 00:39:09,340 And there's no information leakage in the algorithm. 351 00:39:09,340 --> 00:39:18,040 So, you can't, like, guess or whatnot what the password was from the server side. 352 00:39:18,760 --> 00:39:23,620 And this makes it so that you have to do online password guessing. 353 00:39:28,660 --> 00:39:30,660 Well, thanks for doing this talk, Steve. 354 00:39:30,660 --> 00:39:35,460 I think pakes are definitely underutilized and the landscape is definitely kind of confusing. 355 00:39:35,780 --> 00:39:42,980 So, have you thought about contributing an implementation of your API to something like Libsodium just to make it easier for developers? 356 00:39:44,180 --> 00:39:49,860 So, the nice thing is, you can actually, you don't really have to write much. 357 00:39:49,860 --> 00:39:56,370 You just have to write the, basically, like a wrapper for current implementation. 358 00:39:57,560 --> 00:40:00,280 What project did you say? 359 00:40:01,080 --> 00:40:05,020 Libsodium or any other general crypto library? 360 00:40:06,620 --> 00:40:07,580 Yeah. 361 00:40:08,400 --> 00:40:14,980 I did talk to, I forgot his name. 362 00:40:15,260 --> 00:40:17,460 Libsodium guy. 363 00:40:18,520 --> 00:40:19,700 Yeah. 364 00:40:21,160 --> 00:40:24,240 He didn't like it. 365 00:40:24,580 --> 00:40:26,500 What? 366 00:40:27,320 --> 00:40:29,860 No, he didn't like it. 367 00:40:30,280 --> 00:40:32,320 But, yeah. 368 00:40:32,320 --> 00:40:33,740 Thanks for your talk. 369 00:40:33,740 --> 00:40:38,120 Could you repeat, again, how Opaque and BSpake compare? 370 00:40:38,120 --> 00:40:40,180 Are they different? 371 00:40:40,880 --> 00:40:54,540 So, Opaque, basically, so, with Opaque, it's fragile for implementations because of the blind salt. 372 00:40:55,280 --> 00:41:17,180 Basically, if you solve that DLP or figure out, you know, like, what the salt is through some coding error, like the carry propagation, then the, an attacker would be able to get offline pass or guessing. 373 00:41:17,580 --> 00:41:28,760 And with BSpake, it does add some, another pass back and forth. 374 00:41:28,760 --> 00:41:31,120 Or, well, one more trip. 375 00:41:31,220 --> 00:41:39,320 But it has an extra property that is quantum annoying. 376 00:41:40,540 --> 00:41:42,920 It's just a name I came up with. 377 00:41:42,920 --> 00:41:44,320 I'm not really attached to it. 378 00:41:44,320 --> 00:42:13,660 But, um, basically, uh, due to the hash to point blinding on, uh, the, well, the, uh, the base function, uh, uh, uh, SPake 2 plus EE that it's based off of, uh, that blinding, uh, prevents, you, well, it requires you to, uh, solve one DLP for every password guess. 379 00:42:14,100 --> 00:42:31,220 So, um, so with hash to point, um, what that does is it creates a point on the curve that you don't know what the, um, the, uh, the, uh, discrete log is. 380 00:42:31,580 --> 00:42:46,920 So, uh, when you are trying to attack this, you would have to guess a password, then hash it, it would go hash to point, then you subtract it from the message that you saw that went by. 381 00:42:46,920 --> 00:42:52,400 And then you would have to solve the, uh, the DLP for what's left. 382 00:42:52,460 --> 00:42:54,620 And you would have to do that every single time. 383 00:42:54,620 --> 00:43:00,380 First, other picks where you just have to solve one and then you have everything that you need. 384 00:43:01,020 --> 00:43:04,280 Oh, there was one other thing with Opaque. 385 00:43:04,280 --> 00:43:23,300 Uh, you don't need to observe a successful key exchange, but with, uh, uh, Bspake, um, you have to observe a successful key exchange to be able to then, uh, use a quantum computer if it were to exist. 386 00:43:23,700 --> 00:43:27,120 Uh, and you'd have to do one for every guess. 387 00:43:29,180 --> 00:43:31,420 Any further questions? 388 00:43:34,430 --> 00:43:35,270 All right. 389 00:43:35,270 --> 00:43:37,370 One last round of applause for our speaker. 390 00:43:37,370 --> 00:43:38,190 Thank you.