
Chernobyl Dice: A quantum random number generator with a Nixie tube display - tcberry
https://github.com/nategri/chernobyl_dice
======
Calamity
Unlike the "pseudo-random" number generators used in software everywhere, here
we have a truly "random" number generator (at least with our current
understanding of physics).

Impossible to predict the next number - no matter how much information about
the universe you know.

~~~
pwnmonkey
Does this mean determinism is moot?

~~~
EsssM7QVMehFPAs
In quantum mechanics, yes it is. See Bell's theorem.

~~~
officialjunk
And folks like Einstein felt quantum mechanics is an incomplete theory because
of this. It is not an settled debate.

------
wombawomba
This is probably a dumb question, but wouldn't recording the millisecond
timestamp mod 2 of each decay be a lot easier and also produce a uniform
distribution (at least at the rate this thing seems to be registering decays)?

~~~
nategri
Author here.

Not a dumb question! I tried this approach using 4-microsecond ticks and was
surprised to catch a (subtle) bias. So I in the end I basically used two
different RNG algos (both with slight biases) and XOR’d them together.

Would love to isolate why these on their own appear to have a bias but testing
is a super laborious process (takes roughly 3 days to generate a 1 megabit
file).

Of course, I could always speed up the testing cycle by using a more
radioactive sample ;)

------
tyingq
That's a pretty unique conversation piece. The parts list and urls to supports
is an image though. Oy. So maybe I can transcribe and do a pull request.

~~~
nategri
Author here.

Sorry about that! I’ll push a plaintext CSV version of the part list later
today.

~~~
acidburnNSA
Looks like there's a CSV in the repo already:
[https://github.com/nategri/chernobyl_dice/blob/master/parts_...](https://github.com/nategri/chernobyl_dice/blob/master/parts_list.csv)

~~~
nategri
Ha! Good catch

~~~
tyingq
Fix line 2 by making the " denoting inches into "" and GitHub will render it
nicely.

------
bcaa7f3a8bbc
A radioactive-based random number generator surely is fun. But a friendly
reminder to those readers who want a quantum device but prefer a low-power,
solid-state implementation: A "quantum" random number generator doesn't always
have to be fancy, it can be as boring as a diode. Diodes only allow current to
flow to one direction, but if you reverse bias a diode hard enough, they'll
eventually breakdown, conduct, and produce a fixed voltage drop across it.
This principle is used to make voltage references and regulators. But on a
closer look, the diode also produces a significant amount of random noise in
this process. And the mechanisms responsible for the breakdown of a diode,
either Zener Effect or Avalanche Effect, although are semi-classical, but
ultimately quantum mechanical in nature - the electrons received enough energy
to randomly pass through the forbidden bandgap, and the noise is effectively
unpredictable. (There are also tunnel diodes that use real Quantum Tunneling,
which doesn't have any classical explanation, fancier than Zener or Avalanche
Effect, but general-purpose tunnel diodes are no longer in production of large
quantity.)

There are some really expensive avalanche or tunnel diode noise sources you
can buy, that are made by electronics giants like Keysight, that are designed
to produce perfectly calibrated white noise across a few GHz of bandwidth for
RF test, measurement, or cryptographic purposes. But you can build a simple
one, the only problem is that the ordinary diodes are not designed to
breakdown, they will, but it's thousands of volts and potentially a
destructive event, thus they are not really useful. You can buy Zener diodes,
but it's likely that you don't already have one and you don't want to wait for
shipping. But there's another neat choice - use a transistor. The base-emitter
junction of any bipolar transistor is effectively a diode for DC signals. And
the most common transistors are small-signal transistors, it's easy to apply a
low reverse voltage, typically 6.0 V [0] to make it go breakdown.

Then connect it to an amplifier and a ADC, you are done. And you don't even
have to use an ADC, you can use a 74ALS04 logic gate (the faster, the better,
74LS is not recommended) and connect a feedback resistor to force the logic
gate to work as an amplifier rather than a switch, and you get an amplified
and digitized output. This idea was originally posted to the sci.crypt
newsgroup. And many have built variations of this circuit with success.

Although some warned that this circuit is vulnerable to external radiofreqency
interference, which can be used by the NSA to attack your generator, so good
RF design practices, such as heavily shielding the noise source and the
amplifier, good power supply decoupling and filtering are recommended. It's
also recommended to add a builtin self-test routine to your microcontroller
and disable the output in case the circuit fails the randomness check - it's
an industrial standard safegaurd.

* [https://www.csshl.net/sites/default/files/downloadable/hw/hw...](https://www.csshl.net/sites/default/files/downloadable/hw/hw-rng.html)

* [https://makezine.com/projects/really-really-random-number-ge...](https://makezine.com/projects/really-really-random-number-generator/)

* [http://www.cryogenius.com/hardware/rng/](http://www.cryogenius.com/hardware/rng/)

On the other hand, readers who are interested in extremely fancy quantum
number generators should take a look of the double-slit experiment, single-
photon light sources, interferometry, and photomultiplier tubes. A simple idea
would be making a single-photon light source first (e.g. adding a heavy
attenuation filter in front of a dim laser, so at any time, it's very likely
that only a single photon can get out on average, it's not strictly a single-
photon source, but close). Then the single photon hits a beam-splitter (e.g. a
half-silvered mirror), when the photon leaves the mirror, there are
photomultiplier tubes working at a thousand volts and enormous gain to detect
a single photon. There's a 50% chance that the photon will hit detector A, and
50% chance that it will hit detector B. Take notes of the result, and you have
built an amazing quantum random number generator.

[0] e.g. See the datasheet of the 2N3904 transistor,
[https://www.onsemi.com/pub/Collateral/2N3903-D.PDF](https://www.onsemi.com/pub/Collateral/2N3903-D.PDF)

~~~
EsssM7QVMehFPAs
You could also simply use an FM tuner and tune it in between stations for
atmospheric noise. Like random.org did for a long time. [0]

Cosmic quantum noise for all your random number needs (after some filtering).
Disclaimer: if you are under NSA attack you might have issues with this $5
setup.

[0] [https://www.hostingadvice.com/blog/random-dot-org-true-
rando...](https://www.hostingadvice.com/blog/random-dot-org-true-randomness-
reliable-results/)

------
muzzletov
You mean "It's impossible to predict the bias" :)

------
vermilingua
Would the uranium marbles be at all likely to cause bit errors? Would this
decrease the lifespan of the system?

~~~
tyingq
Some numbers for uranium glass:
[https://www.orau.org/ptp/collection/consumer%20products/vase...](https://www.orau.org/ptp/collection/consumer%20products/vaseline.htm)

Doesn't answer your question, but might be a start.

~~~
nategri
Author here. Even though its proximity puts it pretty far above background,
the marbles are still a fairly weak source, so from the "electronics logic
longevity" side it's not something I've really thought about. But the Geiger-
Muller tube does have a finite (though very large) number of events it can
record, so I cut the voltage to it when the device is in "clock mode" and not
functioning as an RNG.

------
dnpp123
Author should make a public API so anyone can have truly random numbers (with
some trust in the author ;)

------
jacquesm
In Chernobyl you likely do not actually need to add the marbles to get the
device to work.

~~~
acidburnNSA
My Geiger counter fires about once every two seconds from natural background
(and would on most parts of the world due to granite, cosmic rays, radon,
etc.). When I put my uranium mineral near it it goes off 600 times per second.

------
alex3413
How does one even get uranium marbles?

~~~
nategri
Author here.

They’re not actually that radioactive so they’re very easy to get ahold of.
Amazon and eBay might work (I got mine from one of those sources, I think),
but I also put a more specialized supplier in the parts list.

~~~
lightedman
Grab some Torbernite!

------
IIAOPSW
Hey whatever happened to your cat?

~~~
UncleEntity
It got bit by a Møøse.

