WEBVTT

00:00.000 --> 00:06.220
Welcome, this is the attacks on GenAI data and using vector encryption to stop them talk.

00:06.960 --> 00:20.320
I'm Patrick Walsh, this is Bob Wall, we're the co-founders of IronCore Labs, where we help people protect data in their cloud applications by making application layer encryption more easy and practical and usable.

00:21.220 --> 00:27.980
So this talk is going to be about the ecosystems around LLMs, but we'll start by talking about LLMs specifically.

00:28.700 --> 00:32.320
And in particular, some limitations of LLMs, right?

00:32.320 --> 00:42.860
When an LLM is trained, it's trained to predict a plausible completion to a prompt, and that means it can sometimes make stuff up that sounds good but isn't necessarily right.

00:42.860 --> 00:50.700
It's also trained on what, by the time it's released, is typically stale data, because it takes a long time to train it, to test it, to fine-tune it, etc.

00:51.020 --> 01:03.160
And then finally, it hopefully hasn't been trained on your data, and therefore, if you want it to do things that are cool across, you know, your corporate data, your personal data, or something like that, it's not going to work.

01:03.160 --> 01:08.080
And to fill those gaps, there's a thing called RAG, or Retrieval Augmented Generation.

01:08.560 --> 01:14.120
Terrible name, basically means stuff extra stuff into the prompt so the LLM can answer questions better.

01:14.280 --> 01:15.900
And it works a lot like this.

01:15.900 --> 01:20.760
You have a chat app, it doesn't have to be a chat app, it's just like the most common thing you use, right?

01:20.760 --> 01:27.000
A user asks a question, and now instead of passing that question to the LLM, the first thing it does is a search.

01:27.000 --> 01:31.760
And that search is to find relevant documents related to the query.

01:31.980 --> 01:35.920
That all gets jammed together into a prompt, which then goes to the LLM.

01:35.920 --> 01:38.060
That's it, that's RAG in a nutshell, you get it.

01:38.060 --> 01:41.840
Here's a kind of more practical example of what that looks like.

01:41.840 --> 01:58.580
There's a system prompt, there's a history of the previous questions and answers from the chat, and then there's the current, the most recent question, and then stuffed in with that is any documents or web pages or whatever it is that might be related to what the question was.

01:58.580 --> 02:01.160
In this case, it's about, hey, what's that draft 10Q?

02:01.700 --> 02:09.140
It's a private document that's not public, and that's how it all gets in to the LLM so it can answer questions on that private data.

02:09.280 --> 02:15.860
It's fundamental to basically how everyone is using this stuff today, if you're using chat inside an app.

02:16.300 --> 02:22.720
And to make all this work, you need to have some type of more intelligent search than what we typically do.

02:22.940 --> 02:28.700
Call it AI search, call it semantic search or whatever you want to, and there's a bunch of ways to do this.

02:28.700 --> 02:31.880
The most popular right now is an approach called vector search.

02:31.880 --> 02:35.960
It's kind of what everyone is doing, although it's not the only way to do it.

02:36.140 --> 02:54.700
And vector search and actually all of those AI search type techniques are important because they differentiate between different meanings of words, they can understand a sentence in context, they can understand when arm means a division of an organization versus when arm is a body part or even a verb,

02:54.700 --> 02:55.460
right?

02:55.660 --> 03:02.700
And in practice, how these types of vector search works is you start with some input document.

03:02.900 --> 03:04.820
And that input, did we lose it?

03:04.820 --> 03:07.880
And that input document then gets chunked up into pieces.

03:07.880 --> 03:14.600
Sometimes it's by sentence, sometimes it's sets of, call it 30 words, or it can be any strategy and often overlapping.

03:14.660 --> 03:25.540
But each of those pieces gets run through something that's very similar to an LLM, that sucks, that's very similar to an LLM, but is in fact called a text embedding model.

03:25.540 --> 03:31.440
And a text embedding model, unlike an LLM, produces something called a vector embedding.

03:31.540 --> 03:33.120
That's not great.

03:35.920 --> 03:38.520
Produces something called a vector embedding.

03:38.520 --> 03:43.300
And the vector embedding is basically just a long list of very small numbers.

03:43.680 --> 03:47.060
And those small numbers can be hundreds or thousands in length.

03:47.440 --> 03:54.920
And we'll get into what they mean in a minute here, but to give you some intuition on these, we'll take a look at a list, like a vector that's only three long, right?

03:54.920 --> 03:57.960
Because you can graph this in 3D space and you can understand it better.

03:58.060 --> 04:09.840
And if we have a bunch of different vectors, let's say we have A and B and we have C, we can kind of look at this visually and say, oh look, A and B kind of look like they're close together and A and C look like they're far apart.

04:09.840 --> 04:23.920
In fact, if we run a distance comparison operation like this one, Euclidean distance, although there's a bunch of different ones, they all have the same kind of effect, you can see that A and B are 2.2 apart, whereas A and C are 5.6 apart.

04:24.360 --> 04:27.800
And the way this works with search is we take a query, right?

04:27.800 --> 04:30.860
It's a sentence, and we reduce it to, let's say, A.

04:30.980 --> 04:42.020
A is a vector representation of what we queried, and then we search across all our vectors and we say, give me anything that's similar to A, and then hopefully, if it does it right, it returns B but not C.

04:42.320 --> 04:45.680
That's it, that's what vector search is doing, it's the whole shebang.

04:46.000 --> 04:48.640
The vector represents the meaning of the content.

04:49.180 --> 04:58.680
And to make that work, we have this kind of new concept, or at least new to a lot of us, at least to me, although I guess it's been around for quite a while, and that's called a vector database.

04:59.200 --> 05:07.720
And a vector database's purpose is to be able to do these nearest neighbor or approximate nearest neighbor searches across large amounts of data very quickly.

05:08.700 --> 05:11.020
And there are a lot of these companies now that are doing this.

05:11.020 --> 05:19.620
In fact, last year we saw hundreds of millions of VC money go into the startups that are building vector databases, startups like Pinecone and Weaviate and Quadrant.

05:19.880 --> 05:32.120
And despite that, the idea of a vector database is already eroding away to nothing because classic databases like Mongo and Postgres and Oracle are all adding vector capabilities to their existing databases.

05:32.120 --> 05:38.600
So you're getting these type of vector comparison nearest neighbor search capability pretty much everywhere that you have a database now.

05:39.140 --> 05:40.920
Okay, changing tracks for a second.

05:41.340 --> 05:44.260
We started thinking to ourselves, who's using this stuff?

05:44.680 --> 05:53.700
Well, we looked at the top 10 SaaS companies and we thought, how many of them are doing adding LLM capabilities over private data?

05:53.700 --> 05:56.080
Which means that they're almost certainly using RAG.

05:56.080 --> 05:57.500
The answer is 100%.

05:57.500 --> 05:59.680
Then we said, well, what about security companies?

05:59.680 --> 06:04.480
They wouldn't jump on to just using all this new technology that we don't know how to secure yet, would they?

06:04.480 --> 06:06.100
No, 100% of them too.

06:06.520 --> 06:09.620
Also adding LLM capabilities on top of private data.

06:10.800 --> 06:12.780
Think about that for a moment , right?

06:12.780 --> 06:18.720
It means that these AI systems, whatever cloud services and things you're using, they are hoovering up this data.

06:19.040 --> 06:27.020
Probably copies of it are going into the vector databases as vectors and among other places, which I'll talk about ever so briefly later.

06:27.520 --> 06:30.200
So, do these vectors matter?

06:30.560 --> 06:42.080
I was talking to the CEO of one of the vector database companies who's raised tens of million dollars last year and he told me that a vector was like a hash and it was basically meaningless, except for comparison purposes.

06:42.480 --> 06:46.260
So, which my first thought is, well, you clearly don't know how people abuse hashes.

06:46.260 --> 06:49.960
And my second thought is, you're wrong.

06:50.060 --> 06:52.240
So, that isn't how it works at all.

06:52.240 --> 07:02.360
If you look at taking a phrase and you reduce it to an embedding vector, an embedding model into a vector, okay, it looks pretty meaningless to us.

07:02.360 --> 07:08.020
But then again, so does an animated GIF like this cat if you look at it in a text editor, right?

07:08.020 --> 07:15.200
Just because it's meaningless to us to look at, doesn't mean it's meaningless to a computer or in this case, to an AI model.

07:15.200 --> 07:23.920
And so, the way you go back from a vector to the original text or something approximating it is using something called an inversion model.

07:23.920 --> 07:29.580
An inversion model is just a model that's trained on vectors to sentences so that it can make that same prediction.

07:29.960 --> 07:32.260
In this case, it comes close.

07:32.260 --> 07:35.520
It's our income is down instead of our earnings is down, right, in this example.

07:35.800 --> 07:40.240
100% match on meaning, not 100% match on words.

07:40.500 --> 07:43.800
There are some tens of thousands of papers on this at this point.

07:43.800 --> 07:49.380
It's heavily studied in academia, not widely known, I don't think, broadly.

07:49.940 --> 07:58.940
Best paper we've seen for text inversions, and it's not just text that vectors represent, I'll talk about that in a second, recovers 92% of exact words.

07:58.940 --> 08:05.840
That means full names, everything coming right back out exactly as it went in on the text, okay?

08:05.840 --> 08:09.060
The other 8% is basically effectively the same anyway.

08:09.760 --> 08:12.040
So are these attacks hard?

08:12.660 --> 08:15.500
What's the skill level for doing this kind of attack?

08:16.020 --> 08:28.280
The answer is most of these papers have accompanying open source software on GitHub, and so really you just need someone who can run the software, not someone who knows how to build the software, which means it's script kiddy level.

08:28.640 --> 08:31.600
And on that note, we actually ran some of these attacks ourselves.

08:31.600 --> 08:33.580
We posted some blogs you can check out.

08:33.580 --> 08:42.840
We did one on, so I mentioned vectors can represent different things, they can represent images for image search, they can represent faces or voice prints or other things for that.

08:42.880 --> 08:44.680
We did one against facial recognition.

08:44.680 --> 08:51.480
That doesn't use an inversion model, that's a different technique by the way, so it's kind of interesting for that purpose, and we did one on text inversions.

08:52.040 --> 09:00.000
Really good results, like you can really get all the stuff back out or very near approximations of the inputs.

09:01.140 --> 09:04.540
All right, so let's talk about these new vector database companies.

09:04.920 --> 09:07.280
They probably have good security, right?

09:07.740 --> 09:10.000
Actually no, super immature.

09:10.220 --> 09:24.040
They'll fix it over time, it'll be fine, but if you look closely at these as we have, two of them have no authentication required by default, right, making the mistakes of Elasticsearch and MongoDB of years past but not learning.

09:25.060 --> 09:41.280
One of them has services that are meant to be internal services and that, you know, there's no protection or authentication on them, so that if someone goes to access that because the firewall neglected to block a port, direct access back to the data without any authentication.

09:41.860 --> 09:47.740
Two of them claim to have end-to-end encryption when they only have TLS in transport, and more.

09:47.740 --> 09:49.140
I could go on, it doesn't matter.

09:49.600 --> 09:57.440
The point is that these vector database systems, and for that matter the chat apps, either way, are like total treasure troves of information.

09:57.760 --> 10:05.420
And even if you don't use it and invert it, they're at least treasure maps of information because they point back to the data and you can query it.

10:05.420 --> 10:19.100
And if you think about that for a second, imagine that you're in a CTF competition in that corner of this thing, and you know, you get into a machine, cool, but now you have to get the flag, and it's in a database, you have to get into the database, and now you have to reverse the schema and,

10:19.100 --> 10:21.400
you know, figure out a query and find the flag.

10:21.940 --> 10:23.480
It ain't as easy as it sounds, right?

10:23.480 --> 10:28.920
It's a lot of expertise and time to do that versus, you know, give me that data.

10:29.360 --> 10:37.520
It is, like, incredibly far, far easier to attack these systems because you can do it in natural language.

10:38.920 --> 10:42.620
So, what do we think about bringing AI into our infrastructure?

10:42.620 --> 10:46.420
Maybe we should pause for a moment and think a little bit about it.

10:46.420 --> 10:50.520
Or if it's in there, maybe if you're a hacker in the audience, you should think about, holy shit, there's a lot here.

10:50.520 --> 10:52.000
Let me give you some ideas.

10:53.440 --> 10:55.600
Obviously, everyone knows about prompt injections.

10:55.780 --> 11:04.180
Maybe you haven't thought so much about the fact that you can put a prompt injection in the documents being searched, and they get pulled into the prompt, and you can poison the prompt that way.

11:05.540 --> 11:06.920
Logs are everywhere.

11:06.920 --> 11:11.160
If you're putting private data into the things that go to the LLMs and the LLMs log it, that's a problem.

11:11.160 --> 11:16.100
But also, the prompt firewalls, if you're using those, are logging that stuff, too.

11:16.100 --> 11:17.820
So, the data's kind of exploding.

11:18.100 --> 11:19.920
And don't even get me started on agents.

11:20.320 --> 11:22.460
Talk to me after if you want to hear about my thoughts on that.

11:22.460 --> 11:28.040
But if you're generating code to run to query a database, you're beyond hope.

11:29.160 --> 11:30.840
Today, though, we're not going to talk about any of that.

11:30.840 --> 11:34.760
We're going to talk specifically about this vector stuff and how to protect it.

11:34.900 --> 11:37.540
So, basically, today, the way to protect that is to encrypt it.

11:37.760 --> 11:40.960
And there's two approaches to this, at least in academia, that you could do.

11:40.960 --> 11:44.300
One is fully homomorphic encryption, and the other is partially homomorphic.

11:44.300 --> 11:50.100
So, fully homomorphic encryption, there's actually quite a few papers on this, and they're fairly interesting.

11:50.100 --> 11:51.500
There's a lot of different approaches.

11:51.500 --> 11:54.780
Some of them require sending all the vectors to the server.

11:54.780 --> 11:56.380
Some require some other stuff.

11:56.480 --> 11:58.560
They typically suffer from being slow.

11:58.640 --> 12:06.120
And you would have to build your own vector database and be another logo on that wall and compete with all the other vector databases on every other thing.

12:06.500 --> 12:09.380
The other option is partially homomorphic encryption.

12:09.380 --> 12:16.760
And the idea here is that something that's partially homomorphic is able to do some operations, but not arbitrary operations.

12:16.760 --> 12:24.000
And in this case, we're talking about optimizing for that nearest neighbor search type of operation.

12:24.000 --> 12:29.860
So, in this example, partially homomorphic, specific to nearest neighbor searches.

12:30.160 --> 12:35.790
And to talk more about this paper and the work that we've done around it, I'm going to turn it over to Bob.

12:39.810 --> 12:40.810
All right.

12:41.370 --> 12:46.990
We found this paper about a way to encrypt vectors.

12:47.090 --> 12:52.370
And you can see the title, Approximate Distance Comparison Preserving Symmetric Encryption.

12:52.370 --> 12:53.910
So, that's a mouthful.

12:54.390 --> 13:07.750
But this algorithm is a type of property-preserving encryption, which means it's kind of like order-preserving encryption or maybe deterministic encryption, if you've heard of those.

13:07.750 --> 13:15.310
The property that this algorithm is preserving, though, is distance comparison instead of equality or order.

13:15.310 --> 13:29.090
And so, if you can preserve the ability to compare the distance between two vectors after they've been encrypted, that means your vector database continues to work on the encrypted vectors just as well as it did on the original vectors.

13:29.090 --> 13:35.950
So, like deterministic and order-preserving encryption, there's a trade-off.

13:35.950 --> 13:42.210
The more secure you make it, the less well the property is preserved.

13:42.210 --> 13:45.570
And so, the less well queries might work on the data.

13:45.570 --> 13:58.750
So, you have a decision to make about whether you want a lot of security and you can tolerate maybe a little less accuracy on queries, or you want a lot of accuracy on the queries and maybe you'll have a little bit less protection of the data.

13:59.210 --> 14:10.310
But the system works by, if you've got a system that's ingesting data and it's making these vectors , putting them into a vector database, it's easy to add this encryption.

14:10.630 --> 14:28.630
You just, in the system that's already there, after you've taken the data and run it through the embedding model and generated the vector embedding, you run it through this algorithm and encrypt it, it's still a vector, it looks similar enough to the original vector that the vector database is going to take it and be happy with it.

14:29.290 --> 14:34.350
So, you use a secret key, you encrypt the vector, you throw it in the vector database.

14:34.350 --> 14:38.690
So, very simple change to the system to be able to do that.

14:38.690 --> 14:48.850
Now, most of these vector database systems support storing metadata along with the vectors, and that metadata might have some sensitive data in it too.

14:48.850 --> 14:51.470
So, you might want to consider encrypting that.

14:51.470 --> 14:52.490
That's a whole different thing.

14:52.490 --> 14:55.290
We're just going to focus on the vectors for right now.

14:55.610 --> 15:01.130
So, once you've got all of these vectors encrypted, you've loaded them into your vector database.

15:01.130 --> 15:04.530
When it's time to do a query, it's also pretty simple.

15:04.630 --> 15:10.090
Again, the normal process would be to take the query, run it through the embedding model, get a vector.

15:10.270 --> 15:16.390
So, then you just encrypt that vector with the same key and the same algorithm, and then you do your normal search.

15:16.390 --> 15:33.470
And because the algorithm, the encryption, preserves distance comparison, that means that when you give that encrypted query to the vector database, it's going to return the encrypted vectors that are closest to the encrypted query, and those are going to correspond to the decrypted vectors,

15:33.470 --> 15:36.970
the original vectors, that are closest to the original query.

15:36.970 --> 15:40.830
So, you get the same results out, pretty much.

15:41.750 --> 15:51.710
And once you get them out, you can maybe decrypt the vectors if you need to, or maybe you've got some metadata that lets you look up the associated data in a database or something else.

15:52.610 --> 15:58.170
So, without the key, an attacker can't really understand the queries.

15:58.170 --> 16:03.430
They are enough different that they can't look at that and kind of know what the query was.

16:03.430 --> 16:11.390
They can't invert the data that's in the database, even if they hacked it, exfiltrated all the data, they can't easily invert it.

16:11.990 --> 16:14.750
The results are still fairly accurate.

16:14.750 --> 16:18.950
Again, that's a trade-off between the security and the accuracy of their searches.

16:19.530 --> 16:26.130
The whole thing is, it introduces a negligible penalty in terms of performance.

16:26.430 --> 16:33.070
The encryption process is fast, so you can add this in and not add a lot of time to your process.

16:34.150 --> 16:37.650
So, I'm going to talk a little bit more about this encryption function.

16:38.050 --> 16:55.750
So, it's a function that maps inputs to outputs, and it does it such that for any distance function, the margin of error that you get when you compare two encrypted vectors will be within some factor, we'll call that beta, the approximation factor of the original distance.

16:55.750 --> 17:07.370
And so, if you can build a function that preserves that for any pair of vectors that you give as an input, then you have distance comparison preserving encryption functions.

17:07.370 --> 17:18.390
So, in real systems, we kind of talked about this, the comparison function is used for nearest neighbor and approximate nearest neighbor searches, which is what all these vector databases are doing.

17:18.390 --> 17:28.170
So, you know, if we can build, and we can, we've built this function that preserves distance comparison, so we can use it to encrypt these vectors.

17:28.530 --> 17:32.250
So, the paper introduced this scale and perturb algorithm.

17:32.670 --> 17:38.670
And I won't go into a lot of details about how it works, but I will give you a few key points about it.

17:39.590 --> 17:48.670
So, there's a scale factor, when you, when you set up the algorithm, you randomly choose this scale factor, and you choose a random key.

17:49.130 --> 17:50.230
And so,

17:53.640 --> 18:08.560
there's also when you go to encrypt an individual vector, you generate an initialization vector, an IV value, just the same as you might if you're doing symmetric encryption on data with, you know, a normal symmetric algorithm.

18:08.840 --> 18:17.280
And you perturb each element of the vector using that key in that initialization vector randomly.

18:17.700 --> 18:21.680
So, every element in the vector is going to get wiggled around a little bit.

18:21.680 --> 18:27.360
And that amount that it gets wiggled around depends on that value beta, that approximation value.

18:27.360 --> 18:33.060
And that's how it limits the change in the distance that you can get.

18:34.420 --> 18:40.000
So, the paper had this idea of perturbing the vectors as well.

18:40.000 --> 18:42.260
And they basically had this idea of shuffling.

18:42.260 --> 18:47.520
If you had all of the vectors, you would shuffle the order of them before you encrypted them.

18:47.640 --> 18:54.260
And we wanted an online algorithm so that you could, you know, you just encrypted the vectors as you saw them.

18:54.260 --> 18:57.440
So, we didn't find that shuffling to be beneficial.

18:57.440 --> 19:03.320
But we did add a shuffle where we took the elements of the vector and shuffled them up.

19:03.320 --> 19:05.300
So, we randomly changed the order.

19:05.300 --> 19:08.200
And it's a deterministic shuffling based on the key.

19:08.300 --> 19:12.380
So, when you get done, all of the elements in the vector have been scaled.

19:12.840 --> 19:15.980
And then they get shifted around, which makes it even harder.

19:15.980 --> 19:29.360
Even if you knew what the algorithm, what the embedding model was, all of the elements of the vector are in different places, which makes it a lot harder to look at it and try to even guess how it corresponds to the original vectors.

19:31.560 --> 19:36.740
So, to give a little bit of a more intuition about this, you can think about these vectors.

19:36.740 --> 19:40.540
I mean, a vector is a line from the origin to some point.

19:40.540 --> 19:44.720
And the point is defined by the elements in the vector, right?

19:44.720 --> 19:46.580
Those are the coordinates of that point.

19:46.580 --> 19:55.580
And so, the beta basically defines a sphere in n-dimensional space around that point.

19:55.720 --> 20:02.240
And so, as we perturb the elements of the vector, the resulting point is somewhere within that sphere.

20:02.240 --> 20:07.020
And the size of that sphere is governed by that beta value, the approximation factor.

20:07.020 --> 20:18.900
So, you can see that if you bound the amount that you can move the point around, and you've bound the amount that you've moved another point around, the distance between those is bounded too.

20:18.900 --> 20:22.700
So, that's how it manages to preserve the distance comparison.

20:23.720 --> 20:31.180
So, in addition, we talked about, we also scaled the vectors up so that they're, you know, they get moved around a little bit, they get scaled.

20:31.180 --> 20:34.100
So, if you just look at them, and then the elements get shuffled.

20:34.100 --> 20:41.540
So, it's very difficult to correlate an encrypted vector and the original vector that was encrypted.

20:42.920 --> 20:50.500
Again, because we've preserved that distance comparison, they're still relatively close together with each other.

20:51.240 --> 21:02.100
Here's an example, we kind of turned off the shuffle part of it, so it wouldn't be quite as difficult to see, but you can see, you know, we scaled it up, and then we perturb everything.

21:02.100 --> 21:12.280
So, sometimes, depending on how much we perturb stuff, signs on elements might change, you know, they bounce around a little bit, but they're still in this vector.

21:12.680 --> 21:16.800
So, we've implemented this algorithm.

21:16.800 --> 21:21.120
We've got an open source library we call IronCoreAlloy that's out there on GitHub.

21:21.720 --> 21:24.060
It's under the AGPL license.

21:24.320 --> 21:28.780
So, if you can use GPL software, you can go grab it and use it.

21:28.780 --> 21:33.780
If you can't use GPL software, you can talk to us about a different arrangement.

21:35.640 --> 21:41.640
Along with the library, we've got some sample code that shows how you can use it with a number of different vector databases.

21:41.740 --> 21:43.940
And as I said earlier, it's easy.

21:44.100 --> 21:46.600
So, the examples aren't super complicated.

21:46.600 --> 21:51.320
It's pretty easy to drop this into some code that's going to put data in one of these vector databases.

21:51.880 --> 21:56.980
The library is written in Rust, but we've exposed it in Java, Kotlin, and Python.

21:56.980 --> 21:59.700
We've got some more language support on the way.

22:00.900 --> 22:13.900
Along with the examples, we've got some results of using this on some output of different LLMs, open source LLMs.

22:13.900 --> 22:23.120
And you can see for an approximation factor of one and a half, which is a pretty modest one, we don't impact the search performance.

22:23.120 --> 22:27.660
We measured precision and recall loss, which are pretty common measures of search accuracy.

22:27.660 --> 22:30.640
It didn't really impact the search accuracy much at all.

22:30.640 --> 22:32.980
So, you know, it works.

22:35.800 --> 22:41.620
So now, once we've encrypted these vectors, suppose we want to run an attack on them.

22:41.620 --> 22:45.140
We're going to run one of the inversion models that Patrick was talking about.

22:46.080 --> 22:51.720
So, we know exactly, somehow we know exactly what the embedding model was that was used.

22:51.720 --> 22:59.420
It was an open source one, so we don't have to... we train this up once, and it's going to work on every embedding that was generated by that embedding model.

22:59.640 --> 23:02.220
But we're going to try to run it on the encrypted vectors.

23:02.220 --> 23:15.880
It turns out, because we've done the perturbation, and we shifted around all of the elements, it's mostly gibberish that we get out.

23:15.960 --> 23:20.620
So, you really can't tell much about them.

23:21.760 --> 23:39.160
Even if somebody knows the plain text, and they have a black box access to the model, and they're going to submit vectors, get encrypted vectors out for a particular key, and they're going to train their own inversion model, the randomization makes that so that it's very difficult,

23:39.160 --> 23:41.820
and you get a lot less valuable results.

23:41.820 --> 23:43.760
You might get a little bit of the meaning.

23:43.760 --> 23:45.700
You're not going to get exact words.

23:47.540 --> 23:55.500
And if you... and again, it depends on what value you use for that approximation model.

23:56.020 --> 24:01.040
If you knew the plain text, and you knew the ciphertext, can you extract the key?

24:01.040 --> 24:02.020
No.

24:02.140 --> 24:09.460
It's based on a probabilistic random function that's essentially like a 256-bit keyed hash.

24:09.460 --> 24:17.120
And I don't know about you, but I don't want to spend my next two billion weekends trying to brute force attack a 256-bit keyed hash.

24:17.360 --> 24:21.700
So, I'm going to turn it over to Patrick, and he'll summarize for you.

24:25.060 --> 24:42.960
Okay, so the takeaways that we hope you have here, as we just did a real brief fast run through on what this is and how it works, is first and foremost, you should walk away realizing that RAG produces a lot of copies of data.

24:42.960 --> 24:56.600
So, if people are using AI and LLMs in their applications, and somehow that they're operating over data that model wasn't trained on, probably they're doing this and probably lots of copies of that data are being made.

24:56.600 --> 24:58.180
It's sprinkled everywhere.

24:58.180 --> 25:02.220
And vector databases are like a key part of that.

25:02.380 --> 25:12.220
Second thing is that vectors and vector databases can be inverted back to their original input or something very closely approximating it, right?

25:12.880 --> 25:18.000
High fidelity and low effort attack, and oftentimes an attacker won't even need to do that.

25:18.000 --> 25:20.900
If they have access to the chat app, they can bypass that even.

25:20.900 --> 25:26.540
But never mind, if they have access to the vector database, that's as good as having access to the chat app, right?

25:26.940 --> 25:30.940
And then the third takeaway that we want you to walk away with is this.

25:30.940 --> 25:39.780
It isn't that hard in this case, because there's a built open source library to implement a solution to this problem in your software.

25:39.780 --> 25:45.040
So, if you want to, feel free, check out the results, go try it online.

25:45.900 --> 25:50.880
The results you get in a vector search are really close to the original.

25:50.880 --> 25:53.780
Like, it looks the same to me pretty much across the board.

25:53.780 --> 25:56.040
The benchmarks show a few percent differences.

25:56.040 --> 25:58.000
There's almost no performance penalty.

25:58.060 --> 26:04.920
From a latency perspective, there's almost no reason not to encrypt your vectors if they contain sensitive data in them.

26:05.580 --> 26:06.620
And that's it.

26:06.720 --> 26:07.880
Thanks for your time today.

26:07.880 --> 26:13.720
We're going to be out there, probably just outside the Creator Stage area, if people want to chat with us or have any questions.

26:13.840 --> 26:14.720
Thanks for your time.

