How Cloudflare Uses Lava Lamps to Encrypt the Internet
Cloudflare's San Francisco office has a wall of 100 lava lamps generating entropy for SSL/TLS encryption. Here's why computers can't be truly random.
Written by AI. Dev Kapoor

Photo: The PrimeTime / YouTube
In Cloudflare's San Francisco headquarters, there's a wall of 100 lava lamps doing something that sounds absurd: helping to encrypt a significant portion of internet traffic. Visitors can walk up to the lobby, stand in front of the glowing, undulating display, and become—briefly—part of the cryptographic infrastructure securing millions of websites.
This isn't performance art. It's a solution to one of computing's most persistent problems: computers are terrible at randomness.
The Problem: Computers Are Predictable by Design
Programmer and streamer ThePrimeagen recently walked through Cloudflare's lava lamp setup in a video that crystallizes why this matters. The core issue is deceptively simple: "Ultimately, a computer breaks down to just a series of if statements," he explains. Even sophisticated systems—large language models, complex algorithms—are deterministic at their foundation. Given the same input, they produce the same output. That predictability is exactly what makes them useful for most tasks.
But for encryption, predictability is poison.
Every SSL/TLS connection—the secure channels that protect your banking transactions, your Signal messages, your medical records in transit—depends on encryption keys that must be genuinely unpredictable. If an attacker can guess or predict the key, they can decrypt the data. The standard solution is pseudo-random number generators (PRNGs), which use algorithms to produce sequences that look random but are ultimately deterministic.
And deterministic means vulnerable.
When Predictable Randomness Breaks Bad
ThePrimeagen demonstrates this vulnerability live in his video, using just a few outputs from JavaScript's Math.random() function to predict subsequent values with perfect accuracy. "Now I'm sure there's a bunch of you right now like, 'Nah, that guy probably cheated. There's just it ain't possible to predict this kind of randomness,'" he says. "Well, it actually turns out no. A lot of random number generators you use are actually quite predictable."
The real-world consequences show up in places like casinos. A team of Russian hackers famously exploited predictable PRNGs in slot machines, streaming video of gameplay back to St. Petersburg where analysts reverse-engineered the machines' random number generation. They'd watch the game unfold, calculate the exact moment when the odds shifted favorably, then send a vibration to the player's phone—accounting for half a second of transmission lag plus 250 milliseconds of human reaction time. The result: roughly $250,000 per week from machines scattered globally, all because their randomness could be predicted.
Scale that vulnerability to internet encryption, and you're looking at a catastrophic scenario. If someone could predict Cloudflare's random number generation, they could potentially decrypt portions of global internet traffic—not through brute force, but through pattern recognition.
Enter the Lava Lamps
Cloudflare's solution is elegantly analog. A camera continuously photographs the wall of 100 lava lamps. Each lamp contains wax that, once heated, flows upward in constantly shifting patterns—sometimes blob-like, sometimes tubular, always different. The camera captures every pixel: luminosity variations, color saturation shifts, the interplay of light and shadow. When someone walks in front of the display, they become part of that captured chaos.
All of this visual data feeds into what's called a cryptographically secure pseudo-random number generator (CSPRNG)—a PRNG that meets stricter standards for unpredictability. The lava lamp imagery provides entropy: genuine disorder harvested from the physical world.
But Cloudflare doesn't rely solely on lava lamps. The system combines this visual entropy with randomness from two separate Linux machines (which gather their own entropy from system events—disk timing variations, network packet intervals, thermal noise). This layered approach means that even if someone covered the cameras, the system would continue generating sufficiently unpredictable data.
"So that means even if the cameras were to go down, they would actually continue to produce very random nature," ThePrimeagen notes. "You wouldn't be able to go, okay, the cameras are down for the next 20 minutes. We can guess."
Physical Chaos at Scale
What's particularly interesting is how Cloudflare's other offices implement the same principle through different physical systems. The London office photographs a double pendulum—a pendulum attached to another pendulum, creating mathematically chaotic motion that's impossible to predict beyond a few seconds. Singapore measures radioactive decay from a uranium pellet, exploiting quantum randomness at the atomic level.
Each approach captures something genuinely unpredictable from the physical world. "The real world is unpredictable whereas computers are just simply predictable," as ThePrimeagen puts it.
This isn't even a new idea. Silicon Graphics built a similar system called LavaRand back in 1996, though their patent has since expired. What Cloudflare brought was scale and operational redundancy—multiple entropy sources, multiple locations, systems designed to keep functioning even if individual components fail.
What This Reveals About Infrastructure
The lava lamp wall is often treated as quirky tech company decor—like Google's dinosaur skeleton or Amazon's Day 1 building. But it's actually infrastructure, doing real cryptographic work 24/7. The fact that it sits in a public lobby where anyone can see it and influence it isn't a security flaw; it's additional entropy.
This creates an odd situation where the most secure randomness generation happens in one of the most transparent ways possible. There's no black box here, no proprietary algorithm. Just a camera, some wax, and the fundamental unpredictability of physical systems.
It also highlights a tension in how we build secure systems. We've spent decades optimizing computers to be more deterministic, more reliable, more predictable. Then we need to bolt on physical randomness generators because that very predictability becomes a vulnerability in cryptographic contexts.
The question isn't whether Cloudflare's approach is clever—it demonstrably works. The question is what it says about the foundations of our secure infrastructure that we need to harvest chaos from lava lamps to make encryption trustworthy. And whether, as cryptographic demands increase and quantum computing threatens current encryption methods, we'll need even more creative sources of physical entropy.
For now, those lava lamps keep bubbling. And every time the wax shifts, another imperceptible contribution to keeping the internet secure.
—Dev Kapoor
We Watch Tech YouTube So You Don't Have To
Get the week's best tech insights, summarized and delivered to your inbox. No fluff, no spam.
More Like This
When Three MacBooks Beat One: The Distributed AI Experiment
Developer Alex Ziskind clusters three M5 Max MacBook Pros to run AI models too large for any single machine. The results reveal hard limits.
Cloudflare Just AI-Cloned Next.js and Open Source Is Shook
Cloudflare used AI to recreate Next.js in a week. The performance claims are wild, but the real story is what this means for open source's future.
Dozzle: The Docker Log Viewer That Does Less (On Purpose)
Dozzle is a 7MB tool that streams Docker logs to your browser. No storage, no database, no complexity. Better Stack shows why that's the point.
Unpacking Dr. Birch's Unique AES Key Schedule
Explore Dr. Birch’s creative take on AES key scheduling, blending coding and cryptography with unique twists.
Quantum Computing Finally Found Its Killer App: Breaking Stuff
Google just moved up the timeline for quantum computers to break encryption to 2029. After decades of promises, code-breaking is what quantum actually does.
Musk's Digital Optimus: AGI Vision Meets Project Chaos
Elon Musk announces Digital Optimus AI to automate office work, but leaked reports reveal the project collapsed at xAI. What's really happening?
Anthropic's Opus 4.7: When Safety Guardrails Lobotomize the Model
Anthropic's Opus 4.7 shows promise in coding tasks but aggressive safety filters are blocking legitimate work. Is the tooling worse than the model?
Matt Wolfe's YouTube Playbook: Money, AI & Workflow
Matt Wolfe opens the books on his YouTube AdSense, AI video workflow, and why he thinks faceless AI channels are mostly a losing bet.
RAG·vector embedding
2026-04-15This article is indexed as a 1536-dimensional vector for semantic retrieval. Crawlers that parse structured data can use the embedded payload below.