Algorithms and Sources of entropy for PRNG and TRNG?

In summary: TRNG can be generated with a 1-bit A/D converter sampling noise from an analog part. This will produce unpredictable output. TRNGs are hardware random number generators that use true sources of randomness like the LSB of a microphone input, phase jitter between out of sync clocks, background radiation, etc.
  • #1
dexterdev
194
1
Hi PF,
I would like to implement different random number generators using AVR microcontroller (both PRNG and TRNG). So I would like to get suggestions about different sources of entropy for TRNG and algorithms for PRNG. Also wanted to test the randomness.

And What is chaos theory? Is it applicable for random number generation? Can I implement a chaos circuit for random number generator?

TIA

-Devanand T
 
Engineering news on Phys.org
  • #2
need to define some acronyms. i know a bit about generating random numbers but don't know what the "P" or the "T" is.
 
  • #3
ok here goes... PRNG - pseudo random number generator. (algorithms)
TRNG - true random number generator. (hardware generator)
 
  • #5
dexterdev said:
ok here goes... PRNG - pseudo random number generator. (algorithms)
TRNG - true random number generator. (hardware generator)

so would a hardware generator using the same algorithm as a PRNG be a true RNG? if so, i fail to see any salient difference.

or is a TRNG an A/D converter that samples the noise from a noisy diode or resistor or some other noisy analog part? that might be fully unpredictable, in contrast to an algorithm.
 
  • #6
justsomeguy said:
You can build something with known jitter/instability and read from that. Example: http://electronics.stackexchange.com/questions/18379/entropy-source-on-microchip-pic24f

okay, so i looked at that, and it's essentially a noisy analog circuit that is sampled with a 1-bit A/D converter (that's what the comparator is).

okay, if you use that, and if the biasing scheme works as planned, then you should have some random bits coming out of that. there isn't a clock in the circuit, so i do not know how fast the bits might be toggling back and forth.

i can't say that they bits would be good and white because of that capacitor makes for a high-pass filter (a differentiator). so, if i understand it right, whatever is the value of the previous bit, the current bit will more likely be the complement than the same value. that's what high-pass noise is. if it were white, then the likelihood of the current bit being "1" is 50% no matter what the value of the previous bit was.
 
  • #7
rbj said:
so would a hardware generator using the same algorithm as a PRNG be a true RNG? if so, i fail to see any salient difference.

Hardware RNGs use true sources of randomness, like the LSB of a microphone input, phase jitter between out of sync clocks, background radiation, etc.

PRNGs are simply algorithms that eventually repeat. If you know the seed value, then you know all the random numbers it will generate when called, and in what order.

The difference between a good and bad PRNG is life and death to encryption, since the most secure encryption (a one time pad) depends entirely on the randomness of the keystream.
 
  • #8
Physical random generators tend to be very bad. They have bias like 1% or 0.1% which makes them totally unusable as is in cryptography, which wants 10-9 to the very least.

So the next step is to hash by software the physical signal, and then you can begin to wonder if the physical source is really that useful.

Practical crypto programs use physical randomness only as seed for software random generators. Good choice.
 
  • #9
Enthalpy said:
Physical random generators tend to be very bad. They have bias like 1% or 0.1% which makes them totally unusable as is in cryptography, which wants 10-9 to the very least.

So the next step is to hash by software the physical signal, and then you can begin to wonder if the physical source is really that useful.

Practical crypto programs use physical randomness only as seed for software random generators. Good choice.

This is not quite correct. The main failing of hardware RNGs is not bias or anything to do with their randomness -- they are, when used correctly, perfectly random. The problem is they are generally just too slow. You need to wait for entropy to build up or you get a stream of identical or predictably oscillating values. PRNGs can go as fast as you want.

However, dedicated hardware RNGs are both fast and random. Their downside is simply that they are expensive (unless you DIY).
 
  • #10
guy, i think that Enthalpy is completely correct.
 
  • #11
dexterdev said:
Hi PF,
I would like to implement different random number generators using AVR microcontroller (both PRNG and TRNG). So I would like to get suggestions about different sources of entropy for TRNG and algorithms for PRNG. Also wanted to test the randomness.

A possible source of hardware randomness (a random seed for a good PRNG) in a microcontroller is the powerup bit state of the SRAM memory. What I've done in the past was to examine a large section of memory bits to see what bits usually power up as random instead of a steady 1 or 0. I would then mask out the fixed bits using a hamming code fuzzy extractor and then use a CRC of the unstuck random bits to generated a seed for a PRNG.

This describes a similar process:
https://www2.lirmm.fr/lirmm/interne/BIBLI/CDROM/MIC/2012/DATE_2012/PAPERS/2012/DATE12/PDFFILES/11.4_1.pdf
http://users.wpi.edu/~martin/MQP/edwardsetal.pdf
 
Last edited by a moderator:
  • #12
This one could be quite cool: http://warmcat.com/_wp/whirlygig-rng/ It passes the dieharder suite so there is definitely no bias and it has high quality randomness, but it is not clear to me if it is truly impossible to find a statistical model to kill it.
 
  • #13

Related to Algorithms and Sources of entropy for PRNG and TRNG?

1. What is an algorithm and how is it used in PRNG and TRNG?

An algorithm is a set of instructions or steps used to solve a problem or complete a task. In the context of PRNG and TRNG, algorithms are used to generate random numbers by manipulating a seed value. PRNGs use deterministic algorithms, while TRNGs use non-deterministic algorithms that rely on external sources of entropy.

2. What are the sources of entropy used in PRNG and TRNG?

PRNGs typically use a mathematical formula or algorithm to generate random numbers, which means their source of entropy is internal. TRNGs, on the other hand, use external sources of entropy such as hardware noise, atmospheric noise, or user input to generate truly random numbers.

3. Can PRNGs and TRNGs be used interchangeably?

No, PRNGs and TRNGs have different purposes and should not be used interchangeably. PRNGs are suitable for applications that require pseudo-random numbers, such as simulations or games. TRNGs are used in applications where true randomness is critical, such as cryptography.

4. How do PRNGs and TRNGs ensure the security and unpredictability of their output?

PRNGs and TRNGs both rely on the use of a seed value to generate random numbers. PRNGs use a fixed seed, which means their output can be repeated if the seed is known. TRNGs use a constantly changing seed, often derived from external sources of entropy, to ensure the security and unpredictability of their output.

5. Are there any potential vulnerabilities or weaknesses in PRNGs and TRNGs?

While PRNGs and TRNGs are generally considered secure, there are potential vulnerabilities and weaknesses that can be exploited. For example, PRNGs that use a weak algorithm or have a small seed space can be susceptible to attacks. TRNGs can also be vulnerable if their sources of entropy are not truly random or if there is a flaw in the algorithm used to combine the entropy. It is important for developers to carefully choose and test their PRNG and TRNG implementations to ensure they are secure.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
20
Views
2K
Replies
5
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
544
Replies
5
Views
1K
Replies
1
Views
950
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
882
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
3K
Back
Top