Socialist millionaire problem

From HandWiki
Short description: Cryptographic problem

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.

Motivation

Alice and Bob have secret values [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math], respectively. Alice and Bob wish to learn if [math]\displaystyle{ x = y }[/math] 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 [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math], not even whether [math]\displaystyle{ x = y }[/math].

Even if one of the parties is dishonest and deviates from the protocol, that person cannot learn anything more than if [math]\displaystyle{ x = y }[/math].

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 [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] contain information about both parties' long-term authentication public keys as well as information entered by the users themselves.

Off-the-Record Messaging protocol

Main page: Software:Off-the-Record Messaging
State machine of a socialist millionaire protocol (SMP) implementation.

The protocol is based on group theory.

A group of prime order [math]\displaystyle{ p }[/math] and a generator [math]\displaystyle{ h }[/math] are agreed upon a priori, and in practice are generally fixed in a given implementation. For example, in the Off-the-Record Messaging protocol, [math]\displaystyle{ p }[/math] is a specific fixed 1,536-bit prime. [math]\displaystyle{ h }[/math] is then a generator of a prime-order subgroup of [math]\displaystyle{ (\mathbb{Z}/p\mathbb{Z})^* }[/math], and all operations are performed modulo [math]\displaystyle{ p }[/math], or in other words, in a subgroup of the multiplicative group, [math]\displaystyle{ (\mathbb{Z}/p\mathbb{Z})^* }[/math].

By [math]\displaystyle{ \langle h|a,\,b\rangle }[/math], denote the secure multiparty computation, Diffie–Hellman–Merkle key exchange, which, for the integers, [math]\displaystyle{ a }[/math], [math]\displaystyle{ b }[/math], returns [math]\displaystyle{ h^{ab} }[/math] to each party:

  • Alice calculates [math]\displaystyle{ h^a }[/math] and sends it to Bob, who then calculates [math]\displaystyle{ \left(h^a\right)^b \equiv h^{ab} }[/math].
  • Bob calculates [math]\displaystyle{ h^b }[/math] and sends it to Alice, who then calculates [math]\displaystyle{ \left(h^b\right)^a \equiv h^{ba} }[/math].

[math]\displaystyle{ h^{ab} \equiv h^{ba} }[/math] as multiplication in [math]\displaystyle{ (\mathbb{Z}/p\mathbb{Z})^* }[/math] is associative. Note that this procedure is insecure against man-in-the-middle attacks.

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 [math]\displaystyle{ a }[/math], [math]\displaystyle{ b }[/math], [math]\displaystyle{ \alpha }[/math], or [math]\displaystyle{ \beta }[/math] to be zero. To solve this problem, each party must check during the Diffie-Hellman exchanges that none of the [math]\displaystyle{ h^a }[/math], [math]\displaystyle{ h^b }[/math], [math]\displaystyle{ h^\alpha }[/math], or [math]\displaystyle{ h^\beta }[/math] that they receive is equal to 1. It is also necessary to check that [math]\displaystyle{ P_a \neq P_b }[/math] and [math]\displaystyle{ Q_a \neq Q_b }[/math].

Alice Multiparty Bob
1 Message [math]\displaystyle{ x }[/math]
Random [math]\displaystyle{ a, \alpha, r }[/math]
Public [math]\displaystyle{ p, h }[/math] Message [math]\displaystyle{ y }[/math]
Random [math]\displaystyle{ b, \beta, s }[/math]
2 Secure [math]\displaystyle{ g=\langle h|a, b\rangle }[/math]
3 Secure [math]\displaystyle{ \gamma=\langle h|\alpha, \beta\rangle }[/math]
4 Test [math]\displaystyle{ h^b \neq 1 }[/math], [math]\displaystyle{ h^\beta \neq 1 }[/math] Test [math]\displaystyle{ h^a \neq 1 }[/math], [math]\displaystyle{ h^\alpha \neq 1 }[/math]
5 [math]\displaystyle{ \begin{align} P_a &= \gamma^r \\ Q_a &= h^r g^x \end{align} }[/math] [math]\displaystyle{ \begin{align} P_b &= \gamma^s \\ Q_b &= h^s g^y \end{align} }[/math]
6 Insecure exchange [math]\displaystyle{ P_a, Q_a, P_b, Q_b }[/math]
7 Secure [math]\displaystyle{ c = \left\langle\left. Q_aQ_b^{-1} \right| \alpha, \beta \right\rangle }[/math]
8 Test [math]\displaystyle{ P_a \neq P_b }[/math], [math]\displaystyle{ Q_a \neq Q_b }[/math] Test [math]\displaystyle{ P_a \neq P_b }[/math], [math]\displaystyle{ Q_a \neq Q_b }[/math]
9 Test [math]\displaystyle{ c = P_a{P_b}^{-1} }[/math] Test [math]\displaystyle{ c = P_a{P_b}^{-1} }[/math]

Note that:

[math]\displaystyle{ \begin{align} P_a{P_b}^{-1} &= \gamma^r \gamma^{-s} = \gamma^{r - s} \\ &= h^{\alpha\beta(r - s)} \end{align} }[/math]

and therefore

[math]\displaystyle{ \begin{align} c &= \left(Q_aQ_b^{-1}\right)^{\alpha\beta} \\ &= \left(h^r g^x h^{-s} g^{-y}\right)^{\alpha\beta} = \left(h^{r - s} g^{x - y}\right)^{\alpha\beta} \\ &= \left(h^{r - s} h^{ab(x - y)}\right)^{\alpha\beta} = h^{\alpha\beta(r - s)} h^{\alpha\beta ab(x - y)} \\ &= \left(P_a{P_b}^{-1}\right) h^{\alpha\beta ab(x - y)} \end{align} }[/math].

Because of the random values stored in secret by the other party, neither party can force [math]\displaystyle{ c }[/math] and [math]\displaystyle{ P_a{P_b}^{-1} }[/math] to be equal unless [math]\displaystyle{ x }[/math] equals [math]\displaystyle{ y }[/math], in which case [math]\displaystyle{ h^{\alpha\beta ab(x - y)} = h^0 = 1 }[/math]. This proves correctness.

See also

References

External links