Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading entropy_avail file appears to consume entropy [closed]

Tags:

linux

entropy

The question have been asked in here http://www.gossamer-threads.com/lists/linux/kernel/1210167 but I don't see an answer.

AFAIK /proc/sys/kernel/random/entropy_avail should return the size of available entropy but should not consume it. At least I don't see any reason for that.

However, I have been noticing the same thing as OP for at least a year and now I executed in quick succession

% cat /proc/sys/kernel/random/entropy_avail 
3918
% cat /proc/sys/kernel/random/entropy_avail
3447
% cat /proc/sys/kernel/random/entropy_avail
2878
% cat /proc/sys/kernel/random/entropy_avail
2377
% cat /proc/sys/kernel/random/entropy_avail
1789
% cat /proc/sys/kernel/random/entropy_avail
1184
% cat /proc/sys/kernel/random/entropy_avail
577
% cat /proc/sys/kernel/random/entropy_avail
161
% cat /proc/sys/kernel/random/entropy_avail
133
% cat /proc/sys/kernel/random/entropy_avail
171

a while later I did the same with the same result, so I'm pretty sure the depletion of entropy is caused by the cat command.

Can anyone explain why this happens?

like image 840
Jan Matějka Avatar asked Nov 01 '12 02:11

Jan Matějka


1 Answers

Found an answer in here http://blog.flameeyes.eu/2011/03/entropy-broken

Starting a process consumes entropy

like image 133
Jan Matějka Avatar answered Nov 16 '22 03:11

Jan Matějka