From owner-freebsd-questions Sun Oct 6 12:23:29 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE81537B401 for ; Sun, 6 Oct 2002 12:23:27 -0700 (PDT) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id A35FC43E6A for ; Sun, 6 Oct 2002 12:23:26 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.12.3/8.12.3) with ESMTP id g96JL9DH003612; Sun, 6 Oct 2002 16:21:09 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Sun, 6 Oct 2002 16:21:08 -0300 (ART) From: Fernando Gleiser To: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= Cc: Peter Leftwich , FreeBSD Questions LIST Subject: Re: /dev/urandom is randomly cool In-Reply-To: <20021006005506.W308-100000@atlas.home> Message-ID: <20021006161444.H90352-100000@cactus.fi.uba.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Spam-Status: No, hits=-3.4 required=5.0 tests=IN_REP_TO version=2.31 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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/null > > Which will give you $len random bytes from the set a-zA-Z0-9 (it reads > a lot more from /dev/urandom than it produces though). yes, and that is bad :( It is not good to mess with /dev/[u]random more than what's really needed, because you can exhaust the entropy pool, and that's a Bad Thing. In your home box, for learning purposes, that's OK, but in a production box which needs a good working prng (for crypto session keys, auth cookies and = the like) it is not acceptable to "eat" all the entropy pool unless you have a very good reason to do so. =09=09=09Fer > > Another answer is, as always, "use perl" :-) > > $.02, > /Mikko > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message