Hi I'm Todd Austin and this is the Sixth and final episode of my six part video tutorial on Hardware security in this final episode we'll be examining emerging security protections this is emerging research and industry technologies that work to address um in many cases a broader set of threats as well as traditional threats in a more Durable manner this is the final episode of my six part video tutorial sequence that in the first part we set the stage on why Hardware security is important and the second part we looked at the basics of security cryptography
hashing signatures the third part we looked at software hacking of software and Hardware vulnerabilities in the fourth part We examined side Channel attacks in the fifth part We looked at existing security defenses from hardware and software perspective those that are already out in the field and then this final six part we're going to look at some emerging defenses so let's get started first thing I want to take a look at are puffs physically uncloneable functions they still have a really unique and interesting problem in the world of security which is how do we authenticate devices
how do we know That we're interacting with a specific device be it a key card or a credit card or whether electronics are genuine or whether they've been produced in a way that you know overproduced we can look at these signatures that puff creates and it's essentially a unique identifier for every piece of silicon that is manufactured the way Puffs work is they translate the process variation in the underlying Silicon Electronics into a probable function that's very difficult to learn and recreate in software uh and so what is process variation process variation occurs when you
have a um silicon chip that's been manufactured uh in today's silicon the dimensions of transistors are very small you know you can we have transistors that are literally tens of atoms in width and so small variations in the width of an atom Excuse me width of a transistor you know if it's you know 15 versus 16 versus 14 atoms in width that creates some speed and power variation in those devices and designers when they design circuits you know they basically have tools and methodologies to try and hide all these variations from the overall system but
if we build a circuit that leans into those variations we can use those variations to identify a specific chip so this is a arbiter based puff and what You can see here is we're going to give a challenge it's an end bit challenge typically large you know like you know 64 or 128 bits and what the challenge bits are going to do is they're going to determine if these muxes here uh pass straight through or if they swap the value as they go through um excuse me they're going to determine if the if the Top
Value goes through or the bottom value goes through and then With that they'll determine as a pair whether the value goes through straight or swaps and so we can see as an example if I give 1 0 1 we'll get a swap on the first set we'll get no swap on the second set and then no swap on the third set and so what that'll do is that'll create a single path uh through there for the blue line and another path for the Gray Line now Depending on how they swap the one on the top
that comes out on the top is going to be the input to a latch the cuvette the the D value and the bottom one is going to be the clock to the latch and so um now of course if I have n Bits of uh n Bits of challenge I then have two to n different paths that I can take through this device and each of those paths will Have its own unique uh process variation and so that which one of those bits arrives first at the output will be determined by that that unique process
variation if the D arrives before the G then I get a one output if the D arrives after the G then I get a zero input so it's a really cool uh approach to measure uh process variation and so what I do is I if I want to identify chip I give it my challenges my n bit challenges and then I record for that particular chip what are the outputs zero zero one one zero zero one for these challenged and then uh and then if I come back and do those challenges again I can see
am I still on the same chip that I was previously I met basically you know measuring and then the chat the reason why it's essentially uncloneable is because you know with an end bit challenge I have to do 2 to the N probe so if it's 128 Uh length challenge sequence then I'd have to do two to the 128 different probes I I can't do that many probes uh but interestingly enough there's some pretty interesting attacks on these Puffs in terms of machine learning where machine learning can kind of figure out you know there's only
128 stages there so machine learning can basically figure out what the process variation on each of those 128 stages is and then can start answering questions to challenges That's never seen before so these these you know it sounds like there's a huge amount of entropy here but you know there may not always be a lot of entropy so there's a lot of research on how to sort of really ramp up that entropy there's also some concerns with aging as well as transistors age that gets slower and does that change the results of these probes so
there's there's various concerns here but what's really interesting about this technology Is it can give you um essentially a secret on a chip that nobody knows you know so for let's say for example you have a trusted platform module on a chip and you want that module to have its own private and public asymmetric key pair you could use a puff for example to create the secret key then run an algorithm generate the public key export that to some certifying Authority and now you have a secret key in your TPM that nobody knows Only the
TPM Hardware has access to that so these are really exciting Technologies to uh to put into silicon okay another really interesting silicon technology is logic locking the goal with the logic locking is to basically prevent an IC from having unauthorized bring up or enablement and theft so when you manufacture chips if your chips are not logic locked then The Fab could potentially make extra chips without your knowledge and sell them on the black market so what logic locking does is it makes it it basically locks down the chip so if you if you don't have
the key to the chip then you can't turn it on and and this technology actually works great with the previous slides technology Puffs so we could know what is you know we can associate each of those puff values with being a a chip That I intended to manufacture if I see that's a chip that I intended to manufacture then I will export into that using secret Keys based on that Puff the unlock key for this chip once you unlock the logic locking then the chip can operate as as it was intended the other thing that
logic locking helps with is what's called reverse engineering there's companies out there which literally take a new chip and they Just start you know lasering away layers of the silicon and studying how the circuits are built because they want a reverse engine at a chip and this can help with that as well and the reason why this helps with stopping over production and reverse engineering is because you you essentially haven't finished the design until you've loaded the key into the logic locks so the basic approach is we're going to do what they call encryption it's
not really Encryption it's just we're going to just drop some xores into uh what onto wires where there would potentially be an inverter and then all on other wires where there were was not an inverter and then essentially what the what the key tells us is where there are inverters and where they're not inverters if you know if a zero goes in to the key bit there that's just the pass-through of that line Um and if a one goes into that then it acts as an inverter that xor Gates so essentially you're with the key
bits you're telling where do all these missing inverters go in my design once I if I install those missing inverters wrong guess the wrong key then the design doesn't work if I install the uh inverters correctly correct key then the design all of a sudden starts to work so it's a it's a really cool technology again You know it seems like with n and key bits there's two to the end different combinations but you know people can look at circuits and go oh yeah that's an Adder that's an inverter that's not inverter you know there's
lots of ways to reverse engineer these and people also again demonstrated uh satisfiability uh tools as well as machine learning tools can really punch into this uh these Technologies and figure out what Those key values should be by basically trying to understand the circuits uh but overall really interesting technology that really allows a vendor to prevent anyone from turning on their chips until they can tell that they were you know legally manufactured in the previous lecture we talked about how with tools like point guard encrypting pointers makes it difficult to uh to forge pointers and
when you can't forge pointers you can't bring Pointers from the outside world into your security attack and that throws a wrench into a lot of different security attacks arm which is a processor manufacturing company out of the UK has a technology called arm pack which is a pointer authentication code technology and they don't encrypt the pointers instead what they do is they produce a hash of the pointer value then they encrypt that hash That creates What's called the pack and that gets tucked into the upper part of the address this is for a 64-bit machine
where it doesn't actually have a 64-bit Azure space typically the upper 16 bits of a 64-bit machiner unused because you know nobody needs a more than a 48-bit address space well maybe not but that's a very large address space so in a lot of machines the upper 16 bits of the virtual address space and I use so what Pac does is it just tucks a a an Encrypted hash up into that upper upper bits and so with an encrypted hash um we can whenever we generate a new pointer pointer arithmetic or when we take the
address of something the hardware has this internal key it generates the hash it encrypts the hash and attaches that to the pointer and then those pointers just flow out into the system and when you use the pointer it takes the address hashes it Encrypts it with the key and then checks to see is the pack that's associated with this key the pack that I just you know produced with my knowledge of the internal key the key is internal to the hardware it's not even an unlike point guard the key is not even anywhere in memory
it's in an internal register it's generated when the system boots uh so it's a very powerful way to um you know to prevent people from 4G Pointers if I bring a pointer from the outside world I need to guess what that pack value is now it's only 16 bits so you know I have a one and you know 32 000 ish chance of guessing that right pack value but you know in in the process of attempting to do that I want to probably dump a lot of core uh get a lot of security violations when
those packs fail authentication and someone's quickly going to find out I'm I'm you know I'm I'm stopping this and these were recently rolled out even in the iPhone platform and it became available in arm in their version 8.3 architecture system later so really interesting technology I think a very good one again I you know I'm a huge fan of any technology that can um you know make it hard to forge pointers because so many attacks require the forging and pointer so a big plus for this one now interestingly this Attack was broke this this technology
after it was rolled out commercially was broken just uh within I think weeks of that initial rollout and uh you know invite you to go take a look at this attack but um who's a professor at MIT she did this really really clever attack called Pac-Man which the way it works is if you remember Specter and meltdown from our Uh from two lectures ago the side Channel lecture it's basically a way where you run speculatively and if you get faults or exceptions you know all that code gets in their way and so what with how
the way the Pac-Man attack works is you uh you basically ins you inject from the outside world um pointers that have guessed uh authentication codes But you don't dereference those pointers on the correct speculation path you dereference them on the Miss speculation path and so what happens is if the pack fails the load that you try to speculate on doesn't occur so there's no load and so what you can do is you can load your data into the cache you can speculatively check to see if the pack is is correct and it gets thrown away
because it's not a Miss speculation path and so you can see if the if the number You guessed for the pack was correct you'll see that the load occurred and displaced your data and at the value for the pack was incorrect you'll see the load did not occur because it was a security violation on Miss speculation but just gets thrown away no one knows about it silent what a clever attack I'm not even sure they can stop this you know I'm really interesting to see really interested to see how Um how's this how this gets
stopped right now you know the stance is kind of like um this is really hard to do but I don't know you know how security attacks always gets easier and better all the time this is a incredibly clever use of speculation to basically March through that 16-bit entropy space for the packs and and very quickly find a valid pointer that you can use all right and uh oh and by the way once you find a valid Pointer then you know you can very quickly reverse engineer what the key was all right now let's uh take
a look at another technology called Cherry this is a really interesting approach to stopping memory access errors for languages that typically have a high susceptibility to memory access errors we talked in the previous lecture about the use of safe languages and how safe languages can really help Stop a lot of the issues associated with memory access errors going off the end of an array or accessing storage after that storage has been freed well if you don't have access to a safe language you know which is very typical like in an embedded framework um then you
know you've got to live with those memory access errors and the vulnerabilities that are associated with So what Cherry does is it adds what I call Fat pointers to the architecture and fat pointers or pointers that are bigger than 64 bits they include other things like you know um you know where you're pointing to this is the original pointer what is the length of the allocation and what is Base address so it actually describes the entire array structure you're pointing into and the pointer Into it and then also permissions uh you know is it still
allocated you know do I read write access to it et cetera and then it takes a 64-bit pointer and it bloats it into 256 Bits And they also have 128-bit version it's a little more lean than this and so then if you go outside of the Bonsai array and they even have techniques to find out when you've deallocated something with these permissions and and such then uh then you get an exception so it's really A cool way to find those vulnerabilities this is really a detection and prevention technique for memory access errors some of the
challenges here is it kind of breaks legacy codes because you've got to describe the bounds of your storage which you normally don't have to do in C and C plus plus you know if you're if you're you know writing some crazy program you may not know the bounds of something You know also you know there's interesting uh things people do like xoring pointers together and and indexing into the negative uh indices you know as a way to you know normalize access it's just lots of crazy stuff that happens in CSC plus plus and that can
that can break some codes uh so that's an issue for this but you know if you're writing new code probably pretty easy to to adopt this technology and uh And then um you know Microsoft did a study a few years ago about you know how how many of their vulnerabilities that they're fixing in their products were really based on memory access errors and it was about one-third of their vulnerabilities so you know preposition and side Channel attacks and other things that are not related to memory access errors directly may not be affected by solving this
one problem but this you know everyone I think in the Security Community would agree that if you can stop memory access errors that's a really good thing for security so this is a really exciting technology and doubly exciting because arm the company we talked about on the previous slide uh is creating a process called Morello which integrates this technology right into the micro architecture so very exciting upcoming opportunity to see that architecture running with these Technologies um in the side Channel attacks uh lecture we talked a lot about inferring what's happening in the cache between
two processes with the prime plus probe attack and a variety of other attacks this is a wide range of attacks so I want to like understand what's this other process doing I'm going to displace my data in my cache and then I'm going to see if the if the victim process when I ask it to do something For me is is displacing my data the way it displaces my data or whether or not it displaces my data can tell me something about how that other process is running and so we also saw in the last
lecture aslr which is a way to randomize where stuff is in the address space but still in that case uh relative address attacks if I can learn one address I can still figure out where the location of other stuff you know so it's That's a bit of a weak approach to not knowing where stuff is in the other process because if I can learn one piece of information I can pretty much lock down everything else so with randomized cash is what's going to happen is I'm going to decorate the location of data in the cache
from the virtual address assigned to that storage and by doing that it is based on a key that goes into the cache whether or not Two pieces of storage in the virtual address space conflict now when I try to build what's called an eviction set what's an eviction set that's where I'm I'm displacing everything in one set of the cache so a set if there's a four-way cache that's these four blocks when I'm evicting everything in that one set of the cache and then asking the other victim process to do something and to see if
my Eviction set got affected the challenge with a randomized cache is I mean I I can't build an eviction set because that's a cryptographically hard function this is scatter cash which what it does is it puts between the index and the tag an encrypter so that the set index that goes into the cache is actually a cryptographic secret And it's as advertised it's very hard to build a specific eviction set so these are really interesting Technologies I think the challenge here in terms of security is you know when I encrypt a piece of data that's
128 bits with 128-bit key figuring out what that final value is is uh it's hard right because there's just there's the the mapping between the plaintext and the Cyber text is this full bijection of 100 to the 128 Different symbols and that's hard to figure out what that mapping is but here I'm mapping you know in a typical L1 cache I'm mapping an 8-bit value to an 8-bit value right now it's 256 lines in your cash there's not a trillion lines in your cash right it's just cashes are physical things and so the entropy in
the set index is fairly small and so you've seen reverse engineering based on that observation where and kind of give you a sense what they Do is they take advantage of What's called the birthday conundrum like oh it's really hard to build a set in a specific location but if I only have to build a set somewhere that's fairly easy and so you know it's a little more difficult to implement tax over that but you can still do them in things like the scatter CashNet there's also a notion of stochastic attacks and I had a
paper on this with one of my students terub Erma in 2022 so you can go look at at that Paper go to my Google Scholar and Hunt that paper down so we did what's called stochastic primer probe where basically we did stochastic Prime we just puked random addresses into the cache and then you know it's it's like a coupon collector's problem where there's a certain probability for n of these lines that we touch that will create a fully primed set and we know what that probability is and then we ask the other Uh process to
do something for us and there's a certain probability that it'll displace one of those things in that set and so the problem the product of those two probabilities essentially is like the channel noise and then we use coding techniques and differential uh signaling techniques to really sort of deal with the noise of that uh scatter cache or various other randomizing cache channels and we communicated through scatter cash Caesar many other uh new cash many other Kinds of randomizing caches so um given the limited entropy here I I don't see these as particularly durable uh defenses
but uh definitely throw a big wrench in your ability to figure out where stuff is and the side in the uh software-based attacks third lecture we also we talked about row Hammer which is this attack where we repeatedly hit memory in the same location and uh and when you do that uh you can Flip bits in the uh adjacent lines to that aggressor row it has to do with charge coupling between the word lines of those dram rows which are very tightly packed and in this particular work this is my work as well uh we
have this uh technology called Anvil and basically what Anvil does is it just looks at the L2 cache misses which it can sample using the performance counters on an Intel x86 architecture and it just samples those on occasion to See if there's a high level of repeatability it wants to see what's the entropy in that L1 Miss stream and if the entropy in the L1 Miss stream drops between below a certain level we start refreshing those lines this is because if you're doing a row Hammer attack the misses out of the L1 Kent the excuse
me the last level cache the L2 or L3 cache that go to dram there's not going to be much entropy there they're going to be repeatedly Hitting the same row uh so what's nice about this protection for row Hammer is it's not in the dram uh it's just in the processor and it's just trying to identify uh processes that are having too much locality to the dram then does select refresh which is just a load of a value in the line that you want to selectively refresh and uh no Hardware at all it's just using
the existing performance counters to do this Really uh really cool optimization I think the challenge though is that the number of activations which when we did this work was about 400 200 to 400 000 activations that's been dropping precipitously as people get more clever about how to do activations and also as drams get you know increasingly dense as they always do today it's about 5 000 activations to get a row Hammer so you know that may that just may get underneath the entropy Detectors of a technology like this so again you know I'm I'm still
scratching my head trying to figure out how to stop row Hammer great research area if you're a PhD student watching this and you're looking for you know way an industry problem to work on I I see this as a really great problem all right now I want to present a little bit more of my work This is a project that I did with DARPA which is uh the Department of Defense research agency and uh this is my students um Mark Gallagher Lauren Bernanke and Alex Kissel who Alex is now with me at ajita Labs which
I'll show you some of that work there's just follow-on work that we commercialized out of Marcus and Morpheus is like the point guard work that I presented in the previous lecture which is it increased pointers The way it does that though is it encrypts pointers with you know it's two advances over that work it's on Hardware there's no key in software to steal and so it's like pack arm pack and that in that regard and then it uses a strong Cipher uses a cipher called Simon doesn't use the full rounds assignment but it uses a
lot of rounds so it's actually significantly harder to crack than very very weak xor encryption and then this does This Thing Called Churn which uh really uh tries to stop side channeling of those values by changing the underlying pointer values how they're encrypted by re-keying that every once in a while so the students when this paper got an S Plus made a really cool video about this so I'm going to play that right now in a world where sulfur vulnerabilities are rampant and unsafe languages like C are exceedingly common Attackers are getting more power by
the second size and exploit attackers need access to an asset such as pointer values defenses randomize these values to make it harder for attackers however hackers have found help around these measures [Music] but there's hope because there's more fear to stop attackers from de-randomizing assets Morpheus changes it from under them in a process called churn Morpheus is a secure architecture targeted at stopping Advanced control flow attacks such as ROP we leverage Hardware in Risk 5 to provide two layers of defenses displacing memory into a superimposed address space and encrypting code and pointers these defenses combined
with churn significantly hinder exploits with Hardware support Morpheus can turn sensitive assets every 50 milliseconds with less than one percent slowdowns with information changing so quickly attackers are left with the system that is extremely difficult to penetrate and must resort to Advanced probing because of churn this challenge becomes a race against a short clock a race that is nearly impossible to win [Music] awesome okay so that was fun so it was Great to see your students do something you could never do which is that that's so much fun find out more about all right let
me go on to the next slide here okay so um Morpheus was a simulated design then Morpheus 2 uh which Austin Harrison Teru Verma worked in was a deployment of this technology into the cloud on F1 fpgas in Amazon Cloud and so this was a full implementation it Was designed to run operating systems and applications with the the Morpheus uh point of protections engaged and uh and then it was red teamed by a commercial red team uh really really interesting uh aspect to our DARPA program all right so uh just to describe how morphe 2
works as you know as stated in the previous video it encrypts uh code and pointers so all the code everywhere Is encrypted and it's not decrypted until it hits the second stage of the pipeline and then encryption is with a symmetric key based on a uh encryption Cipher called Simon and that key is just selected when the system powers on so nobody knows that key it's not accessible by software and there's a protocol when you bring software into the system sort of re-encrypt it under that key So it's what's interesting about this unlike you know
Intel sgx and AMD SUV where they decrypt things when they go into the caches for fear of of you know those High decryption latencies we just kept it in decrypt encrypted everywhere so it was always protected until it hit the pipeline then we basically ran Simon as far as many rounds as we could in a single cycle in this pipeline uh then you go through decode and then you execute the instructions so the only Place the instruction is visible is in this part of the pipeline nowhere else uh and then we also encrypted code pointers
as well because we were the goal of this machine was to stop code injection so code pointers are return addresses as well as indirect function pointers virtual table entries for C plus plus Etc it's any kind of pointer used to get to a piece of code you jump through it and so indirect jumps would get encrypted pointers and so there was A stage between an indirect jump engaging and the fetch restarting where we actually decrypted those indirect jumps so everywhere in the registers everywhere in the data cache everywhere in a swap Etc those pointers were
encrypted so that was pretty exciting and then you can see that those two defenses just encrypted code encrypted code pointers now we didn't even deal with data pointers in this particular machine because we're Just trying to stop code ejection that was that was our primary threat in the red teaming that we were addressing by having him always encrypted you really get a lot of resistance to a lot of different uh code injection techniques like you you make buffer overflows really hard because what is the pointer that I'm going to overwrite the return address with this
pointer is encrypted I don't know the key so I gotta leak out a pointer but if I leak Out the wrong pointer I don't know how to do relative addressing with a strong and encrypted value I mean there's no correlation between those values so really a fantastic level of durability for stopping any kind of pointer forgery with this system and I was like working with dart because when you work with dart but you got to build stuff you got to validate stuff you got to put it to the test and so in the DARPA program
I was in which called The Sith program there was a a final effort called The fet Challenge where all of these designs which were deployed on fpgas in the cloud here you can see our local test board that's how xilinx Ultra scale Plus fpga uh they were they were deploying our Technologies into the cloud and then just making them available to um to attackers on the open web to attack and then they would attack these targets for bounties they if they could Penetrate these targets they would get uh bounties and so for us it was
remote code injection was what people are trying to do and then one of the things the the goal of the Sith program was to actually stop and basically protect systems against known software vulnerabilities with Hardware defenses so we actually had to have known rce exposure in our and this was in our SQL light uh code base there were known code injection problems in the version that We deployed so the attackers knew you can do code injection on these points in the program if the defenses are not engaged but the defenses are engaged do the defenses
stop this and uh Morpheus was never penetrated it was in fact the only Target in the challenge there were uh seven total Targets in the challenge this is the only one that was never penetrated a single time and uh Really exciting result that really shows you when you make it hard for attackers to forge pointers they're gonna really have a really difficult time doing code ejections so that was exciting um by the way our our test application was a medical database a medical uh registry it was a database that brought together lots of mock medical
data and then you can make differentially private queries over that database so they were hacking into this Rest API into an SQL Lite database so that was really exciting and it was this idea that that crypto would uh be a very powerful defense that got me more and more interested in using cryptography as a key defense in Hardware security and that quickly led me to the Privacy Community because in the Privacy Community many I would say most of the defenses are really based on Advanced forms of cryptography Because cryptography like I said in lecture two
it's really the only superpower in the world of security it's you know you'll see Zero day software hacks until the end of time on big operating systems and big applications but you don't often see a uh you don't often see people hacking into uh crypto systems and cryptography that's very rare and usually a very big event the example I would like to give is you know uh When Alan Turing broke The Enigma Cipher uh they made a whole movie out of it you know it's it's a really really rare that you see strong ciphers get
broken sometimes they'll get broken on the underlying implementation because it's got side channels but a strong Cipher with a clean you know sad Channel free implementation is incredibly hard to penetrate so we also talked about in the first lecture the difference between privacy And security security is stopping the CIA the confidentiality the integrity and the availability hacking um pets is about giving control of data back to data owners and of course you need good security to have good privacy and so you really get the best security uh with uh crypto so a lot of pets
or privacy enhancing Technologies as they're called are leaning heavily into cryptography with a cryptographic strength defense The system doesn't go down when you know the programmers go Rogue or the IT staff gets nosy or an attacker arrives at your system and finds a vulnerability that system goes down when someone guesses a very large key you know and then that's very very difficult to do very unlikely that'll ever happen so examples of pet Technologies you know are are for example like differential privacy which is a way of releasing statistics that don't reveal any Individual and that's
those statistics Federated learning which is a way to do machine learning training over uh many different data sets in different organizations instead of moving the data sets to a central location you move the model to the various locations and then you train the model across those different organizations data anonymization where you're releasing data but you're removing all the information that that it uh that Reveals the underlying um uh producers that data and then secure computation which is what I'm involved with and I want to talk about some of my research in that which is Computing
devices that compute directly on encrypted data and they do this to preserve confidentiality of the data and then some technologies in particular the Technologies I'm involved with also perform what's called tamper-proof computation where you're really limited to what computation you can run on a particular piece of data and that's defined by uh the data owners or what computation you can run on their data so let's take a look at the secure computation capability a little bit more we're gonna I'm gonna end up this tutorial specifically looking at this Technology by encrypting data and never decrypting
it and then having software operate directly on encrypted data you're basically building a crypto wall between software which is easy to hack and data which we want to protect so what's interesting about this is if somebody hacks into that data if somebody hacks into that system they only get to see ciphertext now if you do this right you can really Build sort of the Swiss army knife a privacy enhancing technology because what you're building is programming systems that operate directly on encrypted data in a traditional system if we want to send data to the cloud
and have it processed we have to send that data to the cloud encrypted with a key or we have to send a decrypted to the cloud the cloud will process that data and Then send us back the results with secure computation oh and then by the way of course as we've learned throughout this lecture series you know if the data or the keys are available attackers will get them malicious I.T staff can get them programmers could do things that you weren't aware of with your data Etc so with encrypted computation we're going to encrypt the
data before we send it to the cloud The cloud will operate on the data and software doesn't have access to a key the hardware might but software doesn't have access to that key and so it has to compute directly on the encrypted data and as a result if someone hacks into that system all they get to see is encrypted data in essence you're ignoring the vulnerabilities of the system the vulnerabilities in the software the vulnerabilities in the side channels and You're applying the defenses not to the code not to the system you're applying it to
the data that you care about by encrypting that data by having the data remain encrypted you're basically creating a very powerful isolation between everything that's happening in the in the software world and what's actually happening on the data now you need the ability to compute on encrypted data which is the big challenge of building is these Now what they talk about in The Pet World is this idea of zero trust data sharing this is where I could take my genome and I always like to use genome as an example of why privacy is important right
if you give your genome to someone else and then they steal it or take it without your knowledge or maybe you even agreed that they could take it when you signed a Eula to use their service You've Lost Your genome forever now the World you know they that's part of their intellectual property and you can't unlike your password you can't change your genome your genome is a one-time thing so if I want to give my genome to a third party to analyze it maybe show me my disease profile well in a zero trust data sharing
environment I give them my encrypted genome they analyze my genome encrypted and they Send me back encrypted results which then I can decrypt and then I don't have to worry about if they can see my genome or not I trust my trust is not in the company that I'm interacting with my trust is in the Privacy enhancing technology and that's to me that's really exciting because that can really ease the tension between privacy and what people want to do with my data like Drive advertising or or you know give me a service on my on
my data Et cetera it's really really exciting now one technology which you know you may have heard of is very very uh popular in the Press today is a technology called homomorphic encryption and it provides this encrypted computation capability where I can send encrypted data up to the cloud I can apply a function f to it and I get the encrypted f of x back under that same key and again it eliminates all trust in Both hardware and software completely the trust is completely in the mathematics of the cryptography and essentially what happens in these
homomorphic encryption systems in a traditional encryption system you get an encrypt operation and you get a decrypt operation that takes a key right okay and so you encrypt values you send them to your friend they decrypt them if you share the key okay now we can see these values In a homomorphic encryption system there's two other functions there's an add function and a multiply function and the add function will take two pieces of ciphertext you run this recipe on how to add and you get the result of the two values added together in ciphertext but
never where the value is decrypted now that's exciting if there's a hack in the system all you get to steal is ciphertext there's not even keys there if there's a backdoor Trojan in the Hardware no one's going to see anything except server text so it's really exciting way to basically ignore vulnerabilities in the presence of he computation super exciting and it truly is a privacy technology because now I can do copy you know I can get a computational service on my data and no one gets to see that data or the results of that computation
except me that's very exciting in the cryptography Community they call It the Holy Grail of cryptography because it's the ability to compute directly on encryption but if you follow the he community in particular you'll note that the performances is really really poor you know compared to Native execution you're looking at thousands to millions of times slow down just you know legendary large slowdowns um and very hard to program there's two kinds of he there's Homomorphic encryption and there's fully homomorphic encryption which is even slower than homomorphic encryption and the difference between those two is how
much depth in your computation can you incur and normally you can only go about four or five multiplies deep in your computation and then you destroy the data why because in an effort to not correlate the data to the values they inject noise into the ciphertext and so that noise occurs as you do deeper and Deeper computation fhe has this technology called bootstrapping which can eliminate that noise to reduce it to a lower level and they basically allow you to do any depth computation but it is incredibly expensive so it's hard to program because now
you tell your programmers hey uh you can write any programs you want as long as it's only got plus and multiplies no no less than or equal to no equal to no sorting for example oh and by the way Your depth of your computation only be four or five deep that I mean that's challenging so you see a lot of research building compilers to try and help make this a little bit better to do and then also there's no such this thing is integrity checking if if if you know I send you my genome uh
to do disease analysis and homomorphic encrypted systems I can hack into the homomorphic encrypted system I can throw away your genome and just Generate a set of results that um you have every disease and send it back to you and you don't know that you may have every disease or you may have been hacked you don't know that that's because with Integrity attacks I don't have to see the data I just have to manipulate the computation and there is an eight in he there's really no way to prevent the manipulation of the computation uh today
now there's a there's an Associated technology that Can help in this regard called zero knowledge proofs which you can say you know you can ask it did you actually compute this correctly and and to a certain extent it could make some proofs about what was done and not that also very expensive so anyway you're just sort of layering expense on expensive expense here so it's it's yeah as traditional Architects and compiler people where I was shaving a few percent off when you go into the world of Homomorphic encryption all of a sudden you're dealing with
millions of times slow down it's it's it's a really different world out there but what a cool technology it's in my mind this is really one of the greatest Technologies in the last 20 years the idea of computing directly on encrypted data is is really sort of a ground shift in what you can do in the world of privacy so so exciting Which is why I as a hardware researcher want to basically recreate all these Technologies in the micro architecture without actually doing all the advanced cryptography and so what I've been doing for the last
five years is basically doing what homomorphic encryption and zero knowledge proofs and then there's another technology I didn't talk about called functional encryption trying to recreate all of these very cool secure Computation capabilities but do it in the context of more advanced trusted execution environments te enclaves and and that's really the focus of my work so we're gonna I'm just gonna close this out by giving you just a taste of that work so what I've been building are what I call cryptographically secure Tes these are tees where to penetrate them you don't hack or do
side channels you have to guess keys and so these are unique Tees quite different than traditional teas but they're still tees and they solve the two basic problems that we saw on the very first lecture of this of this series they solve the problem of how do you stop solve software programmabilities right and you'll remember in the first series I said software vulnerabilities are everywhere and they're hard to find and they're hard to stop but if we want to have a Cryptographically secure computation system um we have to find and fix all the trusted software
vulnerabilities that's a conundrum right if we can't find and fix all the software build software uh vulnerabilities and in order to have a cryptographically secure system we have to find and fix all the software vulnerabilities the only solution is there can be no software in the trust Zone and this really this This underlies my entire view of security in today's world where a lot of people say that security insecurity comes from Bugs and software but the way I look at it is insecurity comes from software not bugs and software software so I just built a
trust Zone that has no software in it so how does it become useful well the interface in my trust zone is instructions add these two values together you know it's basically a CPU So there's no software in a CPU so I can build basically a very flexible computation component by just building a cpu-like thing for my Enclave then the other problem you have to solve is how do you get rid of side channels and so we learned that there's you know control memory timing micro architecture analog side channels and so what I do today in
my research is I give The Enclave its own silicon and I build the Silicon in a way where it provably has No control memory timing in microarchitecture side channels this is mid-2023. in a few months I have a paper coming out in ACM CCS really uh great uh security conference on on those proofs so we've completed those proofs and there are no side channels in that in our in The Enclave that I built still is analog side channels so the way we prevent people getting access to those analog side channels is we just put it
Into dedicated Hardware in the cloud and and then we don't allow people to you know wheel in their electron microscopes into the Microsoft Azure Amazon AWS so it's a that's a pretty good solution as it stands today but uh in particular in my own research I'm very interested in getting rid of analog side channels not really getting rid of them but creating systems where you don't learn anything by looking at their analog characteristics And then what you do is outside the office I just encrypt everything right a strong semantically secure encryption is a superpower use
it everywhere you can and so anywhere outside The Enclave if it's protected data it's encrypted all the time everywhere and the registers in the caches in the memory in the swap everywhere and so that's that's really to my mind is the way you make a cryptographically security so we have This technology called sequestered encryption and we built this enclave and I want to show you how that that works so sequestered encryption the name comes from the fact that what we're going to do is we're going to sequester into this Hardware Enclave all of the computation
on encrypted data and inside that Enclave which is coupled with a a core that Enclave inside of it is just a functional unit there's no memory Registers nothing it's just a functional unit serving a tiny little instruction set extension to the main core and the trust boundary of The Enclave is just the functional unit so what is trusted in the system is this functional unit which is the only thing in the system allowed to compute on this encrypted data it gets this data from a third party using what's called public key key exchange the functional
unit actually Has a public private key and a third party can encrypt that data and bring it into the system and unseal it inside the functional unit the functioning that has a pki decrypter but no timing side channels we saw that lecture number four uh you know we built that with no no timing side channels provably and it can expose a key inside this little Hardware device and then the hardware device just decrypts on Entry does computation on the data just like it would do it in the Main core and then re-encrypt it with a
high entropy Cipher it's a high degree Cipher because it's going to inject a lot of random salt that is called into the encryption and what's coming out of the output of this functional in is just pure random data it's literally a fantastic random number generator and so that now you have ability to do computation you've taken the CPU which is eminently hackable and now you have this Stream that you can send through the stream of computation you can send through this SC Enclave which is both encrypted and not visible to any hacking or IT staff
or anybody or any software and then also has Integrity checking in it as well so really exciting technology let me just give you a sense of what you get from this Enclave you get this High entropy encryption mechanism where the Entropy is so high it's about 64 bits of entropy on any encryption uh it's so high that essentially you're never going to see a piece of cyber text that comes out of it again ever I mean you'd have to run the thing forever and ever and ever just to have even a probability of seeing that
ciphertext ever again and there's no correlation between the data that it's working on encrypting and the output of the Ciphertext it's just pure random and then it's you know it just gives you a risk-like instruction set to compute on data in a way where that data is integrity checked and that data is um is encrypted so if somebody hacks into the system we don't care about vulnerabilities in software at all there's no software that can see access to the decrypted data and in terms of Hardware vulnerabilities we only care about how Real vulnerabilities in The
Enclave that's the root of trust for this computation stream anywhere else in the in the system you know you you know if someone row hammers your data it's going to be encrypted if somebody does a specter and meltdown on the main core they're going to pull out your encrypted values so it's it's you know as I said earlier in the early elections you should have encrypted that with this technology you can encrypt that so it's Really handy to to have that ciphertext everywhere else and then what Guard railing is is uh it's the Integrity checking
and we have a really cool mechanism called data flow Integrity checking which essentially can allow us to see what program produced a value and then we also use that to selectively release values so if I'm doing machine learning training over encrypted data I don't get to see the results of that machine learning Training but the date owner could allow me to look at a single error variable to see how much error did I have in my training test in the last apoc and should I continue to train this data so really interesting capability and just
generic privacy enhanced programming by the way in over in the crypto world you got he doing this data encryption and encrypted computation and you got zero knowledge proofs kind of giving you the capability of Guard railing it's a Way to see if someone did hack into your system and change what it was computing um but you really don't have anything in terms of safe data grants and this is this is a definite limitation of the crypto world how do you how do you produce a piece of how do you produce a piece of information that
can that can be seen without giving your attackers the ability to see that data So we've deployed this Enclave in Azure and AWS the way we deploy in the cloud design fpgas and uh we deploy our SC Enclave into the fpgas and then we program to it from the main core via memory map dial interface and so the Enclave is pretty small it only takes about six percent of an ultrascale fpga which is about 190 000 Gates of logic and it itself is logic locked we saw that earlier in this Lecture it's watermarked which means
that we can actually tell if it's our hardware and then it has a technology called forward secrecy where if we rebuild the hardware we can't see old data that was able to be open with a previous version of the hardware um it took us about two years to build this two people excuse me two people one year to build this and that and it competes very effectively with homework encryption and Multi-party computation it competes also also with Tes but it's security profile compared to a te is is much better uh less side channels uh no
exposure to hacking because there's no software in the trust Zone and here's a performance measurements you know when you look at the performance of uh trust Forge Azure compared to native code so it's like your best algorithm that you've done versus a privatized version algorithm it Runs the code about 55 times slower and that's primarily due to the latency of pushing crypto through the PCI bus to the fpga card and then the processing decrypting and encrypting of that and so you know if you're using Intel sgx certainly faster than this technology the main advantage of
this technology over Intel sdx this is this is a privacy technology that limits exposure of data from third parties in a system whereas sgx to limit that exposure you're going To have to you could have to address side channels and and software hacking in a real durable manner to do that compared though to homorphic encryptions significantly faster Microsoft clhe is probably the most performant homomorphic encryption platform and also one of the hardest to program um and it's it's more than an order being too faster that and then if you look at fully homomorphic encryption you
Know it's just literally millions of times faster uh than nearly millions of times faster than those platforms and what's really exciting about a hardware technology like this is the tire you're integrated into the CPU the faster it'll get so you know while we're 55 times slower than native today if we get on integrated fpgas we're about 18 times slower is about 3x performance Improvement for that if we can get into an Asic on an SOC which you know we're Definitely working in those directions uh you can get within 5x of native computation and then if
you integrate this uh completely into a CPU as a first class functional unit we've shown with gem5 simulations that you get within 20 of native that's uh just a first cut at optimizing that interface and those operations in the functional unit so I'm really excited about this direction for privacy enhanced computation Programming the system is really quite straightforward uh the competition is bit for bit compatible with the main program so you're basically just taking variables that were not encrypted and then redeclaring them for example in C plus one of the languages it supports uh you
just have a set of variables which are encrypted and when you do computation on encrypted variables the results are encrypted so you can't decrypt anything and that computation is Directed to The Enclave there's two things you can't do on encrypted computation which we learned about in the side Channel lecture you can't use it to influence an if statement because that would be a control side channel so the way you make decisions in crypto computation is use a encrypted C move operation and then you also can't index memory within with a secret value because that would
create a memory side channel so The way you get rid of that is just use what's called an Oram an oblivious Ram pretty simple change these do cause some performance implications in the underlying program but we found in general if you redesign the algorithm you can generally get rid of most of these um most of these overheads in particular old Rand permanent as I always tell my team like using an Oram primitive is is a warning Sign it's like drinking in the morning if you're doing it you've got a problem so if you need to
use an o-ram primitive just redesign your algorithm so that you don't and what's really exciting about privacy Technologies this you know be a sequestered encryption or homework encryption um it's really exciting to see how you could build systems that are more privacy oriented so I just wanted to Close out this lecture with two examples of this the first one is a medical registry database this is a very common construct in the medical community where hospitals pool their data together and then give access to researchers typically the access will be through some differentially private interface you're
not revealing information about the underlying uh patience you're not violating HIPAA laws So you want to encrypt that data in the database preferably under each Hospital's key you want to be able to do encrypted computation across a database to generate analytics about that data you want to guard rail there for two purposes you don't want anybody to hack in and change your analytics and then also you may limit the analytics based on who's accessing the database or what study is being done so you just can't go arbitrarily probing through the data You're only allowed to
run the particular competitions that are allowed based on the data itself and then finally to see those final results you could add tests like is this result differentially private and if it is I can then release that result to the third party so it's really exciting what you can do with these privacy enhanced systems to to Really protect patient data in this case here's an iot application that's super Exciting where you've got basically a watch that is monitoring your hard data it's encrypting your heart data on the watch today it sends it up to the
cloud where it gets decrypted that data is fully visible and you get it for all kinds of things about what's happening in your life by looking at your hard data your heart follows your emotions one for one pretty much but anyway let's say you didn't want the cloud providers to know what's going on with your with Your life so you want to encrypt that data send it up to the cloud user privacy enhancing secure computation technology to compute directly on that data use Guard railing to make sure no one hacks in and says oh you
have an arrhythmia or you know without without you know make sure you're getting valid computation make sure no one's analyzing your data in ways you didn't want to and then you know really none of that data should be Visible to them at all they should all come back to your watch and be decrypted and shown to you on your watch um but you know there are cases where this it would be useful for the server to see something let's say there's an arrhythmia analysis algorithm and all of a sudden they start noticing you're having arrhythmias
well the server could get a data Grant to decrypt that one arrhythmia value and just see that one Boolean Valley and If it saw that you were having a rhythmias could send you a text message or an email something to notify you that hey something's going wrong so really interesting uh iot application there's interesting applications in you know criminal law enforcement as well as you know fintech all kinds of really cool things and I'm really excited about the possibility of using privacy enhancing Technologies like homorphic encryption like sequestion encryption in the future To really ease
that tension between um you know privacy of data and then enabling Discovery over that data and enabling you know safe monetization of that data safe safe sharing of that data I think these are really exciting Technologies to explore that is the end of this Hardware video tutorial the Hardware security video tutorial if you've stayed with me this long thank you very much I really Appreciate it it's been a pleasure to do these uh six videos I'll be looking uh for more opportunities to do more tutorials uh in the future and more videos so definitely like
this video If you like this this series and and please subscribe to my YouTube channel because I I tend to make videos on a pretty regular basis thanks again for sticking with me thanks again for watching if you have any questions don't hesitate to reach out I'd love to interact with my Viewers and take care