Could a truly random number be generated using pings to pseudo-randomly selected IP addresses?

后端 未结 23 1639
天命终不由人
天命终不由人 2021-01-30 16:28

The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device.

Th

23条回答
  •  粉色の甜心
    2021-01-30 16:31

    here is my suggestion :

    1- choose a punch of websites that are as far away from your location as possible. e.g. if you are in US try some websites that have their server IPs in malasia , china , russia , India ..etc . servers with high traffic are better.

    2- during times of high internet traffic in your country (in my country it is like 7 to 11 pm) ping those websites many many many times ,take each ping result (use only the integer value) and calculate modulus 2 of it ( i.e from each ping operation you get one bit : either 0 or 1).

    3- repeat the process for several days ,recording the results.

    4- collect all the bits you got from all your pings (probably you will get hundreds of thousands of bits ) and choose from them your bits . (maybe you wanna choose your bits by using some data from the same method mentioned above :) )

    BE CAREFUL : in your code you should check for timeout ..etc

提交回复
热议问题