Skip to content
Minute Campus.

Everyday computer scienceLesson 061 min

Why is your computer's “random” number not random?

A computer cannot roll dice. It runs a formula from a starting number called a seed, and the same seed gives the same list every time, which is why it is called pseudo-random. That is fine for a game but a problem for security keys, because anyone who learns the seed can work out what follows. Cloudflare mixes photographs of lava lamps into its seed.

Remember

Real surprise has to come from the physical world, not from rules.

Sources

Checked at the source.

Every claim in the lesson was checked against these before it was recorded.

  1. 1Harnessing chaos in Cloudflare officesCloudflare · 8 Mar 2024 · read 4 Oct 2026Describes photographing a wall of lava lamps and mixing the result into a seed for a secure random generator.

Transcript

The lesson, word for word.

Read it at your own pace, or search the page for a term.

Your computer cannot roll dice. Ask it for a random number, and it runs a formula. The formula starts from one number, called a seed, and produces a long list that looks random. But give it the same seed, and you get the same list, every time. That is why it is called pseudo-random. For a game, that is fine. For security, it is a problem. The keys that protect your passwords and payments must be impossible to guess. If someone learns the seed, they can work out everything after it. So the seed has to come from something truly unpredictable. Cloudflare does this with a wall of lava lamps in San Francisco. A camera photographs them. The blobs never repeat, so each picture is different, and is turned into numbers that are mixed into the seed. The lesson: a computer follows rules, so real surprise has to come from the physical world.

Questions? Comment on the lesson on YouTube

New lessons every day.

Follow Minute Campus where you already scroll.