There are limits to how much you can use a the DRBG before you have to reseed it, but are there any limits to how much you must use it before reseeding?
Take the following scenarios as an example…
Usually you seed the DRBG once, then you use that instance until you reach the reseed limit. Like so:
seed = seedFromUrandom // Reads entropy from /dev/urandom
genStart = drbgFromSeed seed
(v1, gen1) = genBytes genStart // Generates random data and the next state
// of the DRBG as a tuple
/*
Code using the random data in v1
*/
(v2, gen2) = genBytes gen1 // Generates more random data and the next state
// of the DRBG as a tuple. Note that gen1 is
// used here and not genStart.
/*
Code using the random data in v2
*/
What if you created a newly seeded instance each time you want to generate random data? Like so:
seed = seedFromUrandom // Reads entropy from /dev/urandom
genStart = drbgFromSeed seed
(v1, _) = genBytes genStart // Generates random data and ignores the
// next instance of the DRBG.
/*
Code using the random data in v1
*/
seed = seedFromUrandom // Reads entropy from /dev/urandom
genStart = drbgFromSeed seed
(v2, _) = genBytes genStart // Generates random data and ignores the
// next instance of the DRBG.
/*
Code using the random data in v2
*/
Please note:
- When I say “DRBG”, I mean the NIST standardized number-theoretically secure random number generator. Either HMAC (SHA512), Hash (SHA512), or counter (AES 128).
- Like stated in the pseudo-code, entropy is read from
/dev/urandom
.