Re: How to flip a coin over e-mail?

From: Mike Williams (nospam_at_econym.demon.co.uk)
Date: 06/17/04


Date: Thu, 17 Jun 2004 18:49:03 +0100

Wasn't it Jon Haugsand who wrote:
>I have a real practical problem where I am going to place several
>people in the same number of rooms. However, the rooms are of
>different quality so the actual room any person get is done by
>random. There are som preconditions, so I can list all acceptable
>outcomes and the problem is to find some way to choose randomly
>between these outcomes.
>
>How can I do this when all I have is e-mail communication between the
>participants?
>
>My own solution is to make a file where I denumerate each outcome and
>shuffle them randomly. I pad this file with some secret random
>numbers at the end, and I send a cryptographic hash (md5) to all
>participants. I then ask the others for a number between 1 and N and
>this number will point to the actual outcome. I then send them the
>file such that all of them can check that I did not make this file
>after I got the number drawn.
>
>However, this method requires that my friends have trust in the md5
>cryptographic hash. Of course, they should, but I cannot demand such
>knowledge.

There's a well known system which uses any commutative coding system.
(I.e. one where the sequence Encode-with-A, Encode-with-B, Decode-with-
A, Decode-with-B restores the plain text).

You encode the room descriptions with your key A, coding each entry
separately and pass it to the next person in the ring. Each other person
in turn picks one of the entries, removes that entry from the list and
passes it to the next person. When the list gets round the loop back to
you, there's one entry left on the list which you can decode to
determine your room.

Each of the other people in the ring encodes their chosen entry with
their personal key and sends the result back to you. You decode it with
your key and send it back to them. They decode it with their key to
reveal the contents.

E.g. person C has an entry which is encoded with A, they encode that
with C and send you the result encoded AC. You decode with A, so it's
now encoded only with C and you can't read it. You send that back to C
who can decode it and read it. C can tell that you haven't fiddled the
results by the fact that the text produces a sensible result when
decoded with a key that you don't know.

In this way, the rooms are allocated fairly. In addition, nobody, even
you, knows which room was allocated to another person.

-- 
Mike Williams
Gentleman of Leisure


Relevant Pages

  • Re: Need a bit of information about Compression
    ... either encode a full length, or a length mod some constant. ... Yes, full Length coding, arithmetic coding which is certainly better ... if you are decoding, say, 1024 symbols, then you stop as soon as you decode ... less common is to set up some special condition, where the eof is ...
    (comp.compression)
  • Re: Sending floats over a client-server in Smalltalk
    ... The trick is knowing what to decode them ... Then encode the number in the remaining bytes. ... ByteString>>floatAt: byteIndex ... I could then take a string ...
    (comp.lang.smalltalk)
  • Re: Beginners thread
    ... So I am now encoding and decoding Million Digit binary file. ... So fingers crossed that all goes well but I see the same decode data ... I am suggesting Encode be ...
    (comp.compression)
  • Re: unicode and hashlib
    ... Of course my dyslexia sticks out here as I get encode and decode exactly ... Characters are "encoded" to a byte format. ... You decode from on character set to a unicode object ...
    (comp.lang.python)
  • Re: decoding REG_BINARY entries
    ... why does this particular entry require a reg_binary entry as opposed to ... and that the netsh command retain it's synatax over the ... amount of cash to reveal how to decode that blob. ... registry settings for Outlook during a data migration. ...
    (microsoft.public.scripting.vbscript)