Socialist millionaire
The Socialist Millionaire Problem[1] is one in which two millionaires want to determine if their wealth is equal, without disclosing any information about their riches to each other. It is a variant of the Millionaire's Problem[2][3] whereby two millionaires wish to compare their riches to determine who has the most wealth, without disclosing any information about their riches to each other.
It is often used as a cryptographic protocol that allows two parties to verify the identity of the remote party through the use of a shared secret, avoiding a man-in-the-middle attack without the inconvenience of manually comparing public key fingerprints through an outside channel. In effect a relatively weak password/passphrase in natural language can be used.
Contents |
[edit] Motivation
Alice and Bob have secret values x, and y respectively. Alice and Bob wish to learn if x = y without allowing either party to learn anything else about the other's secret value. A passive attacker, simply spying on the messages Alice and Bob exchange learns nothing about x and y, nor even if x = y. Even if one of the parties is dishonest, and deviates from the protocol, he or she cannot learn anything more than if x = y. An active attacker, capable of arbitrarily interfering with Alice and Bob's communication (a man-in-the-middle) cannot learn more than a passive attacker, and cannot affect the outcome of the protocol other than to make it fail. Therefore, the protocol can be used to authenticate whether two parties have the same secret information. Popular instant message cryptography package Off-the-Record Messaging uses the Socialist Millionaire protocol for authentication, in which the secrets x and y contain information about both parties' long-term authentication public keys, as well as information entered by the users themselves.
[edit] Procedure
All operations are performed modulo a prime p, or in other words, in the multiplicative group
. Let g1 be a generator of the group (any element other than 1, noting that 0 is not an element of multiplicative groups). The values p and g1 are agreed on before the protocol, and in practice are generally fixed in a given implementation. For example, in Off-the-Record Messaging p is a specific fixed 1536-bit prime. All sent values include zero-knowledge proofs that they were generated according to this protocol, as indicated in the detailed description below.
Assuming that Alice begins the exchange:
- Alice:
- Picks random exponents a2 and a3
- Sends Bob
and 
- Bob:
- Picks random exponents b2 and b3
- Computes
and 
- Computes
and 
- Picks a random exponent r
- Computes
and 
- Sends Alice g2b, g3b, Pb and Qb
- Alice:
- Computes
and
- (g2 and g3 have effectively been negotiated via the Diffie-Hellman key exchange.)
- Picks a random exponent s
- Computes
and 
- Computes

- Sends Bob Pa, Qa and Ra
- Computes
- Bob:
- Computes

- Computes

- Checks whether

- Sends Alice Rb
- Computes
- Alice:
- Computes

- Checks whether

- Computes
The correctness of this algorithm (but not its security) can be shown by simply representing all values in terms of the inputs x, y, and g1, and the randomly generated values a2, a3, b2, b3, r, and s:
Assuming x = y, then
, and therefore
. The same logic holds to show
. Therefore,
Similarly expanding
reveals that the values of Rab that Alice and Bob generate are identical. Finally, examining the equation being tested by Alice and Bob shows that the algorithm works:
As the last equation given above holds only if x = y, and as it is equivalent to the first equation, the tests Alice and Bob perform of
are therefore equivalent to testing x = y, completing a proof of correctness.
However, as written above the protocol is vulnerable to poisoning whereby either Alice or Bob chooses (a2, a3) or (b2, b3) to be zero to be able to predict the result [1]. To solve this problem, check that the pairs (g2a, g3a) and (g2b, g3b) are not equal to one.
[edit] See also
[edit] References
- ^ A. Yao (1982). "Protocols for secure communications". Proc. 23rd IEEE Symposium on Foundations of Computer Science (FOCS '82). pp. 160–164.
- ^ "How to generate and exchange secrets". Proc. 27th IEEE Symposium on Foundations of Computer Science (FOCS '86). 1986. pp. 162–167.
and 
and 
and 
and 
and
and 






