how do random number generators work?

811 views

how do random number generators work?

In: Technology

5 Answers

Anonymous 0 Comments

A random number generator is a computer application that produces a seemingly random number. The specific traits of this number are that it can be equally likely to be any number in the range, and that it cannot be predicted.

The easiest way to accomplish this is to do some math that cycles a very large number, and then only ever returns a small portion from the end of it. Since you never see the whole number, you can’t really infer the whole thing.

Now the tricky part is handling the start of the sequence. You can’t just start with something static like 0, because you would cycle through the same thing each time.

You can use things like the time as a seed number to start from, but depending on the accuracy of the time, you could get two sequences starting that are the exact same. You could also, as an attacker, figure out the time and predict random numbers, leading to encryption vulnerabilities.

From a more complex standpoint, you can measure physical things to get an RNG. For instance, access times to a platter hard drive, movement of a mouse, or time between keyboard presses. However, servers don’t have access to a lot of these, so you can go one step further.

For things that don’t need to be cryptographically secure (like, say, RNG in a game), they can measure player-based events from the server like latency times. For cryptographically secure systems, you can create a system designed to give RNG Seeds. There is a very well known one by CloudFlare using Lava Lamps. They just have cameras pointed at a wall of lava lamps, and use the video feed to seed random numbers. Since lava lamps are a chaotic system, you can’t really predict what the image the cameras will be processing is. There’s a great video about this one [here](https://www.youtube.com/watch?v=1cUUfMeOijg).

You are viewing 1 out of 5 answers, click here to view all answers.