[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] what's the difference between
- Subject: [ale] what's the difference between
- From: ale at pcartwright.com (Paul Cartwright)
- Date: Fri, 5 Dec 2008 14:15:09 -0500
- In-reply-to: <[email protected]>
- References: <[email protected]>
On Fri December 5 2008, Jim Kinney wrote:
> Is there a way to "add entropy" to get /dev/random to fill quicker?
When a Linux system starts up without much operator interaction, the
entropy pool may be in a fairly predictable state. This reduces the
actual amount of noise in the entropy pool below the estimate. In
order to counteract this effect, it helps to carry entropy pool
infor???
mation across shut-downs and start-ups. To do this, add the following
lines to an appropriate script which is run during the Linux system
start-up sequence:
echo "Initializing random number generator..."
random_seed=/var/run/random-seed
# Carry a random seed from start-up to start-up
# Load and then save the whole entropy pool
if [ -f $random_seed ]; then
cat $random_seed >/dev/urandom
else
touch $random_seed
fi
chmod 600 $random_seed
poolfile=/proc/sys/kernel/random/poolsize
[ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
dd if=/dev/urandom of=$random_seed count=1 bs=$bytes
Also, add the following lines in an appropriate script which is run
during the Linux system shutdown:
# Carry a random seed from shut-down to start-up
# Save the whole entropy pool
echo "Saving random seed..."
random_seed=/var/run/random-seed
touch $random_seed
chmod 600 $random_seed
poolfile=/proc/sys/kernel/random/poolsize
[ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
dd if=/dev/urandom of=$random_seed count=1 bs=$bytes
--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459