# What should be used as a source for entropy?

I have hardware based RNG which consists of TRNG and PRNG. TRNG is giving out 512 bit number which is being used as seed for PRNG. RNG is generating 160 bit random number using PRNG and reseeding is done after 2^20 numbers. I want to use hardware based RNG as entropy source. What should be used as source of entropy i.e. output of TRNG or PRNG ?

Thanks & Regards,

• As pure entropy source for a software (CS)PRNG? Always use the TRNG. – SEJPM Jul 29 '16 at 22:13
• For information-theoretical reasons, the roughly $160$ million bits obtained from the PRNG before reseeding still have a total entropy of at most $512$ bits. On the other hand, the TRNG should in theory yield a full bit of entropy per extracted bit. – yyyyyyy Jul 29 '16 at 23:17
• SEjPM & yyyyyyy , Thanks for your replies. @yyyyyyy , simplified formula for entropy (log2n) gives value of 7.32 for 160 bits and 9 for 512 bits. Will I be justified to claim 7.32 bit entropy if I decide to use output of RNG ? – user2363993 Jul 30 '16 at 0:05
• Why can't you just use the TRNG as the RNG without interposing a PRNG? The randomness is better that way... – Paul Uszak Sep 11 '16 at 21:55

Your calculation doesn't make sense. Think of what $n$ is in this formula! The entropy of a source with $n$ possible different equiprobable values is $\log_2(n)$. The entropy of a source that provides $k$ independent bits is $k$. If your source provided 512 independent bits then you would get 512 bits of entropy from it, but in practice physical sources have some amount of correlation that's hard to evaluate precisely, so you probably have much less. In any case, what matters with entropy is that it's sufficient to make the probability that a brute-force attack would succeed negligible. For this purpose, there is no meaningful difference between 160 bits and 512 bits.