lundi 27 août 2018

Securely Use Random Number Generator for Lottery Winning

I want to design a lottery winning mechanism using random number generator. I know that for computer, there is no true randomness but only "pseudorandom". If the system gets hacked and random seed is seen, people will know the sequence of random numbers. In fact, there is news that people did this and won several lotteries. I am thinking about two ways of designing my system:

  1. Use random number generator as a global variable. There is only one random seed; the sequence is generated when the system starts.

    Con:

    a. Once the random seed is seen, hackers will know the sequence easily.

    b. Once the system crashes and restarts, the sequence will repeat itself.

  2. Create a random number generator using timestamp as random seed each time to generate a number.

    Con:

    a. Obviously timestamp cannot be directly used. There are some tricks needed to be done with the timestamp each time. For example, plus or minus some values each time on the timestamp. What algorithm can I use here to do this kind of modification on timestamp?

    b. Is this method even taking advantage of random number generator? It seems I am just creating a random number by myself...

As we can see, either of the method above is not secure enough. Which way is slightly better? Or is there a better way?




Aucun commentaire:

Enregistrer un commentaire