Lecture on database encryption as the last line of defense: encryption levels, key management challenges, search limitations, and securing outsourced databases.
Key Takeaways
- Database encryption is the last line of defense and should be layered on top of other security controls.
- Encryption improves protection for outsourced databases but complicates key management and searching.
- Client-side encryption keeps keys away from the hosting provider, so a server breach exposes only ciphertext.
- Choosing encryption granularity (whole database, columns, rows, or specific values) involves a tradeoff between security and query flexibility.
What the video covers
- The lecture frames database encryption as the final layer of defense after file, system, network, and application protections are bypassed.
- Key management is a major challenge: distributing and maintaining separate keys for different departments and individual users becomes harder as user numbers grow.
- Encrypted data lacks flexibility; searching for partial values (e.g., names starting with 'A') is not possible because encrypted blocks differ even when plaintext starts the same.
- Encryption granularity options include encrypting the entire database, specific columns, specific rows, or specific values at the intersection of a column and row.
- Organizations outsource databases to hosting providers for storage capacity, specialized staff, continuous maintenance, and disaster resilience.
- Outsourcing introduces security concerns, since a hacked provider server could expose all data, and costs and trust issues arise.
- The proposed solution is client-side encryption: the data owner encrypts data before sending it, keeps the keys off the server, and receives encrypted results back.
- Client-side encryption makes server-side search and processing difficult; the client must decrypt locally, which makes searching complex.
- Index and partitioning techniques are discussed as ways to allow range or partial queries over encrypted data, with the server returning only needed results.
- The architecture involves four components: the database, the user requesting data, the client that handles encryption locally, and the server hosting the database.
Chapters
- 00:00Introduction and Overview of Database Encryption
- 01:02Database as the Last Line of Defense
- 02:21Drawbacks and Key Management Problems
- 04:30Encryption Levels and Granularity
- 05:37Outsourcing Databases to Hosting Providers
- 08:00Client-Side Encryption and Server Architecture
- 12:00Searching Encrypted Data and Indexing Solutions
- 25:20Access Control and Summary of Components
Full Transcript — Download SRT & Markdown
Speaker A
In the name of God, the Most Gracious, the Most Merciful. Welcome to section 5.6.
Speaker A
We previously talked about inference, and before that, we talked about—well, today, God willing, we will talk about what?
Speaker A
We will talk about what it means to store—to encrypt databases. Once I reach database encryption, it means I have reached my last line of defense. Let’s assume the attackers were able to bypass all my protection layers . Up until they bypass my database
Speaker A
protection layer. For the database, I need a final layer of protection. So, the final layer of protection and my last line of defense will be what?
Speaker A
We will talk here about the different levels of encryption. What are its drawbacks? What are the problems we face with it, how do we maintain it while we are working on it, and why do we even need to perform it?
Speaker A
How do we make the data on the database random so that no one can perform any analysis on it, okay?
Speaker A
Well, the database is essentially what? The last line of defense. If they bypass those four, they will reach what?
Speaker A
I want to keep the database encrypted. Historically, it is our most valuable information asset, right?
Speaker A
It has value to us in the organization. Well, to protect it, I must put in place several layers of protection; the first layer is the...
Speaker A
logging into the system. At all its levels: at the file level, the system level, the network level, and the application level, okay?
Speaker A
In some types of systems, like the database, I need to do what? Add an extra layer of protection.
Speaker A
Exactly, if all previous layers fail and they manage to reach the database, I want it to be an unreadable database for the attacker, so they cannot benefit from it.
Speaker A
Well, what do we have? I have encrypted the data. What problems or disadvantages do we have with this?
Speaker A
It says: our disadvantages are... It protects the data, but we have encryption keys. How do I handle the encryption if I have different types of data?
Speaker A
For example, HR program data has a key, marketing program data has a key, and finance department data has a key.
Speaker A
Exactly, I have a key for every user. How do I perform...the distribution of ...
Speaker A
these keys among the users? How do I manage it? This is one of the problems of...database problems.
Speaker A
So, the process of distributing keys securely...between the database and the user is a complex process.
Speaker A
Exactly, that every user gets their own private encryption key. Exactly, it will get harder and harder if we have many users.
Speaker A
Exactly. Well, what else do we have? Which is the lack of flexibility; why is there a lack of flexibility?
Speaker A
I mean, if I want to search in an encrypted database, how do I search for the name "Ahmed" inside the database? Or how do I search for a name starting with the letter "A" inside the database? Our encryption blocks are different, even if
Speaker A
the first letter is the same. Therefore, I cannot search inside an encrypted database; I need to find solutions for this, and consequently, we have a lack of flexibility.
Speaker A
It becomes more complicated. Well, what are my database encryption levels? It tells me there are four levels of encryption. I can encrypt my entire database at once, the database is encrypted completely.
Speaker A
Or maybe it tells me to encrypt what? Specifically in what? In my database, I could encrypt something specific in my database, I could come and tell it only this value, I have a table, right?
Speaker A
I have this table, I come and tell it to encrypt only this specific value in the table, okay? So we have encryption; either I encrypt the whole database, or I encrypt specific columns or rows in the database, or I encrypt entire
Speaker A
columns in the database, or I encrypt a specific what, which is? The intersection of the column with what ? With the row, what do we call this?
Speaker A
Okay. Well, we have a term called What does it mean that I don't keep my database on a device I have in the company no.
Speaker A
It tells me my device, my database, I want to keep it hosted on any server, what do we call this?
Speaker A
Well, my question here is, as long as the database is outside my organization , does that mean the database has become vulnerable to hacking?
Speaker A
Why do companies and organizations go to do our, who can tell us? Companies want to go to because, simply put, my needs what, what? It needs a combination between It needs high storage, okay?
Speaker A
It needs specialized staff to manage what for me? The database, it needs continuous maintenance, it needs me to protect the database from, let's say, for example, here in Gaza we have bombing, okay? If the building is bombed, what do we do
Speaker A
about the database in this case? So I need, okay? We have with the, and before the, every day the companies that produce the discover that we have new vulnerabilities, so I constantly need to create and update the security policies
Speaker A
we have, okay? So the option we have is what? Okay? So I have outsourcing, I can do it, I don't have to say, "Oh, hard drives aren't entering through the crossing," no, I increase the space online, okay?
Speaker A
It needs, which is With a staff that is what? A qualified staff, okay? The company you are hosting with helps you with the maintenance process.
Speaker A
You, the company itself is responsible for keeping Which is, all the time, okay? So you, what? Ease yourself from all these stories, so we have what?
Speaker A
Okay? So which is Well, who are the companies that go to Small or medium-sized companies go to what?
Speaker A
Large companies have the option to do or not, to keep the data stored with me, present at whom?
Speaker A
Of course, like any concept we have, it has advantages and disadvantages, what are its advantages?
Speaker A
My database is stored far away from where I am, and therefore, if a disaster happens where I am, the place is hit, the power is cut off, my database keeps running because the company responsible for this will have what?
Speaker A
It has very high. From anywhere in the world, I can access my database and edit it.
Speaker A
My responsibility is no longer, "Oh, change the server power, increase the server's hard disk." So, if we put in a new hard disk to replace the old one, what problems will we face? What happens to this whole situation?
Speaker A
It is no longer my responsibility, it becomes only my logical responsibility. So, what do we have? Security concerns.
Speaker A
If someone hacks the online server, they could see all the data. And consequently , that becomes a problem.
Speaker A
Perhaps some form of snooping; they could access the data. Now, if I want to prevent this, how do I solve it? Solve it through whom?
Speaker A
Exactly, that is the idea. Which is the high costs of operating. What? But he wants to ensure what?
Speaker A
How? Through whom? Which is encryption. Right. So, to solve the problem of... ...in, I need to encrypt everything.
Speaker A
Right. Well, who has the keys? What will he do? He will encrypt the entire database. He performs the encryption.
Speaker A
He will take the ciphertext or the encrypted database and return it to the server.
Speaker A
If the server gets hacked, who will they see? Encrypted text. Well, since he doesn't have the key, he won't be able to decrypt the data. Right.
Speaker A
So, who will continue to hold? The encryption and decryption keys. So, I send encrypted text and receive encrypted text from.
Speaker A
So, I must encrypt the data before sending it to, who is? Because I am the server I am hosting with.
Speaker A
So, the encryption and decryption keys must be with whom? Not present on whom? On the server.
Speaker A
Do not give these out at all. In that case, if they manage to reach the server and reach the data, they will see encrypted data. And consequently, they won't be able to do anything to me . Now, what do we have?
Speaker A
Quite simply, encrypted data; how do I search through it as who? I won't be able to search it. I would have to bring the data to my local device and decrypt it to be able to search through it, so the search process
Speaker A
through the data will be what? A difficult and complex process. When my entire database is encrypted as one block, the service provider cannot decrypt or search it, but if the user requests only one record from this, what happens to him?
Speaker A
He won't be able to access the data, so he needs to download the data to his machine, decrypt the data, and then search the data to reach the information he wants, right?
Speaker A
Right, so as we said. He cannot do it, but for me, in order to perform a search in, it will be and consequently I need to download my entire, then I must decrypt the, my, what?
Speaker A
Decryption must be, what? So that afterwards, I start the process right? Well, and what I do.
Speaker A
Right? In this case, I have four entities that will deal, they will deal with the, entities do not necessarily mean who?
Speaker A
Individuals. Right? First thing we have is who? Which is who? The real owner of the database, which is my company, will generate data for me, encrypt the data, and control the data, okay? 100%. I have the person who will send to whom?
Speaker A
To the [database] which is located where ? On the server, right? So we have the second type of entity, which is who? The person who will send the data will send the data correctly.
Speaker A
Okay? This could be an employee within the organization, okay? Inside the organization or someone from outside the organization that I have given specific access to the database.
Speaker A
The third one, which we have, is who? The...I am working on data on the server , so we have a server.
Speaker A
The client will be the front-end that will... Convert it into a query and send it to whom?
Speaker A
In an encrypted format to send it to whom? To the server, and that is who for us?
Speaker A
Who do we have? The server, which will receive and store it, and send it to the client when they request it. So, I have what is the company.
Speaker A
We have the user who will request data, or modify data, or store data. We have the client that will receive the query from them, okay. If there are things that need encryption, things that need...it will handle them locally, then
Speaker A
send the encrypted data to whom? To the server, okay. It will receive the encrypted data from the server and decrypt it. After it decrypts it, what will it do? It will deliver it to whom then? To the user, okay.
Speaker A
We will have, as we said, we have... okay, the company encrypted the data it has, and the database, it encrypted them and sent them to whom? To who is that?
Speaker A
The server. The server has...it will receive data from whom? It will receive data from the client, it will send it data, it will receive the results from it, it will decrypt it or encrypt it.
Speaker A
For the user, okay. It tells me I can, for everything inside my database, what do I do? Encrypt it separately. Take the first attribute, encrypt it, and store it. The second attribute, encrypt it, and store it. The third, store it and encrypt it. Okay,
Speaker A
everything inside the database I will encrypt separately. Okay, the server does not have the key.
Speaker A
Which means the encryption/decryption key, it does not have it. Well, what do we have? If it reaches the database, it won't be able to know anything, we have who?
Speaker A
However, we have the issue that encrypting every value individually is an operation that is what?
Speaker A
Burdensome, okay, and an operation that takes time, okay. Well, how do I retrieve my data if I have encrypted it ? It tells me I want to retrieve my data via whom?
Speaker A
The first thing you do, who is the first one that will work? The one we encrypt that is on the database.
Speaker A
So the first thing we have is the user will request, "I want specific data," and they will send.
Speaker A
With their [parameter] to the server, assuming my [data] is what? Encrypted. It will come, which is for example my program will encrypt, which will encrypt , okay, with the key.
Speaker A
We encrypted it, then what do you do? It will perform...my [query] will be sent to the server, but the key, which is my [key], is what? Encrypted.
Speaker A
The server will execute it, it will find one field, it will find one that contains whom?
Speaker A
The data related to... Okay, what will I do? It will send the data to...the server will send the other data to whom?
Speaker A
To the client. It will receive the data , it will perform...after it performs ...it will go and display it to whom? To the user. In the end, the user will see whom? So, I have the user typing.
Speaker A
The client will encrypt the input, okay . After encrypting, encrypted, what comes next. It will send the data to the server.
Speaker A
It will return the encrypted data to me . The client will process the data. And it will deliver the unencrypted data to whom? To, I will deliver the unencrypted data to the user.
Speaker A
For example, he says he wants the one with number 15, I put it into the encryption algorithm and represented 15 for me like this, and found who?
Speaker A
So, first of all, what did I receive? I took 15 and encrypted it with my encryption, okay, it showed its result after I encrypted it, I sent it, I want to perform, so I sent it like this to
Speaker A
whom? To the server. The server receives the data, it will go and search in my table for the column whose ID value actually equals who? This value, I found who? My record, I take the record and send it to
Speaker A
whom? To the client, the client will decrypt the data and display it to whom ? To the user.
Speaker A
He tells me in case I encrypted my data , if I told you to get me the employees whose salaries are less than 70,000 dollars, you won't be able to work, why ?
Speaker A
Because the encryption process will not produce who? Sequentially ordered numbers, because if it produced sequentially ordered numbers, our encryption process would become And it wouldn't be useful, it became a very weak process, okay, and therefore I cannot search in a range.
Speaker A
I can only search for a specific value. And the value must be complete, not a part of the value. Okay? So this is a problem for whom? Or in Okay, he tells me what we will do here, he says
Speaker A
He says encrypt it for me as one block instead of taking the items of the and encrypting them, how do we do this?
Speaker A
He says we will take our, we will convert the data, for example, to values of zeros and ones, we will aggregate the data of each field, meaning the first field we got 101, suppose the second field 111, the third field 110, okay, we
Speaker A
collect the fields next to each other, we have now who? A group of bits stuck to each other, this group of bits for the whole, what will I do?
Speaker A
I will consider it my block, I will encrypt it using whom? Okay? Okay, what did we just do?
Speaker A
We converted them into bits, we have a block, we processed them, we have a block, we encrypted the block, we have now who?
Speaker A
Full encryption of the, and not, okay, in this case, how do I want to search through this database?
Speaker A
We can no longer search by the field itself, the solution, he says the solution here is we will use instead of that, we will start using, okay, which is like indices, these indices we will add to help us in the process of who?
Speaker A
Searching as we will see ahead, okay? The tables a little while ago because we encrypted them completely, we will do So for what?
Speaker A
It supports the process of whom? So every row, since it has become encrypted, we need a method to help us, we said a method is for the records which is who?
Speaker A
We will make non-overlapping Meaning I want to tell it the values from 1 to 100 give them one, from 101 to 200 give them number two, it is not okay for me to come and say from 100 to 200,
Speaker A
why? It will happen, so it must be what ? Like one and two Okay? He says which is What does this do? It allows the server Which is where I expect to find my data without having to do what to whom?
Speaker A
To the database as a whole. The [index/partition] might represent for me, or mean values from one to a certain [range] of data, but not what?
Speaker A
The actual data, meaning I have one, for example, it will be one, two, three, four, and five, okay? And so on, okay.
Speaker A
So, I am dividing it. This [index] gives each one of them a value, okay, which subsequently makes it what for us?
Speaker A
Okay. Well, for example, as we said, from one to 200. From 201 to 400, it gave it two, and so on; we now have five divisions for what ? For [the index], so instead of returning 1,000 records and processing
Speaker A
them, I only return 200 records and process them, which is what? In this case, I return 200 records and process them, which is what?
Speaker A
In this case, okay, well, this is regarding what? Regarding the [data], I then divide it based on what? I tell it, for example, A and B are one, C and D are two, E is [ three], and so on, okay? The same idea
Speaker A
that happened where? In the partitioning okay. What will the table look like for us?
Speaker A
For example, the [values] were 23, 200, and 360, this is what? The base table, okay? Now, 23 will take the value of one , 800 and 800 will take the value of five, 300 will take the value of two
Speaker A
because the ranges are from one to 200, from 201 to 400, and so on, okay?
Speaker A
See how they turned out when we did them , look: one, five, two, five; the next when I did the [encryption] for the [ table], it became 10 five and 10 seven, two fives, and thus, based on what? On
Speaker A
the [index] I created, I ended up with an encrypted table, and I got the encrypted value for the whole row, here are the [indexes] that will help me in the data retrieval process, they are here where?
Speaker A
They are here, and thus in searching, instead of returning a huge amount of data to decrypt it and find the result I want, I return a limited part of the data okay?
Speaker A
Well, how will we return the data using [the index]? It tells me, first thing, he will write his query and send it to whom?
Speaker A
The [server] will do [a search] inside [ the database] with the [index] it has, okay, it performed and identified which are the [values], it does it using what ?
Speaker A
After the query made to whom? To the server, using the server it will search in what?
Speaker A
In the encrypted row or in the [index], it will search in the [index], okay?
Speaker A
It will see which row matches this [ index], so it sends us a group, okay?
Speaker A
This group of rows, I will decrypt them all, then I will perform [a filter] inside the rows after decrypting them to see who actually meets my [criteria] and who does not; whoever meets it I take, and whoever does not I [discard], after
Speaker A
that I return which results to whom? To the user. The unencrypted results to the user okay?
Speaker A
Okay. It tells me, now the [indexes] we put are one, two, three, four, five.
Speaker A
Sorted. It is possible for me, [the attacker], to reach this, so he starts to understand. He starts to understand things about my database.
Speaker A
Meaning he might understand that the indexes improve my response speed, the retrieval speed. But it will cause a problem for him.
Speaker A
That the attacker starts to understand data. He will understand that, for example, the employee whose salary is one is in the first category. Its primary key two is located in the second one. Okay. He will start to understand
Speaker A
data from my encrypted database. And it might help him in the decryption process . So, what is our solution?
Speaker A
He said the solution is to do what? Meaning the one to 200, its primary was one. I made it two. The two is three.
Speaker A
Three is five. Okay. I am doing, therefore, in this case. Even if he read the, he won't be able to actually understand. Two comes before, for example. The one comes before the two, right? But it is actually the one that
Speaker A
came after. So what about the five? Okay . So we have what? So we have, therefore, the attacker cannot know the original order of our data, and so we have what?
Speaker A
How can we improve this scheme? And how can we improve the database process we talked about a while ago?
Speaker A
He says we can improve it in two ways. My primary key, to facilitate the search process in it, he says I want to go and encrypt it specifically on its own, or make it okay. Therefore, when I want it
Speaker A
, I reach it directly without having to search in what? In other indexes for it okay.
Speaker A
Thus, I can return the separately, without returning a group of this stuff okay. So the first thing is that, or the process.
Speaker A
This is to improve. I encrypt all the different parts of the database with different keys.
Speaker A
Thus, the user cannot decrypt anything except the fields or parts for which they have the decryption key, okay.
Speaker A
He tells me I could have keys. When we use multiple keys, okay, it encrypts multiple parts of the database with different keys. So what happens then? Every user must have only the keys appropriate for them. Meaning, an HR
Speaker A
employee has the key for, let's say, the salary table. The sales employee does not have the decryption key for the salary table, okay. Thus, he cannot read it even if the data is with him, okay.
Speaker A
Therefore, each key will be linked to an authorization. Meaning, every part of the database is encrypted with a different key. Each user has their own private keys, their own decryption keys.
Speaker A
Each user can only access the data for which they have the encryption keys, and which they are authorized to access.
Speaker A
And thus we have what? Integration between it and what? Between that which is. Okay.
Speaker A
Thus, the basic idea we have here is that database encryption works together to protect the sensitive data in the database.
Speaker A
Okay great. A summary of what we said. It is the last line of defense for the database. It has many, for example, that we don't have.
Speaker A
We don't have a search. We don't have in it. Okay. We talked about. Because of it, we have companies that don't have the staff and capabilities qualified to host their database locally .
Speaker A
We have some organizations where it would be very dangerous to keep the data locally, and when it happened, we had problems what?
Speaker A
We said we have four components: the database, the user requesting information which will be sent to the server, and the fourth is the server itself.
Speaker A
We talked about what happens if the database is fully encrypted; how can I access and retrieve the data without retrieving the entire database just to search for one or two records?
Speaker A
I retrieve the record and decrypt it instead of decrypting the entire database. Then we talked about how we encrypt different parts of our database with what?
Speaker A
With different keys based on what? On the permissions you have. With that, we have finished Section 5.7.
Speaker A
Yeah.
Topics:database encryptiondata securitykey managementencrypted searchoutsourcingcloud databaseclient-side encryptionaccess controldata center securityKerberos











