Trojan hardware RDRAND

Skip to first unread message

D. J. Bernstein

Sep 7, 2013, 10:00:25 AM9/7/13
to appeared at CHES 2013
last month. It explains how to build a circuit that looks just like the
Intel RDRAND circuit under a microscope and that passes all the RDRAND
tests, but that also has a back door, making the output predictable to
anyone who knows a secret master key used by the chip builder.

The security consequence is that anyone building keys from RDRAND is
giving Intel, and anyone with sufficient control over Intel, the power
to predict those keys. Even rather extreme reverse engineering would not
detect an exercise of this power. Linus Torvalds was quite wrong in

when he claimed that RDRAND is "public and testable."

Normally /dev/urandom etc. hash multiple entropy sources together, so
there's no harm in adding another source, such as RDRAND. Users who
don't trust the available sources should simply be able to feed some
random keyboard data to /dev/random; then all subsequent /dev/urandom
output will be unpredictable to anyone without a keyboard recording,
no matter how busted the other entropy sources are.

However, for years Intel has been pressuring OS designers to _eliminate_
entropy sources other than RDRAND. The Linus comment above was in the
context of Intel supplying an "RDRAND bypass" patch for Linux. Intel
even claims in

that there's something _wrong_ with feeding RDRAND into /dev/random---
the only "suitable" use of RDRAND is to replace all /dev/urandom output.
Ted Ts'o now says in

that he's "so glad" he "resisted pressure from Intel engineers to let
/dev/random rely only on the RDRAND instruction"---but

seems to indicate that, at least for a while, Linux was in fact allowing
RDRAND to override all other /dev/urandom inputs.

Even worse from a security perspective, Intel is telling _application
developers_ to use RDRAND directly, rather than /dev/urandom. Examples:
(Intel's David Johnston: "So... eliminate software PRNGs. Just use the
output of the RDRAND instruction wherever you need a random number.")
(Johnston again: /dev/urandom fails "often" so RDRAND is designed
to "feed entropy directly to the register space of the running
application. ... Standards compliance is an excellent option here.")

The old situation was that many people were incorrectly told that
managing their own entropy pools would improve security, but only a
small fraction went to the effort of actually building their own pools
instead of simply reading /dev/urandom, so we're faced with only a
medium-size crypto-engineering mess to clean up. The new situation is
that no effort is required. RDRAND is going to appear tens of thousands
of times in thousands of applications---and there won't be anything
_visibly_ wrong with the results, so we'll have a tough time explaining
why the application authors should disregard Intel's RDRAND advice.

I chatted with Intel's Jesse Walker about this at CHES. He disclaimed
responsibility for Intel pushing RDRAND into applications; apparently he
was outvoted within Intel.


Feb 2, 2015, 3:34:06 AM2/2/15

On you can find the results of randomness tests of several random generators including RDRAND.

In the document No_of_failures_calculation.txt you can find the used testing method and the test results.

The actual number of failed tests of RDRAND deviates more then 4 sigma from the expected number of failed tests.

The used software can also be downloaded from the same link so these tests can be reproduced.

As you also can see the XOR_SHIFT PRNG and the Picoquant PQRNG150 TRNG pass the tests with a number of failed tets within the 3 sigma deviation so the tests seem to work fine.

Reply all
Reply to author
0 new messages