# 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 asked this on Stack Overflow and got yelled at to move it here. Not really sure how to tag it either if anyone knows what it would fit under better please feel free to edit. 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 '12 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 – hackartist May 16 '12 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 '12 at 0:29
– Zev Chonoles May 16 '12 at 2:25
ok thank you.  I wasn't aware about the multiple site policy and I will be more careful in the future. – hackartist May 16 '12 at 2:28

## 2 Answers

Aaron Roth on theoretical CS was kind enough to answer with the following answer for anyone out there who is interested.

What you want to do is called "Private Set Intersection". You can think of Alice and Bob as each holding sets (the indices for which their strings are "1"), and they want to compute the intersection (the bitwise AND) so that neither of them learns anything about the other's set except what is implied by the intersection itself.

This problem is well studied. See, for example, Freedman, Nissim, and Pinkas: http://www.pinkas.net/PAPERS/FNP04.pdf

-

Garbled circuits might be a good way to do this. There are plenty of libraries that will allow you to do garbled circuits easy enough. The two that come to mind are Fairplay/FairplayMP, or a more updated system done by the University of Virginia.

The advantages of these systems over the paper you referenced is that they don't use Public-Key crypto, so they should be faster. If you go with the UVa system, I would expect your performance to be similar to their results on the hamming distance.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 7, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9628862142562866, "perplexity_flag": "middle"}