Skip to content

Hardware RNG or software RNG, asking the question properly

The useful question is not hardware versus software but where unpredictability physically originates and what evidence exists about it. Every practical system uses both: a physical source to seed, and a deterministic algorithm to expand. The distinction that matters is whether the physical half is characterised or merely assumed.

Why the framing is usually wrong

Posed as "hardware good, software bad", the question has no useful answer. A well-implemented DRBG seeded from a strong source is excellent. A hardware source with an undocumented entropy model and no runtime health monitoring is not automatically better than it.

Both halves exist in any real system. The kernel on the machine you are reading this on has a pooling and expansion design in software, seeded from whatever physical sources the platform exposes. The question is what those sources are and what you know about them.

What software cannot do

Deterministic code cannot create unpredictability. It can preserve, mix and expand it very efficiently, and modern DRBG designs do exactly that. But the unpredictability has to enter from somewhere physical, and on many platforms what enters is a mixture of interrupt timings and instruction-level sources whose entropy contribution is estimated rather than modelled.

That estimate is often reasonable and occasionally is not, particularly in virtualised environments, in embedded devices at first boot, and on platforms where the timing sources an entropy estimate assumed are less variable than expected.

What hardware does not automatically give you

A hardware source is not evidence by itself. Ask which physical process, what min-entropy estimate, conditional on what model, and what health testing runs in service. A source that cannot answer those is an assumption in a different package.

This is where claim discipline matters most, and it applies to us. Our sources are not better because they are hardware. They are better to the extent that the entropy model is stated, the estimate is conditional on it, and the quantities it depends on are monitored while running.

The practical answer

Use the operating system's generator. Make sure it is seeded from a source you can describe. Add a characterised physical source where the consequences of a weak key are severe, where you must produce evidence rather than assurances, or where the platform's own sources are weak — embedded devices at first boot being the clearest case. The assessment checklist is how to tell which situation you are in.