What is the most secure seed for random number generation?

后端 未结 20 1981
南笙
南笙 2020-11-27 10:53

What are the most secure sources of entropy to seed a random number generator? This question is language and platform independent and applies to any machine on a network.

20条回答
  •  Happy的楠姐
    2020-11-27 11:40

    The most secure seed is a truly random one, which you can approximate in practical computing systems of today by using, listed in decreasing degrees of confidence:

    • Special hardware
    • Facilities provided by your operating system that try to capture chaotic events like disk reads and mouse movements (/dev/random). Another option on this "capture unpredictable events" line is to use an independent process or machine that captures what happens to it as an entropy pool, instead of the OS provided 'secure' random number generator, for an example, see EntropyPool
    • Using a bad seed (ie, time) and combine it with other data only known to you (for instance, hashing the time with a secret and some other criteria such as PIDs or internal state of the application/OS, so it doesn't necessarily increase and decrease according to time)

提交回复
热议问题