Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Alice and Bob need to be able to send each other a proof that they picked a number, before they reveal what number they picked. Then the number they chose need to be verified against the proof. Finally both the numbers need to be joined in some way that will not give each of them a total control over the outcome.</p> <p>In the following <code>crypto_function</code> can be something like <code>sha1sum</code> or <code>md5sum</code>:</p> <p><strong>Step 1</strong>:</p> <p><em>needed to make the range of possible values for the <code>crypto_function</code> below sufficiently large</em></p> <ul> <li>Alice picks random numbers <code>Ra1</code> and <code>Ra2</code> and send <code>Ra1</code> to Bob.</li> <li>Bob picks random numbers <code>Rb1</code> and <code>Rb2</code> and send <code>Rb1</code> to Alice.</li> </ul> <p><strong>Step 2</strong>:</p> <p><em>creates the proof <code>Hx</code> that the value <code>Vx</code> is now fixed, but prevent deducing this value from that proof</em></p> <ul> <li>Alice picks a value <code>Va</code> (0&lt;=<code>Va</code>&lt;=5), compose a string <code>Sa="Va Ra2 Rb1"</code> , and send a <code>Ha=crypto_hash(Sa)</code> to Bob.</li> <li>Bob picks a value <code>Vb</code> (0&lt;=<code>Vb</code>&lt;=5), compose a string <code>Sb="Vb Rb2 Ra1"</code> , and send a <code>Hb=crypto_hash(Sb)</code> to Alice.</li> </ul> <p><strong>Step 3</strong>:</p> <p><em>generates the desired outcome <code>V</code></em></p> <ul> <li>Alice sends <code>Sa</code> to Bob. Bob Calculate <code>Ha</code> out of <code>Sa</code> and compare it to <code>Ha</code> from step 2. Then takes <code>Va</code> out of <code>Sa</code>, and calculate the value <code>V=(Va+Vb)%6+1</code>.</li> <li>Bob sends <code>Sb</code> to Alice. Alice Calculate <code>Hb</code> out of <code>Sb</code> and compare it to <code>Hb</code> from step 2. Then takes <code>Vb</code> out of <code>Sb</code>, and calculate the value <code>V=(Vb+Va)%6+1</code>.</li> </ul> <hr> <p><strong>Update</strong>:</p> <p>Based on <a href="http://www.cs.cmu.edu/~mblum/research/pdf/coin/" rel="nofollow noreferrer">Coin Flipping by Telephone</a> suggested by @<a href="https://stackoverflow.com/users/252697/moron">Moron</a> the algorithm can become:</p> <ol> <li><p>Bob picks a random number <code>R</code> and the value <code>0 &lt;= Vb &lt;= 5</code>, Calculates a hash <code>H=crypto_hash("Vb R")</code>, and sends it to Alice.</p></li> <li><p>Alice picks the value <code>0 &lt;= Va &lt;= 5</code>, and sends it to Bob.</p></li> <li><p>Bob sends <code>Vb</code> and <code>R</code> to Alice; Bob calculates <code>V=(Va+Vb)%6+1</code></p></li> <li><p>Alice verifies <code>H=crypto_hash("Vb R")</code>; Alice calculates <code>V=(Va+Vb)%6+1</code></p></li> </ol> <p>... Although I would feel better about it if:</p> <p>0. Alice picks a random number <code>Q</code> and sends it to Bob.</p> <p>And the string to be hashed becomes then <code>"Vb Q R"</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload