News for hackers. Stuff that matters.
Re:Encryption Lava Lamps (2017) by jdc on Friday December 11, 2020 @08:42PM (#25394402)
What's the best entropy bang--for-your-buck < $100?
Re:Encryption Lava Lamps (2017) by frob on Friday December 11, 2020 @09:02PM (#25394589)
Read the voltage drop across a high-value resistor at room temperature. There are random fluctuations proportional to the temperature and resistor value. You can use these fluctuations to generate unifromly distributed random numbers. https://en.m.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_nois...
Re:Encryption Lava Lamps (2017) by amenghra on Friday December 11, 2020 @08:48PM (#25394455)
Flip a penny twice, if you get heads followed by tails, write down 0. If you get tails, followed by heads, write down 1. Otherwise ignore the two flips. Rinse and repeat until you have enough bits.

The purpose of flipping twice is that it offsets any potential static bias (caused eg by weight difference) between the two sides.

Re:Encryption Lava Lamps (2017) by amenghra on Friday December 11, 2020 @09:23PM (#25394738)
Common ways to generate entropy in a way that’s friendly to computers include: measuring noise from a zener (or other electronic component), delta between two or more oscillators, or timing between external events (eg keystrokes, packets, etc). These are all super cheap to manufacture (~$1). If you want to go high end, you can spent ~$1000 and get a generator based on some quantum property (photon spin or background radiation detector).

Computers will typically combine two or more sources of entropy. In newer tls version handshakes, the entropy from both, the server and client comes into play. So there’s ways to build defense in depth.

Re:Encryption Lava Lamps (2017) by faeyanpiraat on Saturday December 12, 2020 @01:25AM (#25396103)
Truerng claims this on 100MB of generated data:

Entropy = 7.999998 bits per byte.

If you can fit this quality on a usb, why didn’t motherboards contain a circuit like that?

Maybe they do on server boards?

Re:Encryption Lava Lamps (2017) by comex on Saturday December 12, 2020 @01:54AM (#25396254)
That's what RDRAND is - well, it's not the same physical mechanism as TrueRNG, but it is a fast hardware random number generator built into the CPU.
Re:Encryption Lava Lamps (2017) by Q_is_4_Quantum on Saturday December 12, 2020 @07:23AM (#25397816)
There is a fun generalization of the game. Assume the penny has (unknown) bias p. You want to output a new flip with bias some function f(p). So f(p)=1/2 is what you described, ie how to get a fair flip. For some functions it can be even easier, e.g. f(p)=p^2 - definitely only requires two flips.

How about:

f(p)=p^2/(p^2+(1-p)^2)

f(p)=2p(1-p)

f(p)=3p(1-p)

f(p)=sqrt(p)

The last two are tricky, I took them from a paper "functions arising from coin flipping" by Wastlund. (The quantum generalization is even more fun, but this text box is too small to contain it.)

Re:Encryption Lava Lamps (2017) by wodenokoto on Saturday December 12, 2020 @04:44AM (#25397080)
Wasn’t there a paper that showed it is basically impossible to load a physical coin?
Re:Encryption Lava Lamps (2017) by gspr on Saturday December 12, 2020 @05:23AM (#25397282)
AKA von Neumann debiasing, or the von Neumann trick.
Re:Encryption Lava Lamps (2017) by BelenusMordred on Friday December 11, 2020 @09:47PM (#25394912)
> bang--for-your-buck

Testing for randomness is impossible in the YES/NO sense, so the best we have is statistical test batteries like NIST's 800-22, DieHarder and TestU01.

I own a Truerng and a Onerng, both are under $50. They performed better on Dieharder than my computer's Intel RNG. Not by a huge margin, but still. All 3 passed the minimum requirements of course.

Re:Encryption Lava Lamps (2017) by ogre_codes on Friday December 11, 2020 @08:50PM (#25394469)
Two are close I think.

A capped webcamera, CCDs pick up enough stray electrons to be reliable source of entropy.

A old cheap radio tuned to static plugged into your microphone port.

https://www.mentalfloss.com/article/81946/7-sources-randomne...

Re:Encryption Lava Lamps (2017) by saithound on Friday December 11, 2020 @11:26PM (#25395538)
> webcamera, CCDs pick up enough stray electrons to be reliable source of entropy.

Ironically, this is the same setup as the lavalamps, but without having to pay for the lava lamps.

Re:Encryption Lava Lamps (2017) by ogre_codes on Saturday December 12, 2020 @02:20AM (#25396389)
I believe they figured out the lens cap hack when there was a lava lamp failure.
Re:Encryption Lava Lamps (2017) by brodie on Saturday December 12, 2020 @02:42AM (#25396503)
I’m trying to envisage what different lava lamp failures might look like, and I’ve gotta say, there are some entertaining possibilities in that idea.
Re:Encryption Lava Lamps (2017) by phendrenad2 on Friday December 11, 2020 @11:39PM (#25395618)
Both the radio and the CCD seem like something a determined actor could undermine. Transmitting a directional pop of radio static at just the right moment, or whatever causes CCDs to show static (x-rays?)
Re:Encryption Lava Lamps (2017) by faeyanpiraat on Saturday December 12, 2020 @01:26AM (#25396111)
If the bad guys can point an X-Ray gun at your stuff, random numbers are probably not going to be your biggest issue. :)
Re:Encryption Lava Lamps (2017) by ogre_codes on Saturday December 12, 2020 @02:19AM (#25396382)
If your attacker can stage a sophisticated attack on your entropy source and your budget is $100, you are screwed regardless.
Re:Encryption Lava Lamps (2017) by BelenusMordred on Friday December 11, 2020 @09:38PM (#25394840)
This is not a good idea for the uninitiated and is on par with rolling your own encryption algorithm to send highly sensitive data around the world.

For the price GP mentioned there's a dozen vetted opensource commercial options in the bottom half of that range.

Re:Encryption Lava Lamps (2017) by ogre_codes on Saturday December 12, 2020 @01:55AM (#25396260)
The uninitiated have zero business sending highly sensitive data around the world in general.
Re:Encryption Lava Lamps (2017) by BelenusMordred on Saturday December 12, 2020 @08:36PM (#25403495)
And yet they still do it daily. This is why secure-by-default should always be the norm.
Re:Encryption Lava Lamps (2017) by tptacek on Friday December 11, 2020 @08:51PM (#25394481)
$0, your base server or laptop, and getrandom.
Re:Encryption Lava Lamps (2017) by gentleman11 on Saturday December 12, 2020 @01:03AM (#25395986)
Re:Encryption Lava Lamps (2017) by JJMcJ on Saturday December 12, 2020 @02:42PM (#25400941)
Multi-colored so your own biases don't affect the order you read the dice in. E.g., and I'm just guessing, some people might notice the higher numbers first and read those out.
Re:Encryption Lava Lamps (2017) by dTal on Saturday December 12, 2020 @10:34AM (#25398829)
An ADC, the shittier the better. Turn the gain all the way up. Don't bother plugging a microphone into it. XOR all the bits together. Done.
Re:Encryption Lava Lamps (2017) by contravariant on Friday December 11, 2020 @09:30PM (#25394777)
Just set stuff on fire I suppose.
Re:Encryption Lava Lamps (2017) by pmiller2 on Friday December 11, 2020 @08:55PM (#25394523)
Re:Encryption Lava Lamps (2017) by JJMcJ on Saturday December 12, 2020 @02:46PM (#25400977)
Dice - for not too many bits, and a low data rate.

Hardware or /dev/urandom (or Windows equivalent) and downstream library calls - many bits, high data rate

Re:Encryption Lava Lamps (2017) by Spooky23 on Friday December 11, 2020 @10:46PM (#25395316)
A set of casino dice and a 5 gallon bucket.
Re:Encryption Lava Lamps (2017) by etiam on Saturday December 12, 2020 @07:06AM (#25397735)
What's the bucket for?
Re:Encryption Lava Lamps (2017) by Spooky23 on Saturday December 12, 2020 @10:05AM (#25398624)
To throw the dice into!
Re:Encryption Lava Lamps (2017) by etiam on Saturday December 12, 2020 @10:41AM (#25398888)
Fair enough :)

I guess we're still well within budget.

Re:Encryption Lava Lamps (2017) by dheera on Saturday December 12, 2020 @12:05AM (#25395738)
Just hang a microphone outside your window and pick up all the birds chirping and other street noises?
Re:Encryption Lava Lamps (2017) by swirepe on Saturday December 12, 2020 @12:11AM (#25395776)
I bet you could find some patterns in street noises, but I'm also not 100% sure what entropy is
Re:Encryption Lava Lamps (2017) by warent on Saturday December 12, 2020 @12:11AM (#25395781)
I wonder if you could do this in a silent room with a cheap mic and just use the static white noise
Re:Encryption Lava Lamps (2017) by danielheath on Saturday December 12, 2020 @04:17AM (#25396954)
I know someone who used that technique at one of the worlds largest banks, back in the 1990s.
Re:Encryption Lava Lamps (2017) by mightybyte on Saturday December 12, 2020 @01:34AM (#25396152)
Casino grade dice