Advertisement

Mad Scientists Are Using Crystals to Generate Random Numbers

Photo credit: Getty/Photo illustration by PM
Photo credit: Getty/Photo illustration by PM

From Popular Mechanics

  • Computer scientists at the University of Glasgow have borrowed from the world of geology and crystals to help machines better generate random numbers.

  • While computers whip up "random" numbers rather predictably, the researchers discovered they could model number generation on the truly indiscriminate patterns in the crystallization process.

  • This revelation could lead to more robust, less calculable encryption schemes.


Because computers don't understand words or phrases in the same way people can, they speak a language of their own, using only two symbols: 0 and 1. This computing parlance is known as binary code, where one figure means "on" and the other means "off," allowing the machine to complete tasks, like storing data onto a hard drive.

To encrypt data, like your email messages, computers transform your words into a sea of random numbers, rendering the note completely useless without a decryption key, which can unshuffle the jargon and restore the original. The more random the numbers, the harder the encrypted message is to crack.

Both the beauty and pitfalls of computing come down to the machines' exacting nature in "random" number generation. Computers are slaves to patterns, just as humans are if we're asked to come up with a string of seemingly unrelated integers. In the end, they just aren't random enough.

So computer scientists at the University of Glasgow have turned to crystals to devise a better way to spawn random numbers. Turns out the crystallization process—wherein a liquid, like fiery-hot magma, forms a solid—is rather unpredictable.

"We monitored the crystallization for hundreds of parallel reactions using a webcam and found that crystal features in the images obtained could be used to generate true random numbers," the researchers write in their study, published in the scientific journal Matter.

Computers, Meet Entropy

Photo credit: Fotosearch - Getty Images
Photo credit: Fotosearch - Getty Images

In chemistry, crystal formation is stochastic, meaning it's a randomly determined process. Each time a reaction is performed, there are nearly infinite ways for particular reagents—substances or compounds added to a system to crate a reaction—to assemble. That means there's a high level of uncertainty in the process, as well as a high level of entropy, because the exact pathway the reaction takes will never be repeated.

Entropy, for its part, is a measure of randomness, which typically refers to the arrangements of atoms in a given system. As a general rule, entropy is always increasing, meaning that chemical reactions contribute to less and less predictability in the universe. This is referred to as the Second Law of Thermodynamics. It explicitly states that disorder, otherwise known as entropy, must always increase.

When you whisk milk into your scrambled egg mixture, for example, you no longer have separate milk and separate eggs, but an even mix of the two. Since entropy can never decrease, you'll never be able to return your eggs and milk to their original states. That makes the chemical reactions underlying the crystallization process particularly attractive to researchers who want to come up with increasingly random pools of numbers.

Automating Randomness

Photo credit: University of Glasgow
Photo credit: University of Glasgow

To test out that theory, researchers developed a fully automated system to both complete inorganic chemical reactions and grow crystals out of the reactions' products. The contraption was embedded into a computer numerical control (CNC) machine. Using rapid prototyping, the scientists affixed a camera to the device to take images of the crystals every 10 minutes as they solidified.

Next, image-segmentation algorithms looked at the pixels corresponding to the crystals. Then, a binarization algorithm converted the data into a series of 0s and 1s, as its name suggests, based on the geometry of the crystals. The process repeats until you have the desired length of binary code required for an encryption process.

Photo credit: University of Glasgow
Photo credit: University of Glasgow

Finally, for encryption purposes, the researchers tested out just how random their strings of binary code actually were. They tested their crystal-enabled random number generator against a frequently used pseudorandom number generator called the Mersenne Twister.

When the scientists compared the average time it took both the crystal-inspired random number generator and the Mersenne Twister to decrypt the message, their own generator won out.

"Using chemistry to generate random numbers may enhance the output's cryptographic security, as factors such as concentration, temperature, and chemical composition may affect the output number," the authors write. "An attacker would need to know which type of chemistry had been used in order to create the number, and this becomes increasingly infeasible as more types of chemistry and conditions are used to generate random numbers."

Moving forward, the research team says its automated crystal number generator could be miniaturized and incorporated into computer hardware to enable repeated cycles of random number generation, meaning future laptops and smartphones could become much more efficient at securely encrypting data.

You Might Also Like