Is there a cryptographic algorithm that can 'pack' a bunch of strings/numbers and "confirm" if a string/numbers exists (later in the code) while keeping the output hidden?
For example, I have algorithm X, to which I can run something like:
// From Alice's side algo1 = new X(key); algo1.pack(100) algo1.pack(200) algo1.pack(300) algo1.finalize() print(algo1.output) // Prints a bunch of random bytes //Later, somewhere in Bob's code algo2 = new X(key, algo1.output); algo2.has(111) // false algo2.has(222) // false algo2.has(100) // true algo2.has(200) // true
I do realize this can be done with an encrypted database, but I am searching for a solution in an algorithm.
The purpose is data hiding: in case
algo1.output as well as
key are revealed to an attacker, they would still have to know the values in the set to get a truthful answer (
300 in the case above), which would protect the integrity of those values, even if the
algo1.output are revealed
They would then have to rely on brute-force methods to extract those values, which could make it expensive for the attacker.