Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Oct 2002 10:22:36 -0700
From:      "Kevin Oberman" <oberman@es.net>
To:        Peter Leftwich <Hostmaster@Video2Video.Com>
Cc:        FreeBSD LIST <freebsd-questions@FreeBSD.ORG>
Subject:   Re: /dev/urandom is randomly cool 
Message-ID:  <20021008172237.0034D5D04@ptavv.es.net>
In-Reply-To: Your message of "Tue, 08 Oct 2002 00:30:27 EDT." <20021008002612.C35848-100000@earl-grey.cloud9.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Tue, 8 Oct 2002 00:30:27 -0400 (EDT)
> From: Peter Leftwich <Hostmaster@Video2Video.Com>
> Sender: owner-freebsd-questions@FreeBSD.ORG
> 
> On Mon, 7 Oct 2002, Oliver Fromme wrote:
> > Peter Leftwich <Hostmaster@video2video.com> wrote:
> >  > On Sun, 6 Oct 2002, Fernando Gleiser wrote:
> >  > > On Sun, 6 Oct 2002, Mikko Ty=F6l=E4j=E4rvi wrote:
> 
> > In this particular case, you can use head instead of dd:
> > tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8
> 
> Thanks for that!  I was trying `cut -c` and didn't realize head had that
> flag.  Now I can generate 8 characters:
> 
> # tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8 ; echo ""
> 0tXx3p3m
> 
>	..and random phone numbers :)
> 
> # tr -cd 0-9 < /dev/urandom | head -c 10 ; echo ""
> 5031594488
> 
> Why is this an entropy pool and not an entropy ocean?  Is there a way to
> cat /dev/dsp or analyze my soundcard's mic-in and sample randomness?

Just how random is your sound card input? That is very dependent on
details of the A-D conversion and it may be FAR from really
random. The system is, justifiably paranoid!

If you add some devices to the entropy generator, you will get an
entropy ocean! I recommend the keyboard and mouse for a
workstation. The network interface is USUALLY a good one. The disk
interface is possible, but can to be less random than is ideal. Clocks
are a bad idea. :-)

Use vmstat -i to get a list of interrupt sources on your system and
use rndcontrol to add them to the entropy engine.

# vmstat -i
interrupt                   total       rate
ata0 irq14                3240348         10
ata1 irq15                      4          0
mux irq11                 1342389          4
pcm0 irq10                   3401          0
fdc0 irq6                       2          0
atkbd0 irq1                 58469          0
psm0 irq12                 872780          2
sio0 irq4                  441098          1
clk irq0                 31225225         99
rtc irq8                 39970907        128
Total                    77154623        247

# rndcontrol -s 11 -s 1 -s 12
rndcontrol: setting irq 1
rndcontrol: setting irq 11
rndcontrol: setting irq 12
rndcontrol: interrupts in use: 1 11 12

This is a pretty good way to get some significant data into the
system. the mouse/keyboard are always the best choices. The network is
normally pretty good, although some activity is pretty regular, but
not to the degree that should impact entropy.

R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021008172237.0034D5D04>