Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Ok, I hope this question makes some sense because I am not so sure how to word it any differently… Imagine the following situation:

  • There are 10 defined colors (blue, orange, yellow etc.)
  • There are 2 Persons and each of them has 1 favorite, secrete color
  • The 2 persons don't know each other's favorite color, however, they want to know if they share the same

My question: How can they do a comparison without exposing their own favorite color to the other person (or to anyone else!) in case they do not match?

Or, to explain the problem with other words: Person A should only know the favorite color of Person B if they share the same. Hence, the result of the comparison must only be True or False.

My first thought was: Every person could simply create a hash of their favorite color using the same hash algorithm (MD5, SHA etc.) and then they can compare the hashes. But obviously, that doesn't work, because it’s easy to find out which hash belongs to which color.

Is there a solution for such a use case? Any help would be highly appreciated.

share|improve this question
2  
I think private set intersection should be what you are looking for. –  Maeher Apr 30 '13 at 21:16
2  
That's way more complicated that what's needed for his situation. $\hspace{2.2 in}$ See $\:$ en.wikipedia.org/wiki/Socialist_millionaire . $\;\;$ –  Ricky Demer Apr 30 '13 at 21:40
    
@RickyDemer, post that as the answer, because it's the answer. –  John Deters Apr 30 '13 at 21:45
add comment

2 Answers

That sort of thing is known as multi-party computation, and you
should use a Socialist Millionaire Protocol for your particular instance.

share|improve this answer
add comment

Comparing data sets can also be done using "order preserving Encryption" techniques

share|improve this answer
1  
There is no order in a privacy preserving set intersection protocol. Only equality –  curious Jun 10 '13 at 9:36
    
so this answer is wrong? –  Mike Jul 1 '13 at 0:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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