# Algorithm Design for only Mutual Information Sharing

Bob and Alice each have a bit string they want to keep private. They each want to know what the bitwise AND of their two strings would be without telling the other or anyone else listening to their exchange their actual bit strings... how can they do this? Keep in mind that even once they both hold the AND of their two bit strings, they should still not be able to calculate the other person's string exactly (unless of course one of their strings was all 1s).

I know that I have seen something similar before in some sort of mutual key system/voting system but I couldn't remember where. It has to be something like make a private random key, xor it and use that somehow... but I couldn't work out the details. Any clever encryption design people out there?

• I've been wondering about similar questions for a long time. We can ignore the question of the eavesdropper, since any solution that allows $A$ and $B$ to exchange the right amount of information can be encrypted more or less unbreakably with the usual methods so that an eavesdropper gets no information at all. The tricky part is making sure that $A$ doesn't find out any of the bits of $B$'s string where the corresponding bit of $A$'s string is 0.
– Mark Dominus
May 16, 2012 at 0:23
• right because of course A will know exactly the values of B's string at any locations where A has a 1 May 16, 2012 at 0:24
• My own favorite question of this type is whether $A$ and $B$ can learn how many 1 bits there are in the XOR of their strings without learning anything else about the other person's string. (I don't know.)
– Mark Dominus
May 16, 2012 at 0:29
• I'm going to migrate this question to the cryptography.SE site, where it will be merged with the version of the question you asked there. Please note that posting a question on multiple sites at once is very discouraged. If your question doesn't have much success at cryptography.SE, then you can have a cryptography.SE moderator move it here.
– Zev Chonoles
May 16, 2012 at 2:25
• ok thank you. I wasn't aware about the multiple site policy and I will be more careful in the future. May 16, 2012 at 2:28