Hardware random number generator for lottery? To be able to generate random numbers for lottery games, we have the following requirement:


  The random number generator, which uses the deterministic algorithm to determine the game result, has to work with a length of at least $$2^{64}$$ period to ensure that the random process is generated so that in the case of a particular gambling there is no detectable repetition of the results, and must produce a sequence of game results based on initial values that are random or unpredictable


What does it mean in terms of certifications and hardware random number generators?

Am I able to fullfill the requirement with hardware device which is compliant with P2 Class of BSI AIS-31 (for example CryptoMate64 USB cryptographic dongle or other HW certified cryptographic device according FIPS 140-2 Level 3)?
The wording of this requirement contains the meaningless


  has to work with a length of at least $2^{64}$ period


that I hereafter reorder into

&nbsp; &nbsp; has to work with a period of length at least $2^{64}$



We need to solve the ambiguity left in


  must produce a sequence of game results based on initial values that are random or unpredictable


about if random or unpredictable applies to initial values or to game results. Because of the earlier text "deterministic algorithm to determine the game result", the game results can't be random, since that opposes squarely to deterministic. Thus random or unpredictable can only apply to initial values. We are left with a sequence of game results that is never prescribed to be unpredictable, and the requirement is perfectly met by a generator that


uses 8 throws of 8-sided dices to build a 64-bit seed initializing a 64-bit counter;
at each uses, increments the counter modulo $2^{64}$ and outputs it.


Yet this generator is clearly unsuitable for a lottery, because the next result is trivially inferred from the previous one.

Also missing is the range of game outcomes ($2^{64}$ outcomes as in the above example is unheard-of in lotteries); a requirement that these game outcomes are equiprobable, and to what degree; if two outcomes in the sequence generated from the same seed can repeat (they should not in something that mimics a traditional loto).

Ah, and if we take it to the letter, it seems we must have a period of at least $2^{64}$ for all seeds, and that condition is not part of P2 Class of BSI AIS-31 or FIPS 140-2 Level 3. Therefore, game outcomes determined by some deterministic memory-less function from output of generators certified by these standards arguably can not meet the requirement. Further, AIS-31 allows (or requires for some class) that the generator is reseeded while used, when the requirement asks for something deterministic except for seed. 

In the end, even after it has been reordered, the requirement remains utterly technically defective, and arguably prevents using established RNGs. The best is to ignore this requirement entirely and start afresh, if that can be done without getting fired poorly graded.



To engineer sound requirements, we must know the intent. It could be that the seed is archived, so that it can be proved afterwards that the PRNG worked correctly. It could be that this archival is distributed, so that collusion of some number of dishonest parties in the archival process would be necessary to predict the outcome. Again there's the range and rules for outcomes. There are assumptions to be made on what is trusted, and what's not.