1 00:00:00,000 --> 00:00:04,880 Welcome our next speaker. Adam is going to be talking to us today about revolutionizing 2 00:00:04,880 --> 00:00:17,000 authentication with oblivious cryptography. Take it away Adam. Thanks Rihanna. Good 3 00:00:17,000 --> 00:00:20,620 evening everyone. Thank you for coming to the crypto village. Thank you for coming to see my 4 00:00:20,620 --> 00:00:25,160 talk. I'm going to talk about a technique that we call oblivious password hardening. Oblivious 5 00:00:25,160 --> 00:00:30,300 password hardening or oblivious password protection. First some introductions. I'm Adam 6 00:00:30,300 --> 00:00:36,380 Eberspaugh, oh hi. I'm the cryptography expert at a software technology company called Uptake in 7 00:00:36,380 --> 00:00:41,580 Chicago. But what I'm presenting today is some work I did when I was a PhD student at the 8 00:00:41,580 --> 00:00:46,560 University of Wisconsin. And that's joint work with these gentlemen. Some of these folks are here. 9 00:00:46,760 --> 00:00:53,260 Sam Scott is here in the audience. And all these folks are now at Cornell Tech. And lastly I'm 10 00:00:53,260 --> 00:00:55,140 going to give a live demo of implementation of this technology. I'm going to give a live demo of 11 00:00:55,160 --> 00:00:58,860 implementation of this technique later in the talk. And that live demo was developed by Virgil 12 00:00:58,860 --> 00:01:05,720 security. Which is an open source version of this. And the founder of Virgil is here. Dimitri Dane 13 00:01:05,720 --> 00:01:09,340 is here. So if you have any questions about the software or the technology, come talk to me 14 00:01:09,340 --> 00:01:15,320 afterwards. I'll introduce you to Dimitri. So we use passwords every day to authenticate to our 15 00:01:15,320 --> 00:01:19,720 devices and to online services. The way we store those passwords is fundamentally broken. 16 00:01:20,120 --> 00:01:24,740 Because databases are compromised. And when they are, there's no way to stop offline dictionary 17 00:01:24,740 --> 00:01:30,200 attacks. Today I'm going to present to you a new direction. A solution that not only eliminates 18 00:01:30,200 --> 00:01:35,520 these attacks, but also enables compromised recovery. Well let's start with a concrete 19 00:01:35,520 --> 00:01:41,980 example. All right. So maybe you've gotten an e-mail like this. A scumbag polar bear wants to 20 00:01:41,980 --> 00:01:46,680 connect with you on LinkedIn. He sends you an e-mail. You navigate to a website that looks like 21 00:01:46,680 --> 00:01:51,940 this. Now in order to log into LinkedIn you must provide an e-mail address and a password. And of 22 00:01:51,940 --> 00:01:54,720 course LinkedIn has to store that password in some way. So they can send you an e-mail and you can 23 00:01:54,720 --> 00:01:59,940 tell if it's the same password every time. Here are the typical ways that websites store 24 00:01:59,940 --> 00:02:05,380 passwords. They either store passwords in plain text. No joke. This happens. Ask Twitter. They 25 00:02:05,380 --> 00:02:11,060 perform a hash of that password and store the hash. They perform a hash with a salt and then 26 00:02:11,060 --> 00:02:15,320 they store the salt and the hash in a database. Or they use some kind of like iterated hash 27 00:02:15,320 --> 00:02:19,820 function. Like you may apply the hash function say 10,000 times in a row and then store the salt 28 00:02:19,820 --> 00:02:24,540 in the hash. Okay. So pop quiz. This is a little bit of a trivia. Who here knows how LinkedIn was 29 00:02:24,540 --> 00:02:32,460 storing passwords in 2012? Two people. Somebody I don't know right there. You want to guess? 30 00:02:35,060 --> 00:02:39,900 Unsalted hashes. That's true. Now the reason we know this is not because LinkedIn had a press 31 00:02:39,900 --> 00:02:44,560 release. It's because attackers broke into LinkedIn in 2012. They stole something like 100 32 00:02:44,560 --> 00:02:48,800 million passwords. They leaked some of those online, those hashes online. And when they did 33 00:02:48,800 --> 00:02:53,680 security researchers had a field day. They were able to crack most of those passwords in just two 34 00:02:53,680 --> 00:02:58,240 weeks with off the shelf hardware. Now the reason those attacks were so devastating and so fast 35 00:02:58,240 --> 00:03:01,620 was because they were using unsalted hashes. But what I want to point out to you is those 36 00:03:01,620 --> 00:03:07,160 attackers have 100 million passwords. Even if LinkedIn was using what's considered like 37 00:03:07,160 --> 00:03:11,520 industry standards today, like the best protection, which is some kind of iterated hash 38 00:03:11,520 --> 00:03:15,560 function or hard hash function, this doesn't actually stop offline attacks. It just slows them 39 00:03:15,560 --> 00:03:20,500 down. Which means attackers just throw more iron at the problem. So all the techniques that are 40 00:03:20,500 --> 00:03:23,660 storing plain text passwords, we basically call hash and hope. Your hope is that you're going to 41 00:03:23,660 --> 00:03:25,820 crack those passwords. We're hoping the attacker is not going to spend enough time and energy to 42 00:03:25,820 --> 00:03:30,260 crack those passwords because if they do, they will crack all those passwords. All right. So I'm 43 00:03:30,260 --> 00:03:36,280 picking on LinkedIn. But let's just say password database compromises are really not that 44 00:03:36,280 --> 00:03:40,460 uncommon. Right? And what I want to point out is these aren't just like fly by night startups. 45 00:03:40,740 --> 00:03:45,040 These are sophisticated technology companies. They're repeatedly breached. These passwords are 46 00:03:45,040 --> 00:03:49,480 stolen. They have the technology. They have the motivation. They have the skill set to stop 47 00:03:49,480 --> 00:03:53,640 these database breaches. And yet they are often unable to do it. Okay. So of course we're 48 00:03:53,660 --> 00:03:57,540 going to limit these breaches whenever possible. But even when they do occur, we want some kind of 49 00:03:57,540 --> 00:04:01,580 protection. Right? We want to move beyond hash and hope. So let's look at a different way to 50 00:04:01,580 --> 00:04:07,880 protect passwords. In January 2015, Facebook presented this slide at real world crypto 51 00:04:07,880 --> 00:04:13,460 conference in London. This slide is pseudo code of how password, of how Facebook processes a new 52 00:04:13,460 --> 00:04:18,340 or changed password when you log into Facebook. All right. So I'll give you a minute to take a 53 00:04:18,340 --> 00:04:23,160 look at it and then we'll talk through it. Okay. So this is what Facebook does. They take your 54 00:04:23,660 --> 00:04:27,520 password. They run it through a deprecated hash function called MD5. They choose a random 20 55 00:04:27,520 --> 00:04:31,640 byte salt. They take the output of MD5 plus the salt. They run it through a deprecated hash 56 00:04:31,640 --> 00:04:35,480 function called HMACSHOT1. They take that result and send it to a remote machine that applies 57 00:04:35,480 --> 00:04:39,780 remote HMACSHOT56 where the secret sends the result back. They run that through a memory hard 58 00:04:39,780 --> 00:04:45,280 function called S-grip. Take the output of S-grip run it through HMACSHOT56. Got that? All 59 00:04:45,280 --> 00:04:50,220 right. So it's a little confusing. You might be wondering why would Facebook, who presumably 60 00:04:50,220 --> 00:04:53,640 knows something about security, do something like this? They run it through a memory hard function 61 00:04:53,660 --> 00:04:57,860 called HMACSHOT2. Well, the reason they do this is historical. Once upon a time, Facebook had 62 00:04:57,860 --> 00:05:03,900 800 million passwords sitting around a database protected by MD5. Security said, holy F, we have 63 00:05:03,900 --> 00:05:08,320 800 million passwords sitting around a database protected by MD5. How are we going to fix this? 64 00:05:09,340 --> 00:05:12,820 Well, Facebook doesn't want to make you change your password. They don't want to wait for all 65 00:05:12,820 --> 00:05:18,720 800 million users to log in so they can rehash those with, say, HMACSHOT2. So instead the 66 00:05:18,720 --> 00:05:23,560 security team says, let's do this. Take all the existing passwords, choose a random 20 byte 67 00:05:23,660 --> 00:05:30,040 salt, run them through HMACSHOT1, write that back to the database. Cool, we're done, right? Two 68 00:05:30,040 --> 00:05:34,900 years later, they get 1.1 billion passwords. They say, holy F, we got 1.1 billion passwords stored 69 00:05:34,900 --> 00:05:38,280 in HMACSHOT1 in the database. What are we going to do? But look, we solved this problem before. 70 00:05:39,420 --> 00:05:45,920 Add HMAC to the secret. Doing good, right? All right. So sometime later, they want to do 71 00:05:45,920 --> 00:05:50,860 something better. They add S-grip. Now, the output of S-grip is really long. So finally they 72 00:05:50,860 --> 00:05:53,640 run it through HMACSHOT2 literally just to compress it, compress it, compress it, compress it 73 00:05:53,660 --> 00:05:58,740 literally just to compress it down so it fits in the database better. Okay. So what we're left 74 00:05:58,740 --> 00:06:03,460 with is this pseudocode, which is now an archeological record of Facebook struggling to 75 00:06:03,460 --> 00:06:08,840 protect passwords. All right. But I want to point out something interesting here. Something 76 00:06:08,840 --> 00:06:13,580 most technology companies do. Most of this processing happens on the same server. But at 77 00:06:13,580 --> 00:06:17,900 some point during this processing, Facebook reaches out to a second server. That server 78 00:06:17,900 --> 00:06:22,880 applies an HMACSHOT26 with a secret held only on that server and sends a result back. And 79 00:06:22,880 --> 00:06:28,160 that's actually really neat. That's neat because it leads to a different kind of architecture. At a 80 00:06:28,160 --> 00:06:33,360 high level, the architecture looks like this. User submits a password. Web server does some local 81 00:06:33,360 --> 00:06:37,800 processing. Connects to the crypto server. Crypto server applies. It sends it back. Now, the 82 00:06:37,800 --> 00:06:42,740 reason we like this architecture, this is now critical information is split between at least two 83 00:06:42,740 --> 00:06:47,240 different machines. So if I break into a web server, I get passwords but no key. If I break 84 00:06:47,240 --> 00:06:51,820 into a crypto server, I get a key but no passwords. Okay. This is already better. But there's 85 00:06:51,820 --> 00:06:52,860 still some problems with things like this. So I'm going to show you a little bit of a 86 00:06:52,860 --> 00:06:58,280 Facebook implementation. First off, there's a cryptographic key. Right? Security people might 87 00:06:58,280 --> 00:07:02,600 say, how do I rotate that key? Well, the dirty little secret inside Facebook is they can never 88 00:07:02,600 --> 00:07:06,600 rotate that key. Right? It's in the middle of a bunch of one-way functions. If you change that 89 00:07:06,600 --> 00:07:10,960 key, you effectively delete all 2 billion passwords in that database. So if you want to 90 00:07:10,960 --> 00:07:16,000 change the key, you have to keep adding these like HMACSHOT256s to the end of the process. 91 00:07:16,340 --> 00:07:22,840 Okay. So that's not good. Secondly, because of this particular API, the way that this 92 00:07:22,840 --> 00:07:27,100 request come in, it's really difficult, it's actually impossible in some cases, for a crypto 93 00:07:27,100 --> 00:07:31,620 server to tell the difference between a large volume of legitimate requests. Like 10,000 94 00:07:31,620 --> 00:07:36,640 different people are logging in with different passwords versus one attacker sending 10,000 95 00:07:36,640 --> 00:07:42,920 guesses for a single sysadmin's account. Okay. So for the rest of this talk, I'm going to leave 96 00:07:42,920 --> 00:07:46,620 behind the state of the art. I'm going to talk about our contribution to this problem. So we 97 00:07:46,620 --> 00:07:52,640 like this architecture. We're going to start with this architecture. I'm going to rename the crypto 98 00:07:52,840 --> 00:07:57,700 server to the pipia server. And we're going to fix some of those problems. We're going to change 99 00:07:57,700 --> 00:08:01,740 the API. We're going to change it in a way that allows the crypto server to detect online 100 00:08:01,740 --> 00:08:07,720 attacks. We're going to build in support for key rotation. And key rotation is going to be really 101 00:08:07,720 --> 00:08:12,080 powerful. This is going to allow us to recover from compromises and also proactively rotate 102 00:08:12,080 --> 00:08:16,920 keys. And when we rotate keys, it's actually going to allow us to cryptographically erase 103 00:08:17,360 --> 00:08:22,600 information that's been stolen. All right. Finally, we wanted to design a service that's not 104 00:08:22,600 --> 00:08:26,780 just for Facebook or people who have these huge security teams and they can run their own 105 00:08:26,780 --> 00:08:31,600 service. We want to build a modern multi-tenant web service that allows even small companies to 106 00:08:31,600 --> 00:08:38,180 take advantage of the system. All right. So let's see how it works. I'm going to talk through how 107 00:08:38,180 --> 00:08:44,380 a pipia query works when a new user logs onto a website and that website's using pipia. So user 108 00:08:44,380 --> 00:08:51,960 logs in the normal way. User name, password, sent via HTTP post, protected by TLS. Web server 109 00:08:51,960 --> 00:08:57,160 chooses a random value. We'll call that value T. This is going to be a user ID. It then takes that 110 00:08:57,160 --> 00:09:01,120 password and passes it through what's called a cryptographic blinding function. Think about this 111 00:09:01,120 --> 00:09:04,320 as encryption. It actually is. It's keyhole morphic encryption. We'll get into the details 112 00:09:04,320 --> 00:09:11,720 later. But just know that this protects the password. Web server sends a query. The query has 113 00:09:11,720 --> 00:09:16,620 these components. It has the web server's ID. It has the user's ID. It has a blinded password and 114 00:09:16,620 --> 00:09:21,940 an encrypted password. A pipia server puts the key in the password. It has the key in the password. 115 00:09:21,960 --> 00:09:25,020 It has the key out of a database. That key is associated with only this web server. It then 116 00:09:25,020 --> 00:09:30,640 applies cryptographic PRF, a keyed PRF with that key and uses those inputs, the user ID and the 117 00:09:30,640 --> 00:09:36,320 blinded password. We'll call that result Y. That result gets sent back to the web server. The 118 00:09:36,320 --> 00:09:40,820 web server then applies the unblinding function. It then stores those. We call the unblinded 119 00:09:40,820 --> 00:09:44,480 value, the final value, the protected password. Think about this as the same output from the 120 00:09:44,480 --> 00:09:48,340 Facebook algorithm when you've applied S-crypt and a bunch of other deprecated hash functions. 121 00:09:48,880 --> 00:09:51,940 And of course when the user logs in, web server does the same thing again. It uses the same 122 00:09:51,960 --> 00:09:56,160 command, produces a new value Z prime. If the new value matches the data in the database, the 123 00:09:56,160 --> 00:10:01,100 password is the same. If it doesn't match, it's the wrong password. All right. Let's talk about 124 00:10:01,100 --> 00:10:05,980 how compromise recovery works. So let's say an attacker breaks in, steals a copy of the 125 00:10:05,980 --> 00:10:10,180 database. Well this web server is in a better position because the attacker can't do offline 126 00:10:10,180 --> 00:10:14,600 dictionary attacks without that key. Now he does have enough information to do online accounts, 127 00:10:14,800 --> 00:10:20,980 online attacks. But notice that the API has changed. The API requires the requester to specify 128 00:10:21,960 --> 00:10:24,760 the wrong user ID. If you specify the wrong user ID, you get the wrong result and your guesses 129 00:10:24,760 --> 00:10:29,180 aren't going to work. This means the Pythia server can now tell if you're getting 10,000 130 00:10:29,180 --> 00:10:33,460 requests for a single user account and it can do something, right? It can throttle requests, it 131 00:10:33,460 --> 00:10:37,560 can lock accounts, it can send out alerts to sysadmins and say hey, someone else has your 132 00:10:37,560 --> 00:10:43,840 password database. All right. So admin goes in, he cleans up his SQL injection and instead of the 133 00:10:43,840 --> 00:10:47,700 normal process of email all your users, tell them they're screwed, they have to go change their 134 00:10:47,700 --> 00:10:51,540 Instagram passwords even though you're not Instagram. Instead he does something different. 135 00:10:51,960 --> 00:10:55,680 He contacts the Pythia server and says hey, I need to do a key rotation. I need a new key. 136 00:10:57,240 --> 00:11:02,740 Pythia server generates a new key and sends to the web server what we call an update token. And 137 00:11:02,740 --> 00:11:09,160 this update token allows the web server to update the existing protected passwords from the old 138 00:11:09,160 --> 00:11:14,200 key to the new key. And the important thing is here, the web server doesn't have to know the 139 00:11:14,200 --> 00:11:20,420 original password. I don't wait for the user to log in. I can do this whenever I want. And also the 140 00:11:21,960 --> 00:11:27,640 key is changed. We're just changing the key that's being used to protect that password. All 141 00:11:27,640 --> 00:11:31,740 right. Web server finishes updating its database, tests to make sure it works. Contacts the Pythia 142 00:11:31,740 --> 00:11:37,040 server and tells them I'm done. Erase the old key. If that key is gone and there's no copy of 143 00:11:37,040 --> 00:11:42,600 that key anywhere else in the HSM or anywhere else in the memory, that password database is 144 00:11:42,600 --> 00:11:47,440 useless. Right? It's based on encrypted values for which there is no key. So even if you break 145 00:11:47,440 --> 00:11:50,980 into the Pythia server, if the key is gone, you don't have enough information to recover those 146 00:11:50,980 --> 00:11:51,940 passwords. We still have the key. We still have the key. We still have the key. We still have the key. 147 00:11:51,960 --> 00:11:56,520 We say that password database is cryptographically erased. You now have a big blob of useless data 148 00:11:56,900 --> 00:12:03,000 and some user names and user IDs. Okay. So there may be some cryptographers in the 149 00:12:03,000 --> 00:12:07,200 audience. Even if you're not, we're going to talk about the properties that we need to build 150 00:12:07,200 --> 00:12:13,080 this kind of a service. So we need a scheme that's going to be deterministic. We need the same 151 00:12:13,080 --> 00:12:17,480 key, same user ID, same password. It needs to produce the same result every time. That's how we 152 00:12:17,480 --> 00:12:21,900 know if we got the password correct. We need a scheme that's pseudo random and really 153 00:12:21,960 --> 00:12:24,800 by that I mean passwords should look like random numbers. They 154 00:12:24,800 --> 00:12:27,140 shouldn't leak, sorry, protected passwords should look like 155 00:12:27,140 --> 00:12:29,020 random numbers. They shouldn't leak anything about the inputs. 156 00:12:30,520 --> 00:12:33,220 We need this weird property. It's like partial message 157 00:12:33,220 --> 00:12:36,480 privacy. I want to hide the password, but I want to require 158 00:12:36,480 --> 00:12:41,000 you to specify in the clear the correct user ID. And finally we 159 00:12:41,000 --> 00:12:43,500 need key rotation, right? Hopefully it's obvious how very 160 00:12:43,500 --> 00:12:47,060 powerful that is to operators. Okay, so when we started doing 161 00:12:47,060 --> 00:12:51,160 this work in 2014, we looked around at existing schemes. 162 00:12:51,160 --> 00:12:53,520 There's things like pseudorandom functions like HMAC. There's 163 00:12:53,520 --> 00:12:56,180 oblivious pseudorandom functions. Partially blind 164 00:12:56,180 --> 00:12:58,300 signatures which give you this kind of partial message 165 00:12:58,300 --> 00:13:01,520 privacy. There's a bunch of techniques for key updateable 166 00:13:01,520 --> 00:13:05,080 encryption, proxy re-encryption. But in 2014 at 167 00:13:05,080 --> 00:13:07,380 least when we were working on this, actually 2015 when we were 168 00:13:07,380 --> 00:13:10,280 working on this, there actually was no scheme that provided all 169 00:13:10,280 --> 00:13:14,580 four of these properties simultaneously. So we, the 170 00:13:14,580 --> 00:13:16,940 authors of Pythia, we had to invent a new scheme. We called 171 00:13:16,940 --> 00:13:20,480 it Partially Oblivious PRF. It's a sexy name, right? Forgive 172 00:13:20,480 --> 00:13:21,140 me, I'm a cryptologist. We had to invent a new scheme called 173 00:13:21,160 --> 00:13:25,360 Target Firm Not a Marketer. All right, so let's go through, 174 00:13:25,460 --> 00:13:27,560 let me give you a high level intuition about how we're going 175 00:13:27,560 --> 00:13:32,500 to build such a scheme. So how do you build an oblivious PRF? 176 00:13:32,800 --> 00:13:36,620 Well the first thing we need is a secure, a secure reversible 177 00:13:36,620 --> 00:13:40,820 blinding function. So I can apply some function, some 178 00:13:40,820 --> 00:13:42,920 blinding function, usually with some random input. Think of that 179 00:13:42,920 --> 00:13:46,320 as like a key. And of course if I apply the un-blinding function, 180 00:13:46,500 --> 00:13:50,060 that should give me the original value back. Now I need a secure 181 00:13:50,060 --> 00:13:51,140 reversible blinding function. So I need a secure reversible 182 00:13:51,140 --> 00:13:54,020 function that commutes mathematically with a 183 00:13:54,020 --> 00:13:56,660 pseudo-random function. And by that I mean, if I blind the 184 00:13:56,660 --> 00:13:59,860 password and then apply the pseudo-random function, it's the 185 00:13:59,860 --> 00:14:01,860 same as if I were to do it in the opposite order. I applied the 186 00:14:01,860 --> 00:14:05,320 pseudo-random function first and then blinded it. If I have 187 00:14:05,320 --> 00:14:10,120 these three things, I can build an oblivious PRF. So I blind a 188 00:14:10,120 --> 00:14:12,740 password, the client blinds the password, sends it to the 189 00:14:12,740 --> 00:14:16,360 server, server has the key, applies the keyed pseudo-random 190 00:14:16,360 --> 00:14:20,740 function to the blinded input, sends it back to the client, the 191 00:14:20,740 --> 00:14:23,120 client applies the un-blinding function. Right? And then should 192 00:14:23,120 --> 00:14:25,740 it be clear that we can rewrite it like this, and hopefully then 193 00:14:25,740 --> 00:14:29,380 it's still clear that blinding and un-blinding cancel out. At the 194 00:14:29,380 --> 00:14:33,260 end of the protocol, the client who initiated the protocol learns 195 00:14:33,260 --> 00:14:36,040 the output of a keyed pseudo-random function over a 196 00:14:36,040 --> 00:14:38,800 password. But he doesn't learn the key. And on the server side, 197 00:14:39,000 --> 00:14:41,760 the server side can apply the key but never sees the password. 198 00:14:42,480 --> 00:14:46,940 Okay. So that's oblivious PRF. Math warning. I have one slide of 199 00:14:46,940 --> 00:14:49,460 math. So for those of you who need to check your e-mail and 200 00:14:49,460 --> 00:14:51,740 don't like math, go into it. For those of you who like math, 201 00:14:52,220 --> 00:14:56,380 sorry, that's only one slide. All right. So here's our partial 202 00:14:56,380 --> 00:14:59,340 oblivious PRF construction. There have actually been sort of a 203 00:14:59,340 --> 00:15:01,400 number of similar constructions in the academic literature 204 00:15:01,400 --> 00:15:03,640 since, but this is my talk. So screw you guys. I'm presenting 205 00:15:03,640 --> 00:15:06,720 mine. All right. So we need to use something called a bilinear 206 00:15:06,720 --> 00:15:11,520 pairing. And by that, I mean three elliptic curves, we'll 207 00:15:11,520 --> 00:15:14,720 call them G1, G2, and GT, and a function that takes inputs from 208 00:15:14,720 --> 00:15:18,440 two and maps them into the third. And this function has this 209 00:15:18,440 --> 00:15:22,580 this property. If I take A to the power X, B to the power Y, 210 00:15:22,820 --> 00:15:25,440 run them through the blinding function, it should be the same 211 00:15:25,440 --> 00:15:27,720 as if I were to send A and B through the blinding function 212 00:15:27,720 --> 00:15:31,580 and raise that to the power XY. Okay. With this we can now build 213 00:15:31,580 --> 00:15:38,140 our Pythia protocol. It works like this. The web server hashes 214 00:15:38,140 --> 00:15:41,440 a password, turns it into a group element, an elliptic curve 215 00:15:41,440 --> 00:15:44,140 element, raises the power of R, where R is just some random 216 00:15:44,140 --> 00:15:46,520 integer. This is a blinding function and this is really 217 00:15:46,520 --> 00:15:49,440 strong. It's got information theoretic security. Okay, so 218 00:15:49,440 --> 00:15:52,240 here's our blinding function. Send those values to the Pythia 219 00:15:52,240 --> 00:15:58,420 server. Pythia server then hashes the user ID, passes the 220 00:15:58,420 --> 00:16:02,040 user ID and the value X through the pairing function, raises the 221 00:16:02,040 --> 00:16:05,280 whole thing to the power of K. That's our keyed pseudo random 222 00:16:05,280 --> 00:16:11,020 function. The unblinding function is then I compute the 223 00:16:11,020 --> 00:16:13,620 inverse of R and I raise the whole thing to the power of R. 224 00:16:14,880 --> 00:16:16,500 If I write it out, it looks like this. I'm going to write 225 00:16:16,520 --> 00:16:21,140 this. And then hopefully it's clear. You can see that the 226 00:16:21,140 --> 00:16:24,260 blinding factor and the unblinding factor cancel out. 227 00:16:24,440 --> 00:16:28,140 And what I'm left with is hash of the user ID, hash of the 228 00:16:28,140 --> 00:16:31,480 password, pass the repairing function, raise to the power of a 229 00:16:31,480 --> 00:16:35,000 key K. And this thing is deterministic, right? The same 230 00:16:35,000 --> 00:16:39,040 inputs always produces the same outputs. Okay. The rest of you 231 00:16:39,040 --> 00:16:40,880 guys who don't like math and are busy checking your e-mail, you 232 00:16:40,880 --> 00:16:45,920 can wake up. All right. So that was a deep dive. Let's pop up 233 00:16:45,920 --> 00:16:46,500 to the high level and see what we can do with this. All right. 234 00:16:46,520 --> 00:16:51,620 Let's talk about what this construction gives us. On the 235 00:16:51,620 --> 00:16:55,620 Pythia side, using this construction means the service 236 00:16:55,620 --> 00:16:58,620 has enough information to detect online attacks. You have to 237 00:16:58,620 --> 00:17:01,240 specify the user ID and you have to be right about it. Can't 238 00:17:01,240 --> 00:17:03,300 play shenanigans with it. Because if you specify the wrong 239 00:17:03,300 --> 00:17:06,560 user ID, you get the wrong output every time. But 240 00:17:06,560 --> 00:17:08,720 importantly, he can apply the pseudo random function, never 241 00:17:08,720 --> 00:17:12,380 learns anything about the password. On the web server side, 242 00:17:12,660 --> 00:17:15,940 he can compute through this protocol this keyed pseudo random 243 00:17:15,940 --> 00:17:19,140 function, but he never sees the key, right? This is key because 244 00:17:19,140 --> 00:17:21,880 if you break into the web server, you scrape memory, you steal a 245 00:17:21,880 --> 00:17:24,140 disk, you know everything the web server knows. And if the web 246 00:17:24,140 --> 00:17:27,440 server has the key anywhere, then the attacker probably has 247 00:17:27,440 --> 00:17:32,440 the key, too. All right. So our goal was to, as an academic, my 248 00:17:32,440 --> 00:17:34,940 goal was to publish this paper. But now our goal is to kind of 249 00:17:34,940 --> 00:17:38,260 get this into the world and get people to use it. And so a 250 00:17:38,720 --> 00:17:41,300 company called Virgil Security has built sort of a production 251 00:17:41,300 --> 00:17:44,520 grade, not sort of, they built a production grade version of 252 00:17:44,520 --> 00:17:45,920 Pythia that's way better than my research. It's called the 253 00:17:45,920 --> 00:17:48,380 search prototype. You can find out more about it at this 254 00:17:48,380 --> 00:17:51,060 website, pithia.virgilsecurity.com. They have a full 255 00:17:51,060 --> 00:17:53,060 open source implementation. You can get this stuff from GitHub. 256 00:17:53,340 --> 00:17:55,740 The code is very good. And I'm going to give you a demo of 257 00:17:55,740 --> 00:17:58,300 this. If anyone is brave enough and has Golang on your computer, 258 00:17:58,460 --> 00:18:01,700 you can follow along in this demo. And I promise that there's 259 00:18:01,700 --> 00:18:04,100 no shady stuff in this code. I've never looked at the code, 260 00:18:04,160 --> 00:18:15,900 but I promise that there's no shady stuff in it. So I'm going 261 00:18:32,100 --> 00:18:35,420 to give you a demo. Okay. What I'm doing is downloading, via 262 00:18:35,420 --> 00:18:38,940 Golang, I'm downloading the package for this sort of demo 263 00:18:38,940 --> 00:18:40,980 version of the Pythia client. But it hits a real live Pythia 264 00:18:40,980 --> 00:18:45,620 server and it's running the Pythia protocol. And now I'm going 265 00:18:45,920 --> 00:18:55,180 to open up a client ID. So all I'm doing here is choosing a 266 00:18:55,180 --> 00:18:58,040 random ID. And this is going to be my web server ID. This is my 267 00:18:58,040 --> 00:19:15,860 random web server ID. So there it is. Very exciting. So here 268 00:19:15,920 --> 00:19:19,580 is the tool. It's designed to be very simple, obviously. You can 269 00:19:19,580 --> 00:19:21,980 get help. You can protect a password. And you can check a 270 00:19:21,980 --> 00:19:30,480 password. This is really all we need to do. So let's protect a 271 00:19:30,480 --> 00:19:38,580 password. Okay. So I'm going to go to the web server. And I'm 272 00:19:38,580 --> 00:19:45,160 going to go to the web server. And I'm going to go to the web 273 00:19:45,160 --> 00:19:45,900 server. And I'm going to go to the web server. And I'm going to 274 00:19:45,920 --> 00:19:49,360 go to the web server. Okay. So what I've done is said I want to 275 00:19:49,360 --> 00:19:52,500 protect a password. Here's the user name. Of course my voice is 276 00:19:52,500 --> 00:19:54,960 my password. And then it's hard to see but I redirected the 277 00:19:54,960 --> 00:19:58,360 output to a file. And what the client is doing is exposing the 278 00:19:58,360 --> 00:20:00,720 standard error, a little bit of demo information so we kind of 279 00:20:00,720 --> 00:20:03,180 get some idea of what's happening. So the first value is 280 00:20:03,180 --> 00:20:05,540 that blinded password that we talked about. This is the 281 00:20:05,540 --> 00:20:07,540 response we get back from the server. At least the first part 282 00:20:07,540 --> 00:20:10,020 of it. The response we get back from the server. And finally is 283 00:20:10,020 --> 00:20:15,900 the de-blinded value, the protected password. Okay. So I'm 284 00:20:15,900 --> 00:20:28,340 going to go back to the web server. Here's my protected 285 00:20:28,340 --> 00:20:33,200 passwar. It's not obvious but this first part here should match. 286 00:20:34,480 --> 00:20:37,160 That's why we used the wrong file here. The first part is a 287 00:20:37,160 --> 00:20:40,060 password and the rest is a zero knowledge proof and some other 288 00:20:40,060 --> 00:20:43,920 fancy information which I totally skipped over because we 289 00:20:43,920 --> 00:20:45,880 don't really have time to cover this stuff. But essentially this 290 00:20:45,900 --> 00:20:59,640 this is the protected password. Now I'm going to check the 291 00:20:59,640 --> 00:21:14,100 password. Big surprise, password matches. So now let's insert an 292 00:21:14,100 --> 00:21:27,900 error. Let's say your voice is my password. Okay, password does 293 00:21:27,900 --> 00:21:30,280 match, right? Big surprise. So let's do this a bunch of times. 294 00:21:30,980 --> 00:21:34,680 If the Pythia server has some policy on it, we should only get 295 00:21:34,680 --> 00:21:37,460 a certain number of these queries before we get some kind 296 00:21:37,460 --> 00:21:41,840 of response. Okay, so there we go. So the Pythia server is 297 00:21:41,840 --> 00:21:44,080 monitoring these inbound user IDs. So the Pythia server is 298 00:21:44,100 --> 00:21:46,560 monitoring these. And after you get, say, 10 or so checks, they 299 00:21:46,560 --> 00:21:48,820 put a throttle on and say, okay, great, you have to wait 60 300 00:21:48,820 --> 00:21:51,740 seconds or so, right? This is a very sort of simple policy that 301 00:21:51,740 --> 00:21:54,020 allows us to quickly slow down any kind of online attacks. 302 00:21:54,760 --> 00:21:59,400 Right, so that's the totality of the demo. Let's go back and 303 00:21:59,400 --> 00:22:05,360 talk a little bit more. Okay, so that's how it works. There's 304 00:22:05,360 --> 00:22:10,360 some deep theory going on in there. There's a very cool, very 305 00:22:10,360 --> 00:22:13,540 simple interface to use it. But let's talk about performance, 306 00:22:13,780 --> 00:22:14,080 right? So let's talk about performance. So let's talk about 307 00:22:14,100 --> 00:22:18,380 performance, right? So if both the Pythia server and the web 308 00:22:18,380 --> 00:22:21,120 server are on the same local area network, and that's important 309 00:22:21,120 --> 00:22:23,640 because then network latency sort of doesn't factor into 310 00:22:23,640 --> 00:22:26,920 these numbers, then one can execute a Pythia query in about 311 00:22:26,920 --> 00:22:29,840 five milliseconds, right? So you're probably thinking, what 312 00:22:29,840 --> 00:22:32,760 does that mean, right? So let me give you some context. If you're 313 00:22:32,760 --> 00:22:35,940 following the latest guidelines from NIST, which is to use, say, 314 00:22:35,980 --> 00:22:41,100 SHA-256 hash, not say, it is to use SHA-256 hashing with at 315 00:22:41,100 --> 00:22:44,080 least 10,000 iterations on the same hardware, then you're 316 00:22:44,080 --> 00:22:46,760 probably thinking, well, that takes nine milliseconds. If you're 317 00:22:46,760 --> 00:22:49,700 using an even fancier function, bcrypt is one, scrypt is another. 318 00:22:49,960 --> 00:22:53,160 Let me give you an example. Bcrypt set with a work factor of 11, 319 00:22:53,280 --> 00:22:56,680 which is kind of a popular setting for obvious reasons, takes 320 00:22:56,680 --> 00:23:00,820 about seven milliseconds, right? So Pythia today is already 321 00:23:00,820 --> 00:23:04,000 faster than the current versions, and you get things like 322 00:23:04,000 --> 00:23:08,340 protection from online attacks and key rotation. And I want to 323 00:23:08,340 --> 00:23:12,000 point out that as computers get faster, we actually make bcrypt 324 00:23:12,000 --> 00:23:14,060 slower, right? Because as GPUs, we actually have a lot more 325 00:23:14,060 --> 00:23:16,440 CPUs get faster, we're processing things on CPUs, so we 326 00:23:16,440 --> 00:23:19,540 keep turning up the work factor. So seven milliseconds is kind of 327 00:23:19,540 --> 00:23:22,320 like the least amount of processing time. But as CPUs get 328 00:23:22,320 --> 00:23:25,760 faster, Pythia just gets faster, right? So we're already 329 00:23:25,760 --> 00:23:28,060 ahead of these password protection mechanisms, and 330 00:23:28,060 --> 00:23:31,480 Pythia is going to continue to outpace them. Some of the notes 331 00:23:31,480 --> 00:23:35,020 about performance, on the eight core machine that we tested in 332 00:23:35,020 --> 00:23:38,060 EC2, a Pythia server, single Pythia server, handled about 333 00:23:38,060 --> 00:23:41,260 1,300 queries per second. A few more queries per second, you 334 00:23:41,260 --> 00:23:43,720 throw more iron at the problem, right? You put a load balancer 335 00:23:43,720 --> 00:23:47,140 in a couple more servers. Storage is excellent for a Pythia 336 00:23:47,140 --> 00:23:50,020 server, right? Pythia server doesn't store information about 337 00:23:50,020 --> 00:23:52,960 users, it stores information about web servers, right? So 338 00:23:52,960 --> 00:23:56,600 let me give you an example. If a Pythia server is serving 100 339 00:23:56,600 --> 00:24:00,080 million web servers, each of those web servers with an 340 00:24:00,080 --> 00:24:02,960 arbitrary number of clients, say 100 million clients, Pythia 341 00:24:02,960 --> 00:24:05,460 server needs about 20 gigabytes, right? That's enough 342 00:24:05,460 --> 00:24:08,740 information to store keys for individual web servers, and a 343 00:24:08,740 --> 00:24:10,560 little bit of extra information for rate limiting. That 344 00:24:10,560 --> 00:24:13,700 information is ephemeral. All right, let's talk about the 345 00:24:13,720 --> 00:24:15,700 Pythia server. All of this is to say, we can deploy Pythia 346 00:24:15,700 --> 00:24:20,420 today on standard hardware. All right, so most of this talk has 347 00:24:20,420 --> 00:24:22,740 been about web servers, that's kind of a very compelling use 348 00:24:22,740 --> 00:24:25,560 for Pythia, but really, Pythia is really good whenever you 349 00:24:25,560 --> 00:24:28,460 have a password and a network connection, and also like 350 00:24:28,460 --> 00:24:31,200 security. So let me give you two more examples just at a high 351 00:24:31,200 --> 00:24:36,040 level. First is file encryption, right? Commonly today, 352 00:24:36,200 --> 00:24:38,480 you log into a MacBook or a Windows machine, you type in a 353 00:24:38,480 --> 00:24:41,120 password, it grinds away on your password, uses that for a 354 00:24:41,120 --> 00:24:43,700 key. That's good, unless you lose your password, but you're 355 00:24:43,720 --> 00:24:46,260 worried that someone's going to crack it. Now, if it only has 356 00:24:46,260 --> 00:24:48,600 like, say, your Instagram photos on there, it's not a big deal, 357 00:24:48,680 --> 00:24:51,820 but it's got like client data, health information, financial 358 00:24:51,820 --> 00:24:54,880 records, that might not be good enough, right? So instead, you 359 00:24:54,880 --> 00:24:58,660 could use a password, connect to Pythia, use it to generate a 360 00:24:58,660 --> 00:25:02,460 hardened password, and then use that for an encryption key. And 361 00:25:02,460 --> 00:25:08,020 then, if you lose your device, or say the FBI takes it, if you 362 00:25:08,020 --> 00:25:11,320 can get to the Pythia server and say, hey, I lost my device, 363 00:25:11,400 --> 00:25:13,700 will you please delete that key? That means you can actually 364 00:25:14,340 --> 00:25:16,940 cryptographically erase that device, even if that device is 365 00:25:16,940 --> 00:25:20,700 offline or powered off, right? Because it needs a key, and that 366 00:25:20,700 --> 00:25:25,520 key is not on that device. So the last sort of compelling use is 367 00:25:25,520 --> 00:25:28,360 something called a bitcoin brain wallet, right? So bitcoins are 368 00:25:28,360 --> 00:25:30,760 very valuable, sorry, bitcoin wallets tend to be very 369 00:25:30,760 --> 00:25:34,100 valuable, because of the sort of skyrocketing price of these 370 00:25:34,100 --> 00:25:36,100 things. And there's a question of like, so how do you protect 371 00:25:36,100 --> 00:25:39,460 this digital asset, right? So you can imagine I could take, 372 00:25:40,000 --> 00:25:42,820 generate a very complex password, run it through sCrypt, 373 00:25:42,920 --> 00:25:43,700 make it grind away on my password, and then I could do 374 00:25:43,720 --> 00:25:46,000 that for a long time, and just hope that somebody else out 375 00:25:46,000 --> 00:25:49,240 there doesn't grind away harder and find my password. Because oh, 376 00:25:49,300 --> 00:25:51,680 the public key is sort of sitting somewhere, not sitting 377 00:25:51,680 --> 00:25:54,800 somewhere, it's sitting up on the blockchain. You can imagine 378 00:25:54,800 --> 00:25:58,080 using Pythia for this, right? You type in a password, possibly 379 00:25:58,080 --> 00:26:01,480 combine it with a local secret, connect to Pythia, use it to 380 00:26:01,480 --> 00:26:04,300 apply in another key, get it back, and use that to either 381 00:26:04,300 --> 00:26:07,460 protect your brain coin wallet, or use it directly as your 382 00:26:07,460 --> 00:26:12,800 bitcoin wallet. Okay. So let's wrap this up. Password storage 383 00:26:12,800 --> 00:26:13,340 is broken. 384 00:26:13,720 --> 00:26:16,940 Because databases are routinely compromised, and when they are, 385 00:26:17,520 --> 00:26:20,100 using current techniques, there's no way to prevent offline 386 00:26:20,100 --> 00:26:23,700 dictionary attacks. But what I presented today is a new 387 00:26:23,700 --> 00:26:26,860 solution, an architecture for protecting passwords, built 388 00:26:26,860 --> 00:26:30,120 around the Pythia PRF. And Pythia's design is a modern web 389 00:26:30,120 --> 00:26:33,520 service. It lets clients of this service inherit the security 390 00:26:33,520 --> 00:26:36,840 of the service provider without just handing over sensitive 391 00:26:37,500 --> 00:26:40,460 information to that service provider, and just hoping for the 392 00:26:40,460 --> 00:26:43,240 best. And with that, thank you. 393 00:26:43,720 --> 00:26:45,020 And I'd love to hear any questions.