How Cloudflare Uses Lava Lamps to Encrypt the Internet
Cloudflare HQ — San Francisco
100 Lava Lamps Protecting the Internet
Somewhere in Cloudflare's San Francisco lobby, a camera stares at a wall of 100 lava lamps — 24 hours a day, 7 days a week. It's not art. It's not a screensaver. It's one of the most important pieces of internet security infrastructure on the planet.
This is the story of how melting wax, swinging pendulums, and radioactive decay help encrypt roughly 20% of all web traffic.
The Problem: Computers Aren't Random
Computers are fundamentally logical and predictable. Every operation follows an instruction set. Every calculation is deterministic. When a computer needs a "random" number, it uses a mathematical algorithm called a Pseudo-Random Number Generator (PRNG).
PRNGs are fast and good enough for most tasks — shuffling a playlist, spawning enemies in a game. But they have a fatal flaw: if you know the starting seed (the initial value fed into the algorithm), you can predict every number it will ever produce.
For encryption, this is a disaster. TLS certificates, HTTPS handshakes, session tokens — all rely on numbers that nobody can predict. If your randomness is predictable, your encryption is breakable.
Russian hackers recorded the screens of casino slot machines, sent the footage to a remote server, and reverse-engineered the PRNG seeds. They could predict exactly when a machine would pay out — netting $250,000 per week until caught. The machines weren't broken. The randomness was.
The Solution: LavaRand
To generate Cryptographically Secure Pseudo-Random Numbers (CSPRNG), you need a seed that is truly unpredictable. No algorithm. No pattern. No way to reverse-engineer it.
Cloudflare's answer? The physical world.
In their San Francisco headquarters, a camera continuously photographs a wall of 100 lava lamps. The movement of the wax inside each lamp is governed by chaotic fluid dynamics — sensitive to temperature, air currents, vibrations, and countless micro-variables that are impossible to model or predict.
The camera converts this scene into raw pixel data. Every frame produces millions of bytes that are inherently random — different every single time. This data becomes the entropy seed for Cloudflare's random number generators.
100 lava lamps filmed continuously. The chaotic motion of heated wax produces pixel data that is mathematically unpredictable. If someone walks through the lobby, their shadow adds even more entropy to the system — making it harder to predict, not easier to disrupt.
Here's the beautiful part: if a person walks in front of the lamps — an employee heading to lunch, a visitor on a tour — they inadvertently add more chaos to the system. Their shadow, their movement, the light they block and reflect — it all makes the entropy better, not worse.
Not Just Lava Lamps: Global Entropy
Cloudflare doesn't put all their randomness in one basket. Different offices around the world use different physical sources of entropy:
A double pendulum — a pendulum attached to another pendulum — produces motion that is mathematically chaotic. Even the tiniest difference in starting position leads to wildly different trajectories. It's one of the simplest physical systems that exhibits true chaos.
A small pellet of uranium sits inside a Geiger counter. Radioactive decay is governed by quantum mechanics — the timing of each decay event is fundamentally unpredictable. Not "hard to predict." Physically, mathematically impossible to predict. It's the gold standard of randomness.
Defense in Depth
What happens if the camera breaks? If the lava lamps are turned off? Cloudflare thought of that.
The physical entropy sources are combined with the operating system's built-in random number generators (like Linux's /dev/urandom) using cryptographic mixing. This means:
- If the lava lamp camera fails → the system falls back to OS entropy
- If the OS entropy is somehow compromised → the lava lamp data protects it
- Both sources are mixed together → the result is at least as strong as the strongest input
This is a textbook example of defense in depth. No single point of failure. Multiple independent sources of randomness, cryptographically combined.
A Brief History of LavaRand
Cloudflare's lava lamp wall is iconic, but they weren't the first to have the idea.
Why It Matters
Every time you visit a website protected by Cloudflare — and there are millions of them — the TLS handshake that encrypts your connection depends on a random number. That number's unpredictability is what keeps your data safe from eavesdroppers, man-in-the-middle attacks, and replay attacks.
The lava lamps aren't a gimmick. They're a practical, elegant solution to one of the hardest problems in computer science: where does true randomness come from in a deterministic machine?
The answer, it turns out, is the messy, unpredictable, beautifully chaotic physical world.
Read next: Forget Lava Lamps — Cloudflare's Edge Cloud Changed Everything