# [Freedombox-discuss] Fwd: Fwd: Entropy from the soundcard

Sandy Harris sandyinchina at gmail.com
Fri Sep 16 02:24:50 UTC 2011

```An earlier message had some concerns about Turibid. I forwarded them
to John Denker, the Turbid author. Now, with permission, I am
forwarding his reply here.

---------- Forwarded message ----------
From: John Denker <jsd at av8n.com>
Date: Fri, Sep 16, 2011 at 9:23 AM
Subject: Re: Fwd: [Freedombox-discuss] Entropy from the soundcard
To: Sandy Harris <sandyinchina at gmail.com>

Hi --

On 09/15/2011 06:09 PM, you quoted Michael Rogers:

Concerning turbid:

>  As far as I can tell, it works by
> sampling noise from a soundcard with nothing connected, calculating a
> theoretical lower bound on the entropy of the noise, and using that
> lower bound to determine how much noise to feed into a hash function
> (SHA-1) to ensure 160 bits of entropy in the hash function's 160-bit output.

OK.

> It's a clever approach,

:-)

>  but one thing makes me nervous: the lower bound
> is based on the assumption that the noise from the soundcard is white
> noise. Possible sources of non-white noise (eg interference from the
> power supply, which would produce a periodic "hum") are mentioned in
> section 6.4 of the paper, but it's assumed that they can only add to the
> entropy of the sampled noise.
>
> In a general sense that's true: adding a signal to white noise, even a
> totally predictable signal, doesn't produce a combined signal that's any
> more predictable than the white noise alone.

That's very true, and that's the key to why turbid
works correctly.

> But in a more specific
> sense it's problematic, because you can't determine the volume of the
> white noise from the volume of the combined signal - and I *think*
> that's what Turbid's calibration process tries to do.

No, the calibration process doesn't do that.

We agree that if it did that, it would be bad.

Turbid *never* attempts to measure the noise.  It measures
the input resistance and the bandwidth, not the noise.  The
Johnson noise can then be calculated, and it *must* be there,
as required by the second law of thermodynamics.

We agree that there may be other noise on top of that, but
it can't hurt, and turbid does need to account for it.

> If I'm right, the presence of non-white noise might cause Turbid to
> overestimate the amount of white noise available from the soundcard, in
> which case it wouldn't feed enough noise into the hash function to
> ensure a high-entropy output.

Absolutely not.  Turbid does not estimate the noise.
Therefor it cannot possibly overestimate the noise.

> I say "might" because I don't really understand how Turbid's calibration
> process works. For each model of soundcard you have to calculate some
> parameters by soldering cables, playing test tones and taking
> measurements with a voltmeter. How that produces an estimate of the
> amount of white noise, as opposed to noise-of-all-colours, I can't tell.
> Maybe someone who understands the maths better than I do can explain?

It's not math.  It's physics, in particular thermodynamics.  Some
relevant references are provided in the turbid principles-of-operation
paper.  Or you could look for yourself: