Need actual random numbers? Meet the NIST randomness beacon.

I wrote a python module that wraps that NIST Randomness Beacon, making it simple to get truly random numbers in python.

It’s easy to use:

b = Beacon()
print b.last_record()
print b.previous_record()
#and so on

There’s also a handy generator for getting a set of n random numbers.

(One of the best gifts I ever got was a copy of 1,000,000 Random Numbers, and I’ve been intrigued ever since.)

Please note that this the randomness beacon is not intended to be a source of cryptographic keys — indeed, it’s a public set of numbers, so I wouldn’t recommend doing anything that could be compromised by someone else having the access to the exact same set of numbers. Rather, this is interesting precisely for the scientific opportunities that are possible when you have a random but public set of inputs.


  • abalogh

    this is really cool, thanks!

  • bortzmeyer

    Too bad the beacon closed two days after…

    • http://www.hilarymason.com Hilary Mason

      …which is ironic, but I do hope it’ll come back!

  • Ben Bradley

    The Beacon is down? I’m gonna call my Representative! If only it were a Military service: http://tycho.usno.navy.mil/cgi-bin/timer.pl

    I’ve thought about a “fixed” source for random numbers (like a PRNG function, only it returns “real” random numbers), and heard that the decimal expansion of Pi passes all known tests of randomness. Furthermore, there’s a program I haven’t run yet called SuperPi that supposedly calculates up to 2^32 (4 billion and change) digits of Pi. It seems that would be useful.

    But I love those Amazon reviews of that book “A Million Random Digits.” I’ve not seen such well-crafted reviews since “A New Kind of Science” and the Denon AKDL1 cable.

  • Camilo

    apparently nist is back again :-)