A truly random number is hard to find. The numbers chosen by people are not random at all, and the pseudorandom numbers created by computers are not very random either. Now scientists have developed a way to generate random numbers from a genuine source of randomness – the unpredictable stage of exactly when, where and how a crystal starts to grow in a solution.

‘Generating genuine random numbers is really hard,’ says Lee Cronin of the University of Glasgow. Randomness in chemistry is usually called stochasticity, but it means much the same thing.

An image showing chemical schemes for process investigation

Source: © 2020 Edward C Lee/Elsevier Inc

Three different chemicals were used to generate true random numbers – copper sulfate, a tungsten polyoxometalate salt and a cobalt coordination cluster 

Cronin’s team has developed a robot that can automatically grow crystals in a 10 by 10 array of vials, take photographs of them, and use measurements of their size, orientation, and colour to generate strings of random numbers. The researchers analysed the numbers generated from crystals grown in three solutions – including a solution of copper sulfate – and found that they all passed statistical tests for the quality of their randomness.

Computers are designed to be predictable, so they are bad at generating random numbers. Most can only create pseudorandom numbers from almost-random events, such as the time between keystrokes. But in theory those can be figured out if you know enough about the starting conditions.

Pseudorandom numbers are random enough for many purposes, but not for critical applications like mathematical modelling and data encryption, which is now used for everything from credit cards to website passwords.

Some computers can sample unpredictable physical processes, like thermal noise or the photoelectric effect, to generate true random numbers. Random numbers can also be generated from radioactive decay or atmospheric noise. And the content network Cloudflare relies on a spectacular random source for its internet encryption: a wall of 100 lava lamps.

To prove that their system was usefully random, Cronin’s team used their crystal-derived numbers to encrypt a single word – ‘crystal!’. Their system’s performance proved to be as good as an encryption of the same word using a pseudorandom number generator.

Cronin has built chemistry robots before – his Chemputer performs sequences of organic synthesis tasks. The latest robot could be developed into a hardware random number generator, he says, but its real purpose is to study stochastic chemistry, such as disordered materials like porous liquids or the defects in solar cell materials.

‘Does the quality of a random number tell us that a material has a better distribution of defects?’ Cronin asks. ‘Can we make more efficient solar cells if we optimise the distribution of defects, as read out by the quality of the random number?’

‘One would have expected such a macroscopic source of randomness to be subject to experimental systematic deviations, or autocorrelations from randomness,’ yet Cronin’s method seems to generate high-quality random numbers, says Manuel Laso at the Polytechnic University of Madrid, who studies randomness in crystals.

‘The properties of various materials can depend strongly on defects, and sometimes we rely on defects for properties,’ says Graeme Day at the University of Southampton. ‘Having this as a way to measure the randomness of defects, and to optimise this, is an interesting direction.’

 This article was updated on 20 February 2020. The previous version incorrectly stated that the crystal-based encryption method outperformed encryption using a pseudorandom number generator.