How Random Number Generators Work

Virtually all online industries nowadays use random numbers and sequences. They allow you to send money securely from account to account or protect sensitive data in electronic communications, for example. Applications and programs using so-called random number generators acquire these random numbers.

You may wonder how a computer can generate truly random numbers. Where does the “randomness” come from? If it is just a piece of code, can’t the numbers generated be predicted?

We generally divide random numbers into two types depending on how they are generated: “true” and pseudo-random.

True Random Numbers

To generate a “true” random number, the computer measures some physical phenomenon that takes place outside the computer. For example, it might measure the radioactive decay of an atom. This is because, according to quantum theory, there is no way of knowing for sure when this will happen, so it is essentially pure randomness.

Moving more into our everyday reality, a computer could also rely on atmospheric noise, or simply use the exact time of a keystroke as a source of unpredictable data.

Pseudo-Random Numbers

Pseudorandom numbers are an alternative to “true” random numbers. A computer can use an algorithm to generate them that appears random but is predictable. This is because it does not collect any random data from the environment.

It is a kind of computer program that generates a random sequence of numbers. This algorithm creates a new, unique result every millisecond. It is also important to note that a random number generator can’t be programmed to perform a specific task. It must be designed to have the capability to generate a large number of numbers.

A Practical Use for Random Numbers

They are useful for many different purposes. In addition to applications where their use is obvious, such as statistics, password generators, odds calculators for games of chance or making unexpected inferences in computer games, randomness is also crucial in cryptography.

In cryptography, random numbers are used in key generation. Since cryptography in particular is used to encrypt communications, send often sensitive data, and even financial transactions, it is ideal that these keys be completely random with no possibility of prediction.

It can be thought of as a sequence of numbers that you cannot tell in advance what the next digit will be. That is why hardware generators that use some random natural phenomenon, such as a voltage fluctuation in an electronic component due to temperature. The problem is that few truly random phenomena are also useful for generating numbers.

When it comes to gaming, for example, there is no need for such intense security measures. Therefore, all game and software developers are using pseudorandom number generators. Don’t be misled. Even these algorithms are very difficult to predict. For the very reason that to sequence the numbers, you need to know, what algorithm is used in the software.