So lets say you want to outsource your database to a third party and be able to query on it on their server
but you want to “encode” the salary column of the users on their server, aka hide the real value from that third party, in a way that you can still query it on that and decode the result
for example one approach is making salaries between 100-200 map to 20 and 200-300 map to 10
the problem with this approach is that when i want to get someone with the salary of 230, the where clause changes to where salary=10, and this might map to many people and the result wont be correct, or where salary>120 turns into where salary=20 or salary=10
so basically i have to have a one to one mapping function that is still quaryable on the server and be able to decode the result
so how will you change the salary values in a way that i can still put a meaningful thing in the where clause that corresponds to that, and be able to decode the result?
obviously just adding something to it is not good, because this way they can still know who has the biggest paycheck, you have to change it in a way that they cant get any info from it, or just adding the numbers together wont work since there might be collusion