On-chip randomness (V4FX)

Hi,

I'm working on a V4FX design that contains cryptographic primitives.

To secure the system against an expected threat, it is necessary to produce a different seed for every session. The seed doesn't have to be random nor unpredictable, but the same seed should never be used more than once.

The system contains non-volatile storage for the purpose of generating a non-repeating seed. However the storage is external to the V4FX. An attacker could isolate the V4FX and make it repeat a seed by replaying the external stimulus (as recorded from a previous session).

To counter this threat, I wish to mix the externally acquired seed with on-chip generated "randomness". That would result in a different seed even during a stimulus replay attack. I know that chips are designed to behave as repeatable as possible, and I'm asking for quite the opposite. But at least I want to try, given that even a small amount of entropy can discourage an attack.

For example I'm thinking about an oscillating combinatorial loop, sampled during the regular clock events. I expect the output would vary (at least a little bit) with temperature, supply voltage and perhaps moon phase.

What other V4FX resources could be (mis)used for this purpose? I'd like to use two or three unrelated methods.

If you have any suggestion or experience, I'd highly appreciate your input.

Regards, Marc

Reply to
jetmarc
Loading thread data ...

Hi Marc, This is difficult. Ring oscillators are prone to resonate with other on-chip clocks. Also, Xilinx have spent a lot of effort fixing other things you could use like SEUs (see Austin's posts) or Metastability resolution (see Peter's posts). (The metastability thing isn't very random anyway.) If only you could incorporate the actual ISE software into your design; it produces random errors with consummate ease! I suggest you use the built in Vbatt driven solution with a secret number kept alive by a Li coin cell. Apparently, it's good enough for the Feds. Not much help, sorry. Syms.

Reply to
Symon

I think using on board oscillator you should be able to produce some bits of entropy indeed. You just have to design you circuit so that even two very close frequency would lead to very different answer.

Maybe you can use external stimuli as source of entropy as well ?

Also, you menti> Hi,

Reply to
Sylvain Munaut

What about multiplying clock with the DCM as fast as possible and clock a counter (designed to be as slow as possible) with that clock? Best solutions should be achieved before the DCM is locked ;). This approach wont give you true random numbers but the vary should be nondeterministic enough to be useable as seed generator for a lfsr.

bye Thomas

Reply to
Thomas Stanka

V4 has an oscillator built in that isn't advertised. I forget the name of it at the moment, but you can find it by looking at the Xilinx DCM workaround for the NBTI issues, as the tools connect unused DCMs to that oscillator. You could beat that against an external clock using a counter to get random seeds. In order to avoid the oscillator syncing up to the external clock, you should take the seed sample once as soon as practical after start-up, and use that to seed a PN generator. I am aware of someone working on a master's thesis regarding evaluation of randomness of randoms generated in various ways in an FPGA. I believe she was using Spartan3's for her work, and much of it revolved around using ring oscillators. I think she found that ring oscillators beating against one another worked well as long as the seed was generated right after startup and the ring oscillators were located far apart on the die.

Reply to
Ray Andraka

Marc,

See:

formatting link

or

formatting link

There are actually rules for use of ring oscillators to generate random numbers, unclassified, for official use only, from the NSA. I am sure you can find it (since it is unclassified) somewhere. The caveat is: whatever you do, you must then test it.

Austin

Reply to
Austin Lesea

formatting link

Hmm, this is interesting:-

formatting link

Reply to
Symon

Reply to
Peter Alfke

I would be careful using an un-locked PLL as a source. I tried that about 20 years ago, using discretes, & gave it up. It proved highly non-random. [Part of my Master's thesis: I was using a 74S124 VCO, with a sampling-type phase detector running from a sinusoidal reference. VCO frequency about 4MHz, reference 132kHz.]

Reply to
David R Brooks

I have, more often, seen the ring-oscillator(s) sampled onto a common clock before XORing together and feeding into an LFSR. It's a little bit bigger due to the synchronizers, but has the nice effect that the bulk of the logic is all synchronous to the system clock.

-hpa

Reply to
H. Peter Anvin

In article , "H. Peter Anvin" writes: |> Peter Alfke wrote: |> > I suggest an on-chip LFSR pseudo-random sequence generator, clocked by |> > a ring-oscillator (or equivalent) clock source and timed out by a fixed |> > delay, derived from the xtal oscillator. That's all very simple, takes |> > only a few CLBs, when the SRL16 is used for the LFSR. |> > Peter Alfke, Xilinx |> |> I have, more often, seen the ring-oscillator(s) sampled onto a common |> clock before XORing together and feeding into an LFSR. It's a little |> bit bigger due to the synchronizers, but has the nice effect that the |> bulk of the logic is all synchronous to the system clock.

XAPP 780 contains a random bit stream generator with ring-oscillators and some "metastability" logic.

--
         Georg Acher, acher@in.tum.de
         http://www.lrr.in.tum.de/~acher
         "Oh no, not again !" The bowl of petunias
Reply to
Georg Acher

onto a common

Reply to
Peter Alfke

(snip)

I remember hearing about the 74S124 about 30 years ago. If it is the one I remember, it is actually a dual VCO, except that it is supposed to be impossible to use both without them phase locking. It might be, then, they it could also phase lock to an external source.

-- glen

Reply to
glen herrmannsfeldt

Hi Georg, Thanks for that link, it's interesting. Of course, the method described in this XAPP note only protects the design from cloning. It's not going to be impossible to reverse engineer the configuration bit stream and find the secret key in the FPGA. In fact, doesn't this method of attack defeat the random number generator thing in all application? If an attacker has physical access to the design, I think the Vbatt RSA key thing is the only 'secure' way to go, otherwise your configuration bitstream is there to see. Thanks, Syms.

Reply to
Symon

Thank you for all follow-ups.

It seems to me that ring-oscillators and meta-stability are the "best" sources for weak (but true) on-chip randomness.

I greatly appreciate the pointer to the XAPP780 appnote, and would like to add one that I found after Austins and Peters comments. Here's another ring-oscillator example source code:

formatting link
formatting link

So thanks again for all the valuable input!

Regards, Marc

Reply to
jetmarc

That's a start ;-)

Well, with some code modification you can put the secret into LUTs and/or "random" logic. Then it's getting harder to find it. It should be also possible to decrypt the picoblaze instructions "online", so it's not that easy to find the BRAM that contains the code. After all, you (as the attacker) need to know where the SHA-stuff is done to start the attack. Using XAPP780 without modifications is not very clever...

Spartans have no Vbatt :-(

--
         Georg Acher, acher@in.tum.de
         http://www.lrr.in.tum.de/~acher
         "Oh no, not again !" The bowl of petunias
Reply to
Georg Acher

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.