Is it possible to know if two encrypted values are the same? #508
Replies: 2 comments
-
Hi! If I understood correctly you want to be able to determine if two ciphertexts encrypt the same value based only on public material (and the ciphertexts). If so, it is not possible to achieve this with the schemes commonly used for FHE that are IND-CPA secure. The reason is quite simple, if it was possible one could distinguish To solve your problem, it looks like you need to use deterministic encryption (that has weaker security) or consider using trapdoors (e.g. using the notion of public-key encryption with equality test: https://eprint.iacr.org/2016/1182.pdf). In short, no it is not possible using the schemes in lattigo as intended. I hope it answers your question. |
Beta Was this translation helpful? Give feedback.
-
What @lehugueni said is correct, but I guess what @yusufozturk is trying to do is encrypted data dependent branching. This is possible with FHE, but the branches need to be rewritten as arithmetic circuits, for example the branch if x > 3{
y = f(x)
}else{
y = g(x)
} must be rewritten as y = (g(x) - f(x)) * (0.5*sign(x-3)+0.5) + f(x) |
Beta Was this translation helpful? Give feedback.
-
With this library, is it possible to know if the two encrypted values (created with the same secret key) are equal by using public key? Server side will do the equality check by just knowing the public key of the encypted values. (Or is this not possible?)
I just need a simple function:
func IsEqual(evaluator *heint.Evaluator, a, b *rlwe.Ciphertext) (bool, error)
I see some topics and responses from the past, still can't figured out how to do this.
Beta Was this translation helpful? Give feedback.
All reactions