18 Playing Poker by Email 177
In this example the coding tables are not given completely. Instead, we
give formulas how to compute the entry in the right column from the entry
in the left column. It is easy to verify that a(b(x)) and b(a(x)) coincide: For
the computation of a(b(x)) we first have to add 37 to x and afterwards 25,
where we have to subtract 52, if any of the results is larger than 51. For the
computation of b(a(x)) we just have to reverse the order of the additions.
Instead of 37 and 25 we could also use arbitrary different numbers.
This easy example of commuting functions is obviously not suitable for our
application of coding tables. If for example Bob obtains a(x) for the number
x, he can easily compute the number 25 which Alice uses for the addition.
In this way Bob obtains the whole function a and can break all the codes of
Alice. More details on commuting functions suitable for this application are
given in the articles mentioned in the section Further Reading.
Commitment to the Selected Coding Tables
Again we use a and b to denote the coding tables selected by Alice and Bob.
As above, we use a one-way function f. Alice computes f (a) and sends it to
Bob. Similarly, Bob computes f(b) and sends it to Alice. From f (a)andf (b),
Bob and Alice, resp., cannot obtain information on the coding table of the
opponent because f is a one-way function. On the other hand, the players have
committed to the selected coding tables a and b. After the end of the game,
Alice sends her table a to Bob. Then Bob can compute f (a) and verify that
a is really the table selected by Alice at the beginning of the game. Similarly
Alice obtains b from Bob and can verify that b is the table selected by Bob at
the beginning.
Putting Cards into Envelopes
If Alice wants to put the card x into an envelope, she only has to compute
a(x). In order to remove the card from the envelope a(x),
she applies the
inverse
function a
−1
to a(x) because a
−1
(a(x)) = x. Similarly, Bob can put
cards into envelopes using the function b. Since we used the numbers 0 to 51
for the cards and the codes (i.e. the envelopes) as well, Alice can also put
envelopes b(x) created by Bob into her envelopes by computing a(b(x)).
In our poker protocol for snail mail, in a first step Bob puts the cards
into envelopes and afterwards Alice puts those envelopes into another layer
of envelopes. Bob’s task corresponds to computing b(0),...,b(51). It is easy
to see that these are exactly the numbers between 0 and 51. Afterwards Alice
had to compute a(b(0)),...,a(b(51)). The result is again the set of numbers
between 0 and 51. Thus Alice and Bob know without any computation that
the set of codes a(b(0)),...,a(b(51)) is the set of the numbers between 0 and
51. Since Alice does not know b, she is not able to obtain a card from any
code. Similarly, Bob cannot do this because he does not know a.