Javascript Math.rand () is unlikely to be good enough for the lottery, since the specification does not require cryptographic protection. For example, there are known flaws in the generator used in some versions of Chrome.
You will need a cryptographically secure pseudo-random number generator (for example, blum-blum-shub) and a method for sowing it. You need a good way to sow it, because if someone can figure out which seed you used, they can generate all the lottery numbers. You will probably want to plant a pseudo-random generator with a truly random rather than random pesudo number. This will require a random number generator. Random.org supposedly provides a source of truly random numbers, however, if someone eavesdrops on your connection with random.org, they can still detect your random seed. You may prefer to invest in your own equipment rather than relying on someone else.
Infact, if you did not need a lot of random numbers (much more than 10), it would make little sense to use a pseudo-random number generator in general. You can also get all your random numbers from a real, random, random number generator.
source share