What is the most secure seed for random number generation?

后端 未结 20 1944
南笙
南笙 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条回答
  •  攒了一身酷
    2020-11-27 11:31

    As an interesting take on one-time pads, whenever I'm engaged in espionage I have a system whereby I need only communicate a few letters. For example, the last time I was selling secret plans to build toasters to the Duchy of Grand Fenwick, I only needed to whisper:

    enonH

    to my confederate. She knew to get http://is.gd/enonH- (this is a "safe" expander URL which takes you to the is.gd expansion page which in turn points to a completely SFW image of a frog). This gave us 409k bits of one-time pad or - if I wink while whispering "enonH" - she knows to take the hash of the image and use that as a decoding key for my next transmission.

    Because of the compression in JPEG images they tend to be relatively good sources of entropy as reported by ent:

    $ ent frog.jpg
    Entropy = 7.955028 bits per byte.

    Optimum compression would reduce the size of this 51092 byte file by 0 percent.

    Chi square distribution for 51092 samples is 4409.15, and randomly would exceed this value 0.01 percent of the times.

    Arithmetic mean value of data bytes is 129.0884 (127.5 = random).
    Monte Carlo value for Pi is 3.053435115 (error 2.81 percent).
    Serial correlation coefficient is 0.052738 (totally uncorrelated = 0.0).uncorrelated = 0.0).

    Combine that with the nearly impossible to guess image that I directed her to and my secret toaster plans are safe from The Man.

提交回复
热议问题