Locking up super-secret information with digital encryption has become even more secure with the production of numbers that aren’t just ‘nearly random’, but are truly unpredictable in every sense of the word.

Using the data generated by a three-year-old experiment on quantum entanglement, the US National Institute of Standards and Technology (NIST) recently generated codes that are guaranteed to be one of a kind, and it could set a new landmark in communications.

On one level, randomness is an easy thing to grasp. We flip coins, roll dice, and pick cards with a basic sense that the outcome can’t be easily predicted.

The problem is that word ‘easily’.

With enough information, whether it’s simple card counting or knowing the starting position of the coin, we can improve our odds of correctly guessing what the outcome will be.

That’s because behind these ‘random’ things there are classical laws governing their future paths, such as the force on the coin equals its mass times acceleration.

Casinos might have rules against card-counters, but if you want to use a code to encrypt the message between your phone and your bank, you’d want to be absolutely certain nobody could unravel your randomness.

The easiest way to do this is to rely on a system which is chaotic, where there are so many rules at work on so many levels it’d be virtually impossible to keep track.

Some computer generated algorithms manage this. Other systems tap into messy features of our environment, such as noise in the atmosphere.

Random number generators like the one provided by the Australian National University use fluctuating systems of particles popping in and out of a vacuum.

They often claim to be ‘truly’ random, but there’s still room for debate.

“It’s hard to guarantee that a given classical source is really unpredictable,” says NIST mathematician Peter Bierhorst.

“Our quantum source and protocol is like a fail-safe. We’re sure that no one can predict our numbers.”

That’s because unlike chaotic systems – which are messy but still fundamentally based on rules that could theoretically be determined – NIST’s generator drills down into something that by definition can’t be known.

In 2015, NIST conducted an experiment aiming to close loopholes on a theory that ultimately proves Einstein wrong on at least one account in physics.

Debates in science get no bigger than the one over whether quantum physics is a complete theory or not.

According to legends like Erwin Heisenberg and Neils Bohr, reality is built on foundations of probability, in that there’s no ‘hidden’ law we can find that will tell us whether an outcome will be one way or another.

Einstein, on the other hand, claimed on multiple occasions that ‘God does not play dice’, and that one day we’ll complete quantum theory with just such a rule that removes the ‘maybe’ from the equation.

Decades later, a man named John Stewart Bell developed a proof that showed either we’ve got it terribly wrong on quantum physics, or Bohr is right and there is indeed no rule on a local level.

Ever since then physics experiments have one flavour or another have explored possible loopholes in Bell’s ideas, closing them one by one.

NIST’s experiment did this by separating pairs of photons that were entangled so if one had the particle equivalent of a left shoe, it was immediately known the other photon had the right one.

They then eliminated loopholes and crunched the numbers to show that there were no hidden rules which could tell a photon which shoe it wore. In other words, it was a truly random choice and they could put their stamp on it.

“We’re very sure we’re seeing quantum randomness because only a quantum system could produce these statistical correlations between our measurement choices and outcomes,” says Bierhost.

Confident that this was as random as random gets, NIST has proceeded to use this test of Bell’s theorem to pop out strings of numbers nobody could ever guess at a rate of 1,024 bits every 10 minutes.

Their statistical tests on these bits then shows they fit Bell’s conclusion of there being no locally hidden rules lurking behind the lottery of 1s and 0s.

This isn’t the first random number generator to make use of quantum probability – truly random numbers have been made before.

The problem is that solid guarantee that what seems random hasn’t been unfairly influenced by a classical rule somewhere in the process. And in encryption, any possible pattern is a risk.

NIST’s random numbers won’t make for good encryption, given they’re made public. But their process could help ensure that when we say a code is random, we really do mean it this time.

This research was published in *Nature*.