
Crystallization robot generates true random numbers via chemistry stochasticity - bookofjoe
https://www.cell.com/matter/fulltext/S2590-2385(20)30024-2?_returnURL=https%3A%2F%2Flinkinghub.elsevier.com%2Fretrieve%2Fpii%2FS2590238520300242%3Fshowall%3Dtrue
======
theophrastus
My point of view on this is from a career as a protein x-ray crystallographer,
not a mathematician nor computer scientist. I've watched countless tiny
crystal dishes, the vast majority of which produce no useful crystals. And
while it seems frustratingly random, (especially when faced with months and
years of failure), in retrospect from a successful series there are always
conditions which likely make _causative_ sense: changes in temperature, stocks
of substituent additives, shifts of pH due to carbon dioxide in the air,
vibration (or lack thereof) from nearby construction or robotic systems,
amount of pollen or air pollution to add nucleation sites. Some crystals will
only form along the edges of the crystal dishes; perhaps because there's some
complementary dimensions of the molecular surface there. It's a rich list of
possibilities, but all would speak against this being as 'random' as say, the
exact time of the emergence of an x-ray photon from our source. Nonetheless
it's a very creative use of a lot of otherwise non-useful data from vast
arrays of robot observed crystallization dishes.

~~~
dahart
Ah this is really interesting, it didn’t occur to me while reading the paper,
I just assumed crystals grow reliably.

Because they’re running sha512 on the crystal data, the output will always
look random. But if the crystals have a bias in their preferred growth
patterns, especially if there’s a non-trivial probability that they don’t
grow, knowing that may be an attack vector, you can use that information to
simulate the process and possibly produce the same output.

“A raw binary sequence was then generated by assigning 5 bytes per crystal
pixel based on size, orientation, and color, with crystals ordered from top
left to bottom right in the vial region (see Supplemental Information for
details). These bytes were concatenated with those of adjacent crystal pixels
and of subsequent crystals to generate a long binary sequence. This sequence
was then split into sections of 64 bytes, and the sha512 algorithm was applied
to each of these sections. The resulting binary sequences were concatenated to
form a larger-output binary sequence.”

The sha512 is the reason the output is uniform, but if I were doing this, I’d
throw a time stamp and maybe some calls to drand48() or something into the
pre-sha mix, to guarantee that the input can’t be easily replicated.

------
hannob
Things like this, i.e. getting random numbers from some real-world process
that is supposedly perfectly random, come up every now and then and I keep
repeating: There's no real problem in cryptographic random number generation
that such a system solves. We have problems with RNGs, but they usually come
down to either bugs, boot entropy problems on embedded devices or using an
insecure rng for security purposes. None of that is solved by any form of
physics or chemistry based RNG.

The claims themselve are also kinda very odd: "Encryption capability better
than Mersenne Twister pseudorandom number generator". Huh? Really? You're
better than a system that we know is insecure and that nobody should use for
cryptographic contexts?

~~~
ArtWomb
Simple boson sampling, if you can get a technique that maps photons to RNGs in
"O(1)" fashion, could conceivably provide a high-throughput infinite source of
highly-entropic randomness. And it's probably only needed in <<< %1 of use
cases ;)

But understanding how Nature computes randomness is quite enlightening. Just
yesterday morning on a hike I saw some long spikey ice crystals recently
formed on a creek bed and the patterns were more aesthetically pleasing than
any geometric computer art. In the example regarding crystallization, it is an
absolute mystery how the nucleating solid particles will choose their exact
equilibrium compositions out of the infinite range of possibilities. And then
communicate that quantity to the far reaches of the liquid-solid forming
interface!

~~~
enkid
Nature doesn't compute random numbers, it has underlying processes either
random or so opaque as to be effectively random.

~~~
wongarsu
Except for quantum mechanics. We can compute probabilities perfectly, but the
actual outcome of any one event (e.g. the destination of any one photon) is
unpredictable.

Any attempts to explain quantum mechanics as being deterministic require
faster-than-light communication and are generally seen as unlikely [1] (unless
we are in a simulation and there's a global random number generator, of
course).

You can buy PCIe cards exploiting this for random number generation [2]

1: [https://en.wikipedia.org/wiki/Hidden-
variable_theory](https://en.wikipedia.org/wiki/Hidden-variable_theory)

2: [https://www.idquantique.com/random-number-
generation/product...](https://www.idquantique.com/random-number-
generation/products/quantis-random-number-generator/)

~~~
sysbin
What's your definition of unpredictable & random?

I'm interested because you write off quantum mechanics as unlikely to be
deterministic. When everything being deterministic is more realistic and from
scientific understanding of systems working in nature.

Contrary to determinism would be true magic. Having a force without any cause.
That just feels like lack of understanding.

~~~
titzer
> Contrary to determinism would be true magic.

I used to think like this, that somehow underneath the apparent randomness of
quantum mechanics there is a deterministic process that is either being
sampled too slowly or too granular to see its fundamentally discrete nature.

Unfortunately that is not the case. No experiment has ever measured a
significant deviance from truly random for a quantum-mechanical experiment. We
have no better description for the outcome of quantum experiments than the
probability distributions that come out of the Schroedinger equation.

Welcome to theory from 80 years ago, backed by every single experiment ever
done in the intervening time.

The bottom of our universe is math manipulating probability equations, and we
can't see beneath it.

Sorry. I was hopeful too.

~~~
sysbin
> Unfortunately that is not the case.

The thing is we cannot say it's not the case. I used to think like you as
well.

That's the disturbing problem I witness with people writing off quantum
mechanics as not being deterministic. Magic as an adult is known to be
trickery and only seems to be magic when lacking understanding of what forces
is resulting in the trickery.

Super determinism is a situation where we could be actually witnessing
determinism from quantum mechanics but similar to what we believe is true
randomness and cannot be observed for the forces causing it.

The only thing I'm hopeful for is witnessing in my life a way to explain how
something cannot be deterministic with real understanding. Besides people just
thinking it must be random and if I spend hours all day thinking about this it
seems like it cannot happen because it's an impossibility.

~~~
titzer
> Besides people just thinking it must be random and if I spend hours all day
> thinking about this it seems like it cannot happen because it's an
> impossibility.

It's not just people thinking it must be random or it isn't random. Literally
every single experiment ever conducted has failed to turn up any evidence of a
deterministic process underlying the apparent randomness of quantum mechanics.
We can't keep this hope alive indefinitely just because our thinking is warped
by everyday experience appearing classical and discrete. We have absolutely no
reason to demand our universe be deterministic, and every reason to conclude
it isn't. We need to reject the idea that our universe is intuitive to human
minds.

For example, Bell's Theorem _rules out_ local hidden variables. General
Relativity says spacetime is warped in non-visualizable ways and that
simultaneity is not even universal. That should be enough of a mindfuck for us
to discard our puny human understanding of things, yet we don't.

~~~
sysbin
Bell's theorem doesn't rule out super determinism. So it's kind of whatever
you want to believe (kind of situation) when it comes to not being able to
have proof one side or the other. I upvoted your post btw.

------
leecronin
The main point of this was to see if can establish a workflow that produces
random numbers. Then by changing the nature of the materials / crystal growth
I wanted to see if the data tells us about order / disorder transitions in the
material. That is one idea anyway.

------
bufferoverflow
There are much easier ways to generate true random numbers. Cover any webcam
and read out the lowest bit information of every frame, it should be full of
noise. This gives you a ton of truly random data.

~~~
DonHopkins
If you're using your camera for random numbers, make sure you're talking to
the raw device directly, and not getting an image that's been heavily
massaged, like with an iPhone's HDR / Deep Fusion cameras. And use a lens cap
instead of pointing it at a Lava Lamp, because that's patented!

[https://www.wired.com/2003/08/random/](https://www.wired.com/2003/08/random/)

>Now Noll is working with Cooper on an improved RNG called LavaRnd (which
debuted in May at www.lavarnd.org). The new process replaces the lava lamps
with a more Zen-like source of entropy: a webcam with its lens cap on. The
chaotic thermal "noise" emitted by the webcam is digitized and put through a
hash algorithm that churns the number set, stripping unwanted sections of
predictability. The result is a cryptographically strong sequence of numbers,
ready for use in the real world. And because the new service is open source,
patent-free, and license-free, anyone will be able to cheaply build and
operate a LavaRnd server and receive the precious commodity free of charge - a
random act of kindness.

Careful with that lower bit, Eugene:

The pseudo-random number generator in the C library was really bad in earlier
versions of Unix. It still is bad, and it used to be patronizingly called
"simple", but now the title of the OpenBSD manual page finally recognizes rand
for what it is:

[https://man.openbsd.org/rand](https://man.openbsd.org/rand)

    
    
        NAME
    
            rand, rand_r, srand, srand_deterministic — bad pseudo-random number generator
    

It was so bad in SunOS 4.1.3 that the rand(3) manual NOTES section coyly
understated: "The spectral properties of rand() leave a great deal to be
desired."

So bad that the lower bit would actually alternate between 0 and 1 every time
you called it, so if you used "rand() & 1" to flip a coin, it would flip
perfectly back and forth between heads and tails forever.

[https://www.freebsd.org/cgi/man.cgi?query=rand&sektion=3&man...](https://www.freebsd.org/cgi/man.cgi?query=rand&sektion=3&manpath=SunOS+4.1.3)

    
    
        NOTES
    
            The spectral properties of rand() leave a great deal  to  be  desired.
            drand48(3)  and random(3)  provide much better, though more elaborate,
            random-number generators.
    
        BUGS
    
            The low bits of the numbers generated are not very random; use the mid-
            dle bits.  In particular the lowest bit alternates between 0 and 1.
    

[http://cpp.indi.frih.net/blog/2014/12/the-bell-has-tolled-
fo...](http://cpp.indi.frih.net/blog/2014/12/the-bell-has-tolled-for-rand/)

>Nothing about rand()‘s behaviour is required. rand() could legally return the
same value over and over every time you call it. It could have a period in the
single digits; or return alternating odd and even numbers (and one
implementation actually did this!). There have been some implementations that
are legendarily bad. The C11 standard actually says some implementations are
known to produce sequences with distressingly non-random low-order bits, and
advises against using it for serious purposes.

Bash and other shells build on top of that badness, and manage to make the bad
randomness infinitesimally worse, by not allowing repeated random numbers, for
some inexplicable reason. (See: Cargo Cult Programming)

[https://nullprogram.com/blog/2018/12/25/](https://nullprogram.com/blog/2018/12/25/)

>Like Bash, repeated values are not allowed. I suspect one shell got this idea
from the other.

    
    
        do {
            cur = (rand() >> rand_shift) & RANDMASK;
        } while (cur == last);
    

>Who came up with this strange idea first?

[https://en.wikipedia.org/wiki/Cargo_cult_programming](https://en.wikipedia.org/wiki/Cargo_cult_programming)

------
bjonnh
If journal editors were less easily wooed by technical stuff they have no idea
about and were able to bring in specialist reviewers, this would not pass.
Unfortunately in specialized journals, if you publish something that sounds
overly complex and highly technical for the reviewers of the journal, there is
a good chance the paper will go through unarmed, except for picky comments
about misplaced commas or not citing the work of the reviewer that is only
remotely related...

------
m3kw9
Maybe some environmental factors will tend to give you certain type of
entropy. How can you be sure?

