I am using custom hardware on which i'm using the random noise from an ADC converter and a few other seeds. I combine these in an algorithm and have tested it against FIPS PUB 140-2 for a random number generator. It has passed the test but I'm reading up on RNG attacks and do not fully understand these attacks.

If people would mess with my seeds is there anything i could do against it? the hardware is in an insecure environment so if an attack would go through the trouble of opening it, finding the sources and so on, there is nothing i can do against it is there?

Is there anything you can do to make your RNG secure other than choosing multiple seeds?

  • 1
    There is - use a secure algorithm
    – Mints97
    Mar 4, 2015 at 12:27
  • I have, It's FIPS 140-2 secure, is this simple test enough? because i have no idea what happens if these sources are compromised.
    – Vincent
    Mar 4, 2015 at 12:30
  • 1
    Does the "ADC converter and a few other seeds" seed a CSRNG/PRNG or are they an RNG itself? ADC sources can sometimes be gamed into not seeing noise. If you can alter the gain or offset you can generally reduce the noise greatly. You can also end up with issues if the consumer of random data is consuming it faster than it can be generated and instead of blocking, it becomes less random. Mar 4, 2015 at 13:02
  • 1 is a RNG from math.h we also use others, a looping timer (or some interrupt based thing) and something from an IRP channel (i was not in charge of selecting these seeds so i don't know everything about them) but I have been assured these are viable sources.
    – Vincent
    Mar 4, 2015 at 13:12

1 Answer 1


Let's start with the disclaimer: I'm not a cryptographer, creating your own RNG is usually a bad idea, blah, blah. That said I have an idea:

Try measuring entropy of the RNG:


When it gets too low due to an attacker (or cosmic rays) you stop providing random numbers until entropy reaches acceptable levels.

How much entropy? Depends on your key size. A 256 bit key with 20 bits of entropy is no more secure than a 20 bit key so I would suggest a target entropy equal to the biggest key size you will be working with.

Hardware being in an insecure environment is not a solvable problem in my eyes. Aside from esoteric RNG attacks, the most straightforward approach would be to gain control of the device and compromise your encryption from there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .