356 points · by prando · 8y ago · 151 comments
It would probably work better in a colder room, too.
I wonder if Cloudflare was inspired by that.
-- https://blog.cloudflare.com/randomness-101-lavarand-in-produ...
That said, this doubles as a public art installation in their lobby - something many companies spend thousands (or millions!) of dollars on. So it's not just PR, it's actually surprisingly practical.
This then goes to the question of "where are you getting a focused gamma ray beam that has sufficient rate that you're able to modulate the period between two detection events?"
They (CF) discuss this on their deep dive:
>>>The flow of the “lava” in a lava lamp is very unpredictable,6 and so the entropy in those lamps is incredibly high. Even if we conservatively assume that the camera has a resolution of 100x100 pixels (of course it’s actually much higher) and that an attacker can guess the value of any pixel of that image to within one bit of precision (e.g., they know that a particular pixel has a red value of either 123 or 124, but they aren’t sure which it is), then the total amount of entropy produced by the image is 100x100x3 = 30,000 bits (the x3 is because each pixel comprises three values - a red, a green, and a blue channel). This is orders of magnitude more entropy than we need. [1]
1: https://blog.cloudflare.com/lavarand-in-production-the-nitty...
"Hopefully we’ll never need LavaRand. Hopefully, the primary entropy sources used by our production machines will remain secure, and LavaRand will serve little purpose beyond adding some flair to our office. But if it turns out that we’re wrong, and that our randomness sources in production are actually flawed, then hopefully LavaRand will be our hedge, making it just a little bit harder to hack Cloudflare."
It's also a fairly novel way to explain to people that `random()` isn't truly random.
Virtually any sensor measuring real world data will be imprecise in the last 1-4 bits. Take 256 raw samples from virtually any real world sensor, run the raw data through SHA-256, voila, you have 256 random bits that's secure against the overwhelming majority of hackers. Take 256,000 samples, run the raw data through SHA-256, now you have 256 random bits that's secure against the NSA.
Cameras are great for this, but first you have to ensure that you're getting the raw data and not an image processed with HDR or jpeg compression or whatever special sauce Google/Apple do these days, and you also have to test to ensure that the image isn't overexposed. If it's an 8 bit sensor and all pixels are pegged at 255 you don't have useful randomness. Although the opposite isn't true: it's impossible to peg all pixels at 0. You'll always get values of 1-10 or so with the same pixels fluctuating +/- 1 or so, even in a perfect darkroom with perfect insulation from cosmic rays and background radiation.
The average smartphone is packed full of gadgets that could be used to generate random data after running it through whitening. Accelerometers, magnetic compass, capacitance of each pixel of the touch sensor, all the radio antennas pulling atmospheric noise, (CDMA, GSM, GPS, bluetooth ...) microphone, camera...
The lava lamps themselves might make the process more efficient, because now some of the higher order bits are random as well. But honestly, from a realistic security standpoint... they're just as well off taking pictures of a blank, uniformly lit white wall. As long as they do whitening properly.
edit: It's still super cool though. Just not... in terms of temperature. It's probably really hot.
The classic HotBits ( https://www.fourmilab.ch/hotbits/ ) uses radioactive decay to get its random data. This generates 100 bytes per second of randomness. But that also depends on getting a radiation source. A single one costs about $80. A lava lamp costs $10.
Working off the list of isotopes that they provide, You've got things that have half-lives. The issue there is that the way that one generates random data from radioactivity is get an event (A), and then get another event (B) and another event (C). The time between A and B is compared to the time between B and C. If AB is shorter than CD you've got a 1. If its longer than you've got a 0. If its the same, then throw about AB. As the material decays, its rate of generating bits of data slows down.
Lava lamps are easily replaceable and don't have half-lives.
I suspect there's also issue with "here is our lead lined vault where we keep a bunch of radioactive disks to generate random data". Sure, the units are micro Curie (the most active one is a 10uCi Cesium 137). But... do you want to go into that room and change a burnt out detector? How about swapping out a lava lamp because of a burnt out bulb?
Source: I worked in a lab
Probably, but it is indeed pretty cool. I appreciate when people take something potentially mundane and bring style to it.
Other junction breakdowns have noise as well, resistive noise is very low power. Atmospheric noise and background noise is a thing too, but I'd guess they are too susceptible to interference by malicious actors...
A big plus over the alternatives I see mentioned is that you can easily see if it's working right now.
What bothers me is that at least 80% of the wall is unrandomized wall and lampfeet.
tptacek tried to explain some of the problems in this intuition at https://sockpuppet.org/blog/2014/02/25/safely-generate-rando..., which relates to why he's so annoyed at some things people have said in this thread (and when discussing CSPRNG seeding in other places).
I like the idea of feeling physically unpredictable data into the CSPRNG, but for most purposes it's a misconception that doing so on an ongoing basis is in any way required by the design or that heavy users of randomness like CloudFlare would "run out of entropy" or "exhaust their entropy pool" if they didn't do so. The design of existing CSPRNGs would let CloudFlare use /dev/urandom for as long as it likes after securely seeding it just once, and there's no known cryptanalytic attack to which this practice would be vulnerable.
Is the idea not that it is information-theoretically safe, but rather that the computational requirements are too great to figure out the state of the random-number generator even after a large amount of observed output?
There was something either in that piece or in another one by another crypto expert saying that if we don't believe that CSPRNGs have this security property, we shouldn't believe in the symmetric ciphers that we use them to generate key material for either, because they are constructed using the same kinds of techniques.
I also don't remember what Matthew Green disagreed with Thomas about here.
* https://www.2uo.de/myths-about-urandom/
The "another crypto expert" mentioned by schoen is Daniel J. Bernstein, quoted directly by Hühn.
It mostly brings up misconceptions I never had, and attacks those. For example, why would it matter that /dev/random gets its output from the same CSPRNG as /dev/urandom (or any other CSPRNG)? Shouldn't the output of the CSPRNG, assuming its state is large enough, contain as much entropy as its input?
The focus on giving me orders about what I should do, rather than telling me why, also gets old somewhere around the first time.
https://blog.cloudflare.com/lavarand-in-production-the-nitty...
https://blog.cloudflare.com/randomness-101-lavarand-in-produ...
https://github.com/waywardgeek/infnoise/blob/master/README.m...
Ignoring the fact that is very little money in Silicon Valley. Lava lamps consume a large amount of electricity in order to generate the heat they need. There are cheaper better ways to generate randomness, this is purely for spectacle clearly.
It makes me nervous more than anything. If that's the front they put up, inside is there a Rube Goldberg machine that triggers DDoS protection?
But there are probably a bunch of other Brownian motion machines you could use that take a lot less power. Like those glitter lamps. You’d need a higher res camera.
https://blog.cloudflare.com/lavarand-in-production-the-nitty...
https://blog.cloudflare.com/randomness-101-lavarand-in-produ...
https://blog.cloudflare.com/lavarand-in-production-the-nitty...
So probably not a good idea.
NIST Beacon is more intended for things like lottery drawings, where you want to prove that you're generating the random numbers in an unbiased manner.
Edit: I see this is addressed partially by wkandek's link elsewhere in this discussion.
That’s not what “computer codes” and “algorithms” mean.
Some people say that, in theory, it could be cracked however, i tried and its impossible, modern computers are so complex and fast that it gives enough entropy.
The speed or complexity of computers is irrelevant.
This seems wildly insecure and much more likely to represent a weak link than to actually aid in randomness.
The effort involved in doing this would maybe be as taxing as brute-forcing the keys in the first place. It seems gimmicky but they're almost surely producing reliable random data that would be almost impossible to simulate otherwise.
Don't overcomplicate your threat model with non-existent risks
(I don't have any problem with what CloudFlare is doing.)
Edit: While I was writing this comment, drewbug linked to the exact DJB post I was thinking of. Thanks!