Date: Tue, 8 Oct 2002 00:30:27 -0400 (EDT) From: Peter Leftwich <Hostmaster@Video2Video.Com> To: FreeBSD LIST <freebsd-questions@FreeBSD.ORG> Subject: Re: /dev/urandom is randomly cool Message-ID: <20021008002612.C35848-100000@earl-grey.cloud9.net> In-Reply-To: <200210062207.g96M7NgO056867@lurza.secnetix.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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: > > > > tr -cd a-zA-Z0-9 < /dev/urandom | dd bs=3D$len count=3D1 2>/dev/n= ull > > It didn't work. My shell is tcsh so I tried: > > tr -cd a-zA-Z0-9 < /dev/urandom | dd bs=3D8 count=3D1 >& /dev/null > > And all I got was the next prompt. > Yep, csh and tcsh suck pretty much. Not being able to separately > redirect stderr easily is one of the reasons. Bizarre. From now on I'll have to insert `bash ; ` before commands :) > 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 =2E..and random phone numbers :) # tr -cd 0-9 < /dev/urandom | head -c 10 ; echo "" 5031594488 > If your intention is to generate passwords, then you should also include = special characters, not just letters and digits. I once wrote a small shel= l script to generate good passwords: > http://www.secnetix.de/~olli/scripts/genpwd Nope. > After installing it somwhere in yout $PATH (for example in > /usr/local/bin) and making it executable, type "genpwd -h" Do any other flavors of unix come with password generators? > for usage information. It also uses /dev/urandom, if it > exists, but it also works fine without -- you can easily > remove that part from the script (three lines) and it will > still work with sufficient randomness, without having to > touch your kernel's entropy pool. 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? > BTW, the script can also be (ab)used for other things. > There are two examples in the usage message. > Regards > Oliver > Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 M=FCnchen > "All that we see or seem is just a dream within a dream" (E. A. Poe) Thanks again Oliver. -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 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?20021008002612.C35848-100000>