Re: dd + /dev/urandom

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6:01 PM +0100 8/18/05, T. Horsnell wrote:
>OK guys, what going on here?
>Why is the length of dd's output file truncated if the job is
>paused and backgrounded? The problem is reproducible but the
>truncated lengths differ. It doesnt happen for if=/dev/zero

I don't understand either.  According to man urandom, /dev/random is
supposed to stop outputting bits when its entropy pool is exhausted, but
/dev/urandom is supposed to just keep outputting non-randomly after it runs
out of entropy.

The intended use of /dev/random is to seed some sort of pseudo-random
number generator (or some secure prng for crypto).  Normally one would only
read as few bits as one needs, or the next thing that looks there might not
find much randomness left.


>Cheers,
>Terry.
>
>
>
>[root@fmtest]# uname -a
>Linux fmtest.lmb.internal 2.6.11-1.35_FC3 #1 Mon Jun 13 00:52:08 EDT 2005
>i686 i686 i386 GNU/Linux
>
>[root@fmtest]# dd if=/dev/urandom of=junk100M.uran bs=1000000 count=100
>100+0 records in
>100+0 records out
>[root@fmtest]# ls -l junk100M.uran
>-rw-r--r--  1 root root 100000000 Aug 18 17:54 junk100M.uran
>
>
>
>[root@fmtest]# dd if=/dev/urandom of=junk100M.uran bs=1000000 count=100 &
>[1] 4516
>[root@fmtest]# 100+0 records in
>100+0 records out
>
>[1]    Done                          dd if=/dev/urandom of=junk100M.uran
>bs=1000000 count=100
>[root@fmtest]# ls -l junk100M.uran
>-rw-r--r--  1 root root 100000000 Aug 18 17:54 junk100M.uran
>
>
>
>
>[root@fmtest]# dd if=/dev/urandom of=junk100M.uran bs=1000000 count=100
>
>Suspended
>[root@fmtest]# bg
>[1]    dd if=/dev/urandom of=junk100M.uran bs=1000000 count=100 &
>[root@fmtest]# 99+1 records in
>99+1 records out
>
>[1]    Done                          dd if=/dev/urandom of=junk100M.uran
>bs=1000000 count=100
>[root@fmtest]# ls -l junk100M.uran
>-rw-r--r--  1 root root 99506220 Aug 18 17:55 junk100M.uran
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux