Anyone know of a random data generator?

Derek Martin invalid at pizzashack.org
Thu Jul 29 15:35:00 EDT 2004


On Thu, Jul 29, 2004 at 02:48:27PM -0400, Dan Coutu wrote:
> For some tests I'm running it would be really useful to have a
> random (or even semi-random) data source that can be used for making
> really big files of arbitrary size. It turns out to be trickier than
> I had expected. 

No, you just had the wrong source file...

> So, any other bright ideas?

Yes.  :)

I ran the following command on my terminal:

  $ cat /dev/random

The result was that it spit out a few hundred characters, and then
slowly spit out more, and then stopped.  Then I tried this:

  $ dd if=/dev/random of=junk bs=4096 count=4096

It took a while, but I got about 32k from this.  I was typing and
using the mouse in other windows though.  The trouble is that
/dev/random is not what you're looking for...  you want /dev/urandom.
The data supplied by /dev/random should be high-quality random data,
but it stops when the entropy pool runs out.  

By contrast, /dev/urandom will provide as much pseudo-random data as
you need, but the level of randomness will be lower, possibly subject
to cryptographic attack, if that is important to you.

  $ dd if=/dev/urandom of=junk bs=1024 count=1024
  1024+0 records in
  1024+0 records out
  $ ls -lh junk
  -rw-r--r--    1 ddm      ddm          1.0M Jul 30 04:21 junk

I think that's more like what you're expecting.  For details, see:

  $ man 4 random 
  
Note that the 4 is important; without it you'll be looking at the
wrong man page.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

In order for the government to be said to represent the people, it
must not lie or conceal the truth from the people.  It is inherently impossible
for a government to represent a people who have no knowledge of what it is 
doing.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20040729/03f7fffb/attachment.bin


More information about the gnhlug-discuss mailing list