[Cryptography] Duh, why aren't most embedded TRNGs designed this way?

John Denker jsd at av8n.com
Sat May 15 23:46:16 EDT 2021


On 5/15/21 6:04 PM, Ron Garret wrote:

>> All that ugliness is completely unnecessary. You'd be a lot better
>>  off using Johnson noise:
> 
> That is far from clear.  It might be a better source of entropy in 
> theory, but it presents a different problem: how do you know that 
> what you’re getting out of it is actually Johnson noise?  Unless you 
> fabricate the noise generator yourself from raw materials, how do
> you know it hasn’t been compromised?

Answer: The second law of thermodynamics.

There is a well-known formula for the noise voltage:

	⟨P⟩ = ⟨V²/R⟩  =  4 kT B		[1]
where
	P = power
	V = voltage
	R = resistance
	T = temperature
	B = bandwidth

R, T, and B can easily be measured to more-than-sufficient accuracy.

In a previous message I alluded the Phys Rev Letter in which Nyquist
proves that equation [1] is a direct consequence of the second law
of thermodynamics.
  https://doi.org/10.1103/PhysRev.32.110
That was published back-to-back with Johnson's experiments:
  https://doi.org/10.1103/PhysRev.32.97

Any attack that depends on circumventing the second law is not
something I'm going to worry about. I would question the sanity
of anybody who includes that in their threat model.

Suggestion: Before you go around telling the community that physics
is useless, it might be good to get up to speed on the physics.
Refusing to use the available physics does not make it useless.
You are free to not use it, but others remain free to put it to
good use.

> You are going to have a very hard time distinguishing “real” Johnson
> noise from a facsimile injected into your system by an adversary.

If the attackers get access to my hardware to the point where they
can inject something into the audio circuits on the motherboard,
there other attacks that are far easier and far more effective.
If I were the boss attacker and one of my henchpersons suggested
attacking the audio, I would send him back to school to learn
about cost/benefit analysis.

> But again, this doesn’t matter.  If you’re paranoid about audio, use 
> a camera.  Or a mouse.  Or type random characters on a keyboard and 
> measure the timing.  Or whatever.  The key to being secure is not
> the quality of the noises source but taking the time to collect
> enough of it.

I can't believe we are having this discussion. I am not paranoid
about audio. Quite the opposite. I have been recommending it for
years. A camera is similar in principle but more expensive and
less commonly available.

> The key to being secure is not the quality of the noises source but
> taking the time to collect enough of it.

I don't know what this is, but it's not engineering. If there is no
lower bound on the quality of the source, there is no upper bound
on how much time it takes to collect what you need.

Similarly, you can't rely on some oracle to tell you how how much
entropy is present. Again, that's not engineering. The subject of
this thread is /designing/ a TRNG. That requires opening the black
box and understanding the innards. Physics provides money-back
guarantees that would be very hard to obtain otherwise. This is
precisely the problem with the ring oscillators: They did not come
with guarantees that were robust across routine changes in the fab
process.

>> 1') It offers an endless supply of noise.
> 
> Why would you want that?  You’re still going to be rate limited by 
> the bandwidth of the generator.  Why is that better than a properly 
> seeded CSPRNG?

I can't believe we are having this conversation either. The
whole point of a TRNG is to make it possible to properly seed
the CSPRNG. If you blithely assume that your CSPRNG is already
properly seeded then this whole discussion is moot and pointless.

Seeding from a mouse or a keyboard fails miserably because most
of the machines I care about don't have mice or keyboards. Also
requiring the user to fiddle with the mouse and keyboards annoys
the user. Also the CSPRNG is a lot more secure if it gets re-seeded
every so often. In particular, storing a seed that can be used
at the next reboot opens an obvious line of attack.

A corollary of "endless" is /always available/.

>> 2') It cannot be overheard or replayed.
> 
> Of course it can.  If you’re using it for cryptography, then at some 
> point you have to render that noise as a cryptographic key, and at 
> that point it can potentially be compromised.  There is literally no 
> difference in the potential for compromise in a key seeded from 
> Johnson noise and the state of a CSPRNG.  They are both just bits in 
> memory.  Where they came from doesn’t matter unless your adversary 
> can use the knowledge of their source to mount an attack.

If the attackers can read bits out of memory, they are not going
to go after the Johnson noise input buffer. There are other attacks
that are far easier and far more effective.

Please let's stop fussing over imaginary problems, and stop relying
on oracles to solve the real problems.


More information about the cryptography mailing list