This might be a dumb question but I will go for it. Let's say we have a data set $D$ consisting of sensitive data, and we want to be able to match if a new piece of data $S$ already exists in $D$ ($S\stackrel{?}{\in} D$) or not, and we want to be able to know which of the entries matches $S$ in $D$. Our approach consisted of a 1-way cryptographic hash such as SHA256. However, since the dataset is relatively small (about 4 million rows) we can easily reproduce the full dataset and in effect "decode" the original meaning of the hash. So I was wondering if it exists and algorithm that takes two parameters * $d$: some sensitive data and * $s_i$: a random salt $i$ a cryptographic algorithm $C$ and a comparator $M$ such that $M(C(d, s_1), C(d, s_2)) = \text{true}$ So does such an algorithm or anything similar exist?