lundi 5 janvier 2015

"Secure" drawing of lots



I want to randomly choose a game in the 50 games I have, in order to play with one of my friend. But this friend doesn't trust me, and neither do I: every time one of us pick up a game, the other complains that the choice was not really random.


A first solution could be to put all the names in a hat and after pick up one name; but we're both paranoiac: the hat could contain only one name repeated 50 times, so we have to check that all the names are present only once to ensure an random choice. This is to long.


Second solution: we both randomly choose an integer in [1,50], write it on a paper, and then sum the result modulo 50. This is a good solution when we face each other.


But what if we want to choose an online game, me playing at Paris and my friend playing at NY ? I've trued to emulate the above protocol: each player choose randomly a number in huge interval like [1,1e30] and in a first time send a hash of its number (simulating the fact of hide the number on a piece of paper). When each player have received the hash of the other, the two players publish their numbers and add them modulo 50.


Is this protocol correct? Is there a better (maybe faster) protocol for this purpose?





Aucun commentaire:

Enregistrer un commentaire