有人问我:
Using your raspberry pi, write a python script that determines the randomness of /dev/random and /dev/urandom. Read bytes and histogram the results. Plot in matplotlib. For your answer include the python script.
我目前对“决定随机性”的措辞迷茫了
我可以从铀和随机阅读:
#rb - reading as binary
devrndm = open("/dev/random", 'rb')
#read to a file instead of mem?
rndmdata = devrndm.read(25) #read 25bytes
或者
^{pr2}$我认为这是一个比随机运动更快的目标。然而,如果我试图阅读任何超过15的东西,阅读的时间似乎会成倍增加。在
所以我现在不知道如何比较“随机性”。如果我把urandom和random都读到各自的文件中,我怎么能比较它们呢?在
你的经历也许正是他们所期待的。从《天王星》的手册页(4):
注意关于阻塞的一点。天王星不会,随机会。特别是在嵌入式环境中,可能很难获得额外的熵,这会导致您看到的阻塞。在
是否可以简单到:
例如,请求256个字节并不能返回256个唯一值。所以你可以根据唯一计数绘制出不断增加的样本量,直到它达到256个饱和点。在
相关问题 更多 >
编程相关推荐