In cryptography, 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.
Alice and Bob have secret values
x
y
x=y
A passive attacker simply spying on the messages Alice and Bob exchange learns nothing about
x
y
x=y
Even if one of the parties is dishonest and deviates from the protocol, that person cannot learn anything more than if
x=y
An active attacker capable of arbitrarily interfering with Alice and Bob's communication (man-in-the-middle attack) 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
y
See main article: Off-the-Record Messaging.
The protocol is based on group theory.
p
h
p
h
(Z/pZ)*
p
(Z/pZ)*
By
\langleh|a,b\rangle
a
b
hab
ha
\left(ha\right)b\equivhab
hb
\left(hb\right)a\equivhba
hab\equivhba
(Z/pZ)*
The socialist millionaire protocol[4] only has a few steps that are not part of the above procedure, and the security of each relies on the difficulty of the discrete logarithm problem, just as the above does. All sent values also include zero-knowledge proofs that they were generated according to protocol.
Part of the security also relies on random secrets. However, as written below, the protocol is vulnerable to poisoning if Alice or Bob chooses any of
a
b
\alpha
\beta
ha
hb
h\alpha
h\beta
Pa ≠ Pb
Qa ≠ Qb
Alice | Multiparty | Bob | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Message x Random a,\alpha,r | Public p,h | Message y Random b,\beta,s | |||||||||||||
2 | Secure g=\langleh | a, b\rangle | ||||||||||||||
3 | Secure \gamma=\langleh | \alpha, \beta\rangle | ||||||||||||||
4 | Test hb ≠ 1 h\beta ≠ 1 | Test ha ≠ 1 h\alpha ≠ 1 | ||||||||||||||
5 | \begin{align} Pa&=\gammar\\ Qa&=hrgx \end{align} | \begin{align} Pb&=\gammas\\ Qb&=hsgy \end{align} | ||||||||||||||
6 | Insecure exchange Pa,Qa,Pb,Qb | |||||||||||||||
7 | Secure c=\left\langle\left.QaQ
\right | \alpha, \beta \right\rangle | ||||||||||||||
8 | Test Pa ≠ Pb Qa ≠ Qb | Test Pa ≠ Pb Qa ≠ Qb | ||||||||||||||
9 | Test c=Pa{P
| Test c=Pa{P
|
Note that:
\begin{align} Pa{P
-1 | |
b} |
&=\gammar\gamma-s=\gammar\\ &=h\alpha\beta(r\end{align}
and therefore
\begin{align} c&=\left(QaQ
-1 | |
b |
\right)\alpha\beta\\ &=\left(hrgxh-sg-y\right)\alpha\beta=\left(hrgx\right)\alpha\beta\\ &=\left(hrhab(x\right)\alpha\beta=h\alpha\beta(rh\alpha\beta\\ &=\left(Pa{P
-1 | |
b} |
\right)h\alpha\beta\end{align}
Because of the random values stored in secret by the other party, neither party can force
c
Pa{P
-1 | |
b} |
x
y
h\alpha\beta=h0=1