Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何使用/dev/uradom进行测试?_Linux_Security_Ubuntu_Random_Entropy - Fatal编程技术网

Linux 如何使用/dev/uradom进行测试?

Linux 如何使用/dev/uradom进行测试?,linux,security,ubuntu,random,entropy,Linux,Security,Ubuntu,Random,Entropy,我最近遇到了一个错误,当我的linux服务器上的熵太低,读取/dev/uradom返回的字节数小于预期值时,我没有正确处理 我如何通过测试重新创建这个?有没有办法降低系统的熵或可靠地清空/dev/uradom 我希望能够有一个回归测试,将验证我的修复。我正在使用Ubuntu 12.04。根据手册 read from the /dev/urandom device will not block 如果要阻止,应该从/dev/random(不带任何u)读取大量字节。(多少取决于硬件和系统) 因此您不

我最近遇到了一个错误,当我的linux服务器上的熵太低,读取/dev/uradom返回的字节数小于预期值时,我没有正确处理

我如何通过测试重新创建这个?有没有办法降低系统的熵或可靠地清空/dev/uradom

我希望能够有一个回归测试,将验证我的修复。我正在使用Ubuntu 12.04。

根据手册

read from the /dev/urandom device will not block
如果要阻止,应该从
/dev/random
(不带任何
u
)读取大量字节。(多少取决于硬件和系统)

因此您不能“exaust”
/dev/uradom
,因为

我认为您应该使用
/dev/random
,它确实可以通过阻塞而耗尽。
但是你不应该从中读取超过256位的信息。

你可以通过反复读取铀来消耗熵。您可以在
/proc/sys/kernel/random/
 A read from the /dev/urandom device will not block waiting for 
 more entropy. As a result, if there is not sufficient entropy in 
 the entropy pool, the returned values are theoretically vulnerable 
 to a cryptographic attack on the algorithms used by the driver.