I need some crypto operation for matching data privately between two peers (let say Alice and Bob). Alice should be able to encrypt her data with Alice and Bob public keys and pass the cipher text to Bob. Bob could not decrypt the cipher text but could match it with the same cipher text produced on the Bob side. As a result Alice and Bob will know which source messages have both of them.

So I am looking for asymmetric cipher which allows to change the order of encryptions providing the same cipher text (I suppose it is called commutative). So given $M$ - plain text message, $pub_1$ - first public key, $pub_2$ - second public key. I need the crypto function $F(message, pubkey)$ with such property:

$F(F(M,pub_1), pub_2) = F(F(M,pub_2), pub_1)$


1 Answer 1


Rather than using a commutative encryption scheme, I'd suggest looking at private set intersection. From the description in your first paragraph, it sounds like that's what you're looking for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.