vote up 2 vote down
star

Is there a way to do a FAIR coin toss over e-mail using verifiable methods with both participants being the only parties?

flag
2 
The obvious answer is to do an XOR (both participants email each other choosing either 'true' or 'false', and the result of the coin toss is heads or tails based on the XOR table). This is fair and verifiable—however, it is easily 'gamed' if one participant purposefully waits until he/she receives the other person's choice before making his or hers. So, would you like to revise the question to specify that the system should work even if one participant waits for the other to choose first, or the system should work by them taking turns? – Alistair A. Israel Feb 5 at 3:19
Being the ignoramus that I am, I would first ask for the parameters of the coin toss. Unless you speak of a coin-tossing in terms of a domain I am unfamiliar with. Must each participant make a call? The conventional "analog" coin toss between 2 parties has only one "caller" and the other guy who makes the toss. The caller calls a side and the tosser is assigned the other side by default. So why go through the elaborate logic of the back and forth messaging with cryptography? – Jeremy Feb 5 at 6:25
@Jeremy Let's have an online coin toss. I say, "Call it." You say, "Heads." I say, I just tossed a coin and it came up "tails" so, sorry you lose. But how do you know I didn't just make up the toss after you called "heads"? You don't. Suppose you give me an encrypted message with the 'call'. I toss a real coin and say it came up "heads". You then give me a key to decrypt the message to say "heads". But how do I know you didn't have 2 keys that could decrypt the ciphertext either way? I don't. Hence, two-way encrypted ballot. – Alistair A. Israel Feb 6 at 6:11

3 Answers

vote up 7 vote down

EDIT: I've revised my original answer, sorry. The basic 'protocol' remains the same, however, I've removed the need for private-public keys, and just use symmetric encryption. There was a fundamental flaw anyway in the key exchange in my original answer.

This is best answer I can come up with that I think is secure against one person purposefully delaying their choice.

Let me illustrate.

The Setup

  1. Let's designate the participants Alice and Bob.
  2. Alice and Bob also each encrypt two messages, one containing "True" and the other "False" using their respective keys; both messages are then sent to the other participant.
  3. Alice receives both of Bob's messages, and doesn't know the contents of either. She chooses one message, encrypts in again it using her key, and sends it back to Bob.
  4. Bob also chooses one of Alice's messages, encrypts that one, too, using his key, then sends that back to Alice.

Both participants now have two encrypted messages, each one either True or False, that can only be opened using their one or both of their respective keys.

Alice has one that came from Bob (encrypted using Bob's key), which she chose and sent back (encrypted using her key). She also has one she got back from Bob, originally encrypted using her key, then encrypted using Bob's key.

Bob has the reverse: one of True/False encrypted using Alice's key, and one of his own True/False messages back from Alice, also encrypted using Alice's key.

All they have to do now is exchange keys.

The resolution

Alice decrypts her choice (from Bob's first pair) using Bob's key to get True/False, and also decrypts the message she got back from Bob (also using Bob's key) to get one of her own True/False messages (still encrypted using her key, but can be easily identified).

Bob decrypts his choice (from Alice's original pair) using her key, and also decrypts the message he got back from Alice (again using her key) to find out Alice's choice.

Both participants now know what they 'chose', and can undisputably verify what the other one chose. They can each XOR both to get the final True/False (or Heads/Tails) result.

Security

It doesn't matter whether one participant 'waits' or delays before sending their key—the other participant already has an irrefutable copy of their 'ballot'.

The only purpose it would serve is to deny the other person the ability to verify the final result, which would easily be grounds to disqualify the whole coin-toss.

Even if Bob could magically create two keys that could somehow decrypt a True message into a False message (and False into True) so he can 'wait' to open Alice's choice before turning in his; it won't work with the encrypted True/False messages that originally came from Alice.

Note that constructing a key that'll decrypt a single ciphertext into a(ny) desired plaintext is possible—in fact, if you use the XOR cipher then it becomes trivial. With modern symmetric algorithms, however, the problem is largely intractable.

link|flag
vote up 0 vote down

The problem with the dual e-mail is that if one participant waits then it's not exactly fair. There has to be a way to lock the information about both the call and the toss result in a vault such that both participants can unlock the vault at any given time without having to rely on the other. You might not have to do both; just lock one of either the call or the toss result, transmit the other, then the key to the vault should be sent, as well as proof that the vault has not been tampered before the other party's transmission.

link|flag
1 
That's exactly what I meant when I said the obvious answer is 'insecure'. I'm still trying to think up/research a secure solution using as little cryptography as necessary. – Alistair A. Israel Feb 5 at 3:42
vote up -2 vote down

Well let's think about what a real coin toss is like. You have two participants, and a trusted entropy-based random number generator i.e. the coin. Well, more-or-less trusted because both participants can see the result at the same time, and your trust your friend enough that he can't have absolute control over the coin on how it lands.

Now in a half-duplex communications channel, the general idea of synchronicity isn't there. So you have to throw out your idea of what a coin toss is. We can't have one person control the entropy of the system (i.e. perform the coin toss), since he cannot be trusted, but we can get the effect of a coin toss if both participants contribute to the entropy of the system.

Alice and Bob both have a random number generator. This could be a 20-sided dice, or a prng lookup table, or off the top of their heads. Alice and Bob create separate lists of say 10 random integers ranged from, say, 1 to 100.

Now to be fair, they agree first (through email) who will be heads and who will be tails. This does not require any special verification beyond their agreement.

Alice picks a number from 1 to 10 that will be an index into Bob's table, and Bob will pick a number from 1 to 10 that will be an index into Alice's table.

When both parties have received the others index, they exchange tables. Both parties now have both indexes and both tables and take the sum of the values at each index. They should now arrive the same number N.

From here, N mod 2 to get 0 = heads or 1 = tails.

link|flag
1 
Bob can wait to get Alice's table (and he already has Alice's index). Since he already has the parity of Alice's choice, all he needs to do is alter the number at the index he chose to make the parity of the sum either 0 or 1 in his favor. – Alistair A. Israel Mar 4 at 10:25
Hmmm, right you are! Well, how's this... Alice starts the exchange by sending her index. Bob must reply with his index and table, and Alice's original email intact as proof of reciept. Alice has Bob's index and table, but cannot change her index anymore. Bob has revealed his index and table, knows Alice's index, but does not know the contents of Alice's table. To complete the process, Alice sends her table and the result, and Bob sends confirmation of the result as proof of his victory (or defeat) Convoluted, yes, but so is the idea of playing coin toss over email. – EnderWiggin Mar 4 at 12:21
On the other hand, I realize now that my answer is exactly like yours... where their index is the encrypted message and the table is the key. Go figure... – EnderWiggin Mar 4 at 12:37
Err.. how was my answer not helpful? It is an answer, and I arrived at the answer independently. While similar to Alistair's I can assure you while I did see his answer, I did not read it fully and use it as a base for my algorithm, as I was looking for a non-cryptography-dependent approach. – EnderWiggin Mar 4 at 14:05

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.