Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to generate publicly observable random numbers?

Tags:

random

web

I have a website that gives users different outcomes depending on a virtual dice roll. I want them to trust that my random numbers are honest, so instead of me determining it in my own code (which to my skeptical users is a black box I can manipulate), I want to come up with some other mechanism.

One idea is to point to some credible website (e.g. governmental) that has a publicly observable random number that changes over time. Then I could say, "We will base your outcome on a number between 0 and 9, which will be the number at [url] in 10 seconds."

Any suggestions?

like image 375
RexE Avatar asked May 15 '13 13:05

RexE


1 Answers

I'd go with this site myself. It has a public anonymous URL for several kinds of numbers, and realtime pages to observe them:

Hex numbers

  • Number: https://qrng.anu.edu.au/ran_hex.php
  • Stream: https://qrng.anu.edu.au/RainHex.php

Binary numbers

  • Number: https://qrng.anu.edu.au/ran_bin.php
  • Stream: https://qrng.anu.edu.au/RainBin.php

It also includes references to the scientific explanation of the source of randomness, and practical demonstrations of it, even one specifically for dice.

From your code you can just retrieve the number URL mentioned above.

Alternative if verifiability is important

A completely alternative approach: when the deadline falls, retrieve the homepage of an outside controlled, high-traffic interactive site, such as the questions page of Stack Overflow. Store the page, take its MD5 or SHA1 hash, and derive your roll from that.

You can then:

  • Show the page as it was at the snapshot time to verify it's working HTML
  • Its HTML source full of timestamps to verify authenticity and time of retrieval to nearly the second
  • Let people verify the hash for themselves based on that
  • Guarantee randomness of the value because it is mathematically impossible to predict what you need to change on a site like SO to trigger a given new hash value

Any attempt to tamper with this system, such as Jeff reiterating an old page on purpose because he knows the MD5 hash it produces, is easily debunked by the real time nature of the site - it would be visible for everyone to see the questions aren't recent to the time of snapshot.

like image 159
Niels Keurentjes Avatar answered Sep 28 '22 08:09

Niels Keurentjes