Ideas Behind Proposed Protocol II
In order to reduce the number of cards to below 2m, it is natural to represent the wealth of Alice and Bob as binary number with \(\lceil \log m \rceil \) bits (i.e., \(2\lceil \log m \rceil \) cards). This approach enables us to consider the strategy by comparing the Alice’s and Bob’s wealth bit-by-bit starting from their least significant bits.
Let \((a_n, \dots ,a_1)\) and \((b_n ,\dots , b_1)\) be the binary representation of the positive integers a and b, respectively, where \(n:=\lceil \log m \rceil \) and \(a_i,b_i\in \{0,1\}\), \(i= 1,2,\ldots ,n\). For each \(i\in [n]\), assume that \(a_i\) and \(b_i\) are represented by pairs of cards \(\alpha _{i,l} \alpha _{i,r}\) and \(\beta _{i,l}\beta _{i,r}\), respectively, where \(\alpha _{i,l} \alpha _{i,r},\beta _{i,l}\beta _{i,r}\in \{\clubsuit \heartsuit ,\heartsuit \clubsuit \}\). For instance, \(a_i=1\) is represented by cards as \(\alpha _{i,l} \alpha _{i,r}=\heartsuit \clubsuit \).
Note that, however, such a two-card representation of binary number is redundant in a bit-by-bit comparison since we can represent 0 and 1 by
\(\clubsuit \) and
\(\heartsuit \), respectively.
13 In this one-card representation,
\(\alpha _{i,l}\) and
\(\beta _{i,l}\) suffice to represent
\(a_i\) and
\(b_i\), respectively. Further, their negations,
\(\lnot a_i\) and
\(\lnot b_i\), are also represented by
\(\alpha _{i,r}\) and
\(\beta _{i,r}\), respectively. In the following, we consider a scenario in which Alice prepares
\((a_n,\ldots ,a_1)\) by using a two-card representation, but here, Alice and Bob use a one-card representation for comparison.
We compare the bits of Alice and Bob by preparing a device (equipped by a card as well) called comparison storage, denoted by
\(\textit{cs} \in \{\clubsuit ,\heartsuit \}\), that records the bit-by-bit comparison results. Our idea is roughly described as follows: We assume that Bob compares
\(\beta _{i,l}\) (i.e.,
\(b_i\)) with Alice’s card
\(\alpha _{i,l}\) (i.e.,
\(a_i\)) from
\(i=1\) to
n, and he overwrites cs with
\(\beta _{i,l}\) (i.e.,
\(b_i\)) if
\(\beta _{i,l} \ne \alpha _{i,l}\) (i.e.,
\(b_i \ne a_i\)) while cs remains untouched if this is not the case (i.e.,
\(b_i = a_i\)). Recalling that Bob overwrites the comparison storage with his bit, Bob is shown to be richer if the comparison storage is
\(\heartsuit \) (i.e., 1) at the end of the protocol. Similarly, Alice is shown to be richer if the comparison storage is
\(\clubsuit \) (i.e., 0) at the end of the protocol. As is easily understood, however, this rough idea has the following a problem:
P1)
If Bob were to directly compare his bits with those of Alice, such a comparison strategy would easily leaks Alice’s bits to Bob.
This problem can be avoided by considering the following modified randomized strategy: Since Alice prepares
\((a_n,\ldots ,a_1)\) by two-card representations, she sends Bob
\(\alpha _{i,l}\) (i.e.,
\(a_i\)) or
\(\alpha _{i,r}\) (i.e.,
\(\lnot a_i\)) with probability 1/2. Such a randomization is effective for concealing the value of Alice’s bit from Bob, but we encounter another problem:
P2)
Since Alice sends \(\alpha _{i,w}\) to Bob \(w\in \{l,r\}\) with a probability of 1/2, he cannot tell from \(\alpha _{i,w}\) whether \(a_i \ne b_i\) or not.
Problem
P2) is resolved by introducing another storage called dummy storage, denoted by
\(\textit{ds} \in \{\clubsuit ,\heartsuit \}\), and communicating the pair of cs and ds between Alice and Bob.
Hereafter, we refer to the pair consisting of \(\textit{cs}\) and \(\textit{ds}\) as storage. Bob overwrites cs and ds corresponding to the result of \(a_i \ne b_i\) and \(a_i = b_i\). However, just adding a new storage is insufficient to resolve the problem that Bob cannot determine whether \(a_i \ne b_i\) or \(a_i = b_i\), i.e., he cannot determine which one of cs and ds should be overwritten.
Problem
P2) can be rephrased using binary numbers as follows: Let
\(a'_i \in \{0,1\}\) be a binary number that Bob receives, but he does not know whether
\(a_i' = a_i\) (in the case of
\(w=l\)) or
\(a_i' = \lnot a_i\) (in the case of
\(w=r\)). Our main object is to find
\(a_i \ne b_i\) or
\(a_i = b_i\) even if either one of
\(a'_i=a_i\) or
\(a'_i=\lnot a_i\) is sent.
14
Basic idea for resolving
P2) is that Bob uses the fact that what he knows is either
\(\alpha _{i,w} \ne \beta _{i,l}\) (i.e.,
\(a_i' \ne b_i\)) or
\(\alpha _{i,w} = \beta _{i,l}\) (i.e.,
\(a_i' = b_i\)). Making use of this fact, Alice and Bob treat
cs and
ds as an ordered pair of face-down cards, and assume that either
\((\textit{cs},\textit{ds})\) or
\((\textit{ds},\textit{cs})\) is determined by Alice’s private random choice
\(w\in \{l,r\}\) as follows:
-
If Alice selects \(w=l\) and sends Bob \(\alpha _{i,l}\in \{\clubsuit ,\heartsuit \}\) (i.e., \(a_i\)), then she sends him \((\textit{cs},\textit{ds})\) with \(\alpha _{i,l}\).
-
If Alice selects \(w=r\) and sends Bob \(\alpha _{i,r}\in \{\clubsuit ,\heartsuit \}\) (i.e., \(\lnot a_i\)), then she sends him \((\textit{ds},\textit{cs})\) with \(\alpha _{i,r}\).
Note that
\(\alpha _{i,w}\) is not necessary to be face-down when she sends it since no information on
a leaks to Bob from
\(\alpha _{i,w}\). We can see that the order of
cs and
ds is synchronized with
\(w\in \{l,r\}\) (i.e.,
\(a_i\) and
\(\lnot a_i\)) in
Alice. Owing to this synchronization, Bob can correctly overwrite cs only when
\(a_i \ne b_i\) by implementing the following strategy, even if he does not know which one of cs and ds should be overwritten. Let
\((\sigma _l,\sigma _r)\) be the storage Bob receives from Alice. Then Bob’s behavior after receiving
\(\alpha _{i,w}\) from Alice is shown below.
-
If \(\alpha _{i,w} \ne \beta _{i,l}\) (i.e., \(a'_i \ne b_i\)) holds, Bob overwrites the left element \(\sigma _l\) of the storage \((\sigma _l,\sigma _r)\) with \(\beta _{i,l}\) (i.e., \(b_i\)).
-
If \(\alpha _{i,w} = \beta _{i,l}\) (i.e., \(a'_i = b_i\)) holds, Bob overwrites the right element \(\sigma _r\) of the storage \((\sigma _l,\sigma _r)\) with \(\beta _{i,l}\) (i.e., \(b_i\)).
Let
\((\sigma _l',\sigma _r')\) be the storage overwritten by Bob, and he returns
\((\sigma _l',\sigma _r')\) to Alice. Then, by using
\(w \in \{l,r\}\) that Alice generated, she privately rearranges
\((\sigma _l',\sigma _r')\) so as to place cs and ds on the left and the right, respectively. After repeating these procedures from
\(i=1\) to
n, Bob is shown to be richer if
\({cs}=\heartsuit \) (i.e., 1) whereas the contrary is true if
\({cs}=\clubsuit \) (i.e., 0).
Table 2
Synchronization mechanism in the proposed protocol with storage
0 (\(\clubsuit \)) | 1 (\(\heartsuit \)) | 0 (\(\clubsuit \)) | True | \(\text {left} =\textit{cs}\) | 1 (\(\heartsuit \)) | False | \(\text {right} =\textit{cs}\) |
1 (\(\heartsuit \)) | 0 (\(\clubsuit \)) | 1 (\(\heartsuit \)) | True | \(\text {left} =\textit{cs}\) | 0 (\(\clubsuit \)) | False | \(\text {right} =\textit{cs}\) |
0 (\(\clubsuit \)) | 0 (\(\clubsuit \)) | 0 (\(\clubsuit \)) | False | \(\text {right} =\textit{ds}\) | 1 (\(\heartsuit \)) | True | \(\text {left} =\textit{ds}\) |
1 (\(\heartsuit \)) | 1 (\(\heartsuit \)) | 1 (\(\heartsuit \)) | False | \(\text {right} =\textit{ds}\) | 0 (\(\clubsuit \)) | True | \(\text {left} =\textit{ds}\) |
It is easy to see from Table
2 that our synchronization strategy for storage works well. This is best clarified by discussing the proposed protocol by using binary numbers rather than cards. For instance, consider the case where Alice compares her bit
\(a_i=1\) with Bob’s bit
\(b_i=0\) (the second line in Table
2). If Alice selects
\(w=l\), Bob receives a bit
\(a'_i=a_i=1\) and compares it with Bob’s bit
\(b_i=0\). Since
\(a'_i \ne b_i\), the left-hand side element of the storage, i.e.,
cs, is overwritten by
\(b_i =0\). On the other hand, if Alice selects
\(w=r\), Bob receives a bit
\(a'_i=\lnot a_i=0\) and compares it with his bit
\(b_i=0\). Since
\(a'_i = b_i=0\), the right-hand side element of the storage, i.e., cs, is overwritten by
\(b_i =0\). Anyway, cs is correctly overwritten by
\(b_i=0\) \((< a_i =1)\) as expected.
Proposed Protocol II
Based on the discussion in the previous section, we propose the card-based cryptography which uses storage and synchronization between the random selection
\(w\in \{l,r\}\) and the order of cs and ds, for the Millionaires’ problem (see Protocol
4). For the upper bound
\(m\in {\mathbb {N}}\) of the wealth of Alice and Bob, let
\(n:=\lceil \log m\rceil \).
15
Example of proposed protocol II. We show a simple example for understanding how the proposed protocol II works correctly. Consider the case where we compare \(a=0\) of Alice and \(b=2\) of Bob, which are represented by \((\alpha _{2,l}\alpha _{2,r}, \alpha _{1,l}\alpha _{1,r}):=(\clubsuit \heartsuit ,\clubsuit \heartsuit )\) and \((\beta _{2,l}\beta _{2,r}, \beta _{1,l}\beta _{1,r}):=(\heartsuit \clubsuit ,\clubsuit \heartsuit )\), respectively, since \((a_2,a_1)=(0,0)\) and \((b_2,b_1)=(1,0)\). We also set \((\textit{cs},\textit{ds})=(\clubsuit ,\heartsuit )\).
We first consider the case of \(i=1\). If Alice chooses \(w=l\) in step (2-i), (12) becomes \((\sigma _l,\sigma _r)=(\textit{cs},\textit{ds})=(\clubsuit ,\heartsuit )\) since \(\chi ^{\textsf {eq}}(w,r)=\chi ^{\textsf {eq}}(l,r)=0\). Then, she sends Bob \((\sigma _l,\sigma _r)=(\clubsuit ,\heartsuit )\) and \(\alpha _{1,l}=\clubsuit \) in step (2-ii). In step (2-iii), Bob compares \(\beta _{1,l}=\clubsuit \) with \(\alpha _{1,l}=\clubsuit \), which results in \(\overline{\chi ^{\mathsf {eq}}}(\beta _{1,l},\alpha _{1,l})=0\). Then, he outputs \((\sigma '_l, \sigma '_r)=(\sigma _l, \beta _{1,l})=(\clubsuit ,\clubsuit )\) by overwriting the right element of \((\sigma _l,\sigma _r)=(\clubsuit ,\heartsuit )\) with \(\beta _{1,l}=\clubsuit \) privately, since (13) becomes \((\sigma '_l, \sigma '_r, \eta )=(\sigma _l, \beta _{1,l},\sigma _r)\) due to \(\overline{\chi ^{\mathsf {eq}}}(\beta _{1,l},\alpha _{1,l})=0\). Bob discards \(\sigma _r\) without face up \(\sigma _r=\heartsuit \).
On the other hand, consider the case where Alice chooses \(w=r\) in step (2-i); Then, (12) in step (2-i) becomes \((\sigma _l,\sigma _r)=(ds,cs)=(\heartsuit ,\clubsuit )\) since \(\chi ^{\textsf {eq}}(w,r)=\chi ^{\textsf {eq}}(r,r)=1\). She sends Bob \((\sigma _l,\sigma _r)=(\heartsuit ,\clubsuit )\) and \(\alpha _{1,r}=\heartsuit \) in step (2-ii). Bob compares \(\beta _{1,l}=\clubsuit \) with \(\alpha _{1,r}=\heartsuit \), and outputs \((\sigma '_l, \sigma '_r)=(\clubsuit ,\clubsuit )\) by overwriting the left element of \((\sigma _l,\sigma _r)=(\heartsuit ,\clubsuit )\) with \(\beta _{1,l}=\clubsuit \) privately as a result of (13).
Summarizing the case of \(i=1\), regardless of the selection of \(w \in \{l,r\}\), storage becomes \((cs,ds)=(\clubsuit ,\clubsuit )\), which means that the dummy storage is overwritten by the Bob’s bit since \(a_1=b_1\). Then, Bob sends it to Alice in step (2-iv). In step (2-v), Alice sets \((\textit{cs},\textit{ds}):=(\clubsuit ,\clubsuit )\) due to (14) for the storage sent from Bob.
Next, consider the case of \(i=2\): If Alice selects \(w=l\) in step (2-i), she generates \((\sigma _l,\sigma _r)=(\textit{cs},\textit{ds})=(\clubsuit ,\clubsuit )\) from (12), and sends it with \(\alpha _{2,l}=\clubsuit \) to Bob in step (2-ii). Then, Bob compares \(\beta _{2,l}=\heartsuit \) with \(\alpha _{2,l}=\clubsuit \) in step (2-iii). Since \(\beta _{2,l}\ne \alpha _{2,l}\), he generates \((\sigma '_l, \sigma '_r)=(\beta _{2,l},\sigma _r)=(\heartsuit ,\clubsuit )\) by overwriting the left element of \((\sigma _l,\sigma _r)=(\clubsuit ,\clubsuit )\) with \(\beta _{2,l}=\heartsuit \) privately according to (13). Bob sends \((\sigma '_l, \sigma '_r)=(\heartsuit ,\clubsuit )\) to Alice, and she obtains \((\textit{cs},\textit{ds}):=(\heartsuit ,\clubsuit )\) due to (14).
On the other hand, consider the case where Alice chooses \(w=r\) in step (2-i); Then, she generates \((\sigma _l,\sigma _r)=(ds,cs)=(\clubsuit ,\clubsuit )\) from (12), and sends it with \(\alpha _{2,r}=\heartsuit \) in step (2-iii). Since \(\beta _{2,l} = \alpha _{2,r}\), he generates \((\sigma '_l, \sigma '_r)=(\sigma _l, \beta _{2,l})=(\clubsuit ,\heartsuit )\) by overwriting the right element of \((\sigma _l,\sigma _r)=(\clubsuit ,\clubsuit )\) with \(\beta _{2,l}=\heartsuit \) privately according to (13). Bob sends \((\sigma '_l, \sigma '_r)=(\clubsuit ,\heartsuit )\) to Alice, and she obtains \((\textit{cs},\textit{ds}):=(\heartsuit ,\clubsuit )\) due to (14).
Finally, the output value correctly becomes \(cs=\heartsuit \) as \(a<b\) regardless of random choices of Alice.
Efficiency of the proposed protocol II. This protocol requires two communications for every bit therefore it requires \(2 \lceil \log m \rceil \) communications. We note that steps (2-v) and (2-i), when i is incremented, can also be regarded as one PP. Hence, this protocol requires \(2 \lceil \log m \rceil +1\) PPs. The number of cards is \(4\lceil \log m \rceil +2\).
Proof
Consider the randomness used by Alice and Bob denoted by \(R_A\) and \(R_B\), respectively. From step (2-i), the value of \(R_A=(W_1,W_2,\ldots ,W_n)\) where \(W_i\) is the random variable corresponding to w in the i-th loop in step 2). Each random variable \(W_i\), \(i=1,2,\ldots ,n\) takes the value in \(\{l,r\}\) with probability 1/2, and it is independent from the other random variables. Hence, \(R_A\) can obviously be simulated by \({\mathsf {S}}_A\) by using n independent uniform binary numbers. Similarly to the proposed protocol I, Bob does not use any randomness, and hence, \({\mathsf {S}}_B\) does not have to simulate \(R_B\).
Regarding the simulation of public information \(\varLambda \), observe that \(\varLambda \) is the n values represented by the face-up cards in step (2-iii), i.e., \( \varLambda = (\alpha _{1,{W_1}},\alpha _{2,{W_2}},\ldots ,\alpha _{n,{W_n}})\). Hence, \(\varLambda \) is easily simulated by \({\mathsf {S}}_A\) by a which is represented by her 2n cards, and the random variable \(R_A=(W_1,W_2,\ldots ,W_n)\). On the other hand, for Bob, \(\varLambda =(\alpha _{1,{W_1}},\alpha _{2,{W_2}},\ldots ,\alpha _{n,{W_n}})\) seems to be uniformly distributed over \(\{\heartsuit , \clubsuit \}^n\) since he does not know the value of \(W_i=w_i\), which is selected randomly by Alice. Hence, \(\varLambda \) is easily simulated by \(S_B\).
Since the simulators \({\mathsf {S}}_A\) and \({\mathsf {S}}_B\) can be explicitly constructed as above, we complete the proof of the theorem. \(\square \)
Millionaires’ Problem Can Be Solved with Only Six Cards
Although the proposed protocol II was improved in terms of the numbers of PPs and communications, as is shown in Table
1, it still requires the same number of cards with the previous work based on logical gates. However, we show that the proposed protocol II can be realized with only six cards in this section.
Our main idea is to reuse the card
\(\eta \) discarded by Bob in step (2-iii) of Protocol
4.
16 We note that, however,
\(\eta \) cannot be simply reused. If
\(\eta \) is reused simply and accessed by Alice and/or Bob, they can obtain information about
\(\eta \) which holds information on their inputs. For instance, in Protocol
4, suppose that Bob could look at the front of
\(\eta \) in step (2-iii) for
\(i=1\). Noticing that
\((cs,ds)=(\clubsuit ,\heartsuit )\) is public information when
\(i=1\),
\(a_1\) completely leaks to Bob since he can tell whether
\(w=l\) or not. Inductively,
\(\eta \) should not be simply reused when
\(i \ge 1\) because
\(\eta \) also holds information about Alice’s choice of
w.
Therefore, we need to erase information about
\(\eta \) for reusing it. However, it is impossible to erase the information about
\(\eta \) as long as we adopt the one-card representation since a single card cannot be randomized as opposed to the case of two-card representation. Hence, we should employ two-card representation for the storage (and the input) in Protocol
4. Concretely, if
\(\eta \) is in two-card representation, Bob returns randomized
\(\eta \) to Alice instead of discarding it by Bob in Protocol
4. Then, she can reuse
\(\eta \).
One may think that this modification makes the protocol inefficient since the number of storage cards increases. However, surprisingly, this modification allows Alice and Bob to use
\(\eta \) as his/her inputs if they hold inputs in their mind! Namely, at the cost of using six cards for (
cs,
ds) and
\(\eta \), Alice and Bob do not necessary to have their cards to represent their inputs (if they can remember the inputs). Therefore, six cards are sufficient to realize a card-based protocol for millionaires’ problem with efficient memory and communication cost. The improved protocol shown in Protocol
5. As shown in the step 1), the storage cards are represented by two-card representation. The steps (2-v) and (2-viii) are executed for erasing information of
\(\eta \) by Bob and Alice.
Efficiency of the improvement of proposed protocol II. This protocol requires two communications for every bit therefore it requires \(2 \lceil \log m \rceil \) communications. We note that the sequence of PPs executed in steps (2-iv) and (2-v) can be regarded as one PP. Similarly, steps (2-vii) to (2-i), when i is incremented, can also be regarded as one PP. Hence, this protocol requires \(2 \lceil \log m \rceil + 1\) PPs.