What is a protocol for determining which of two numbers is larger, without sharing those numbers? Situation: Alice has selected a positive integer $a$, and Bob has selected a positive integer $b$. Alice and Bob want to know whether $a &gt; b$, $a = b$, or $a &lt; b$, but neither wishes to reveal their chosen number to the other party. 

How can Alice and Bob make this determination?
As pointed out by Luke Mathieson in the comments, this problem is called Yao's Millionaire Problem, for which protocols can easily be found by Googling.