Linux 如何使用/dev/uradom进行测试?
我最近遇到了一个错误,当我的linux服务器上的熵太低,读取/dev/uradom返回的字节数小于预期值时,我没有正确处理 我如何通过测试重新创建这个?有没有办法降低系统的熵或可靠地清空/dev/uradom 我希望能够有一个回归测试,将验证我的修复。我正在使用Ubuntu 12.04。根据手册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)读取大量字节。(多少取决于硬件和系统) 因此您不
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.