From owner-freebsd-hackers Fri Nov 20 15:17:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA04996 for freebsd-hackers-outgoing; Fri, 20 Nov 1998 15:17:46 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from joshua.enteract.com (joshua.enteract.com [207.229.129.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA04991 for ; Fri, 20 Nov 1998 15:17:45 -0800 (PST) (envelope-from djhoward@joshua.enteract.com) Received: (qmail 7056 invoked by uid 1032); 20 Nov 1998 23:17:14 -0000 Message-ID: <19981120171714.P14320@enteract.com> Date: Fri, 20 Nov 1998 17:17:14 -0600 From: dannyman To: ee123@rocketmail.com, freebsd-hackers@FreeBSD.ORG Subject: Re: Password generator References: <19981120163916.17293.rocketmail@web1.rocketmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <19981120163916.17293.rocketmail@web1.rocketmail.com>; from EE on Fri, Nov 20, 1998 at 08:39:16AM -0800 X-Loop: djhoward@uiuc.edu X-URL: http://www.dannyland.org/~dannyman/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Nov 20, 1998 at 08:39:16AM -0800, EE wrote: > Hy, > I'm looking for a password generator. > Does anybody know where I can found one? Perl code snippet: sub get_password { my @ary = ( 0 .. 9, 'A' .. 'Z', 'a' .. 'z', 'z', '!', '$', '%'); my $password; my $pw_len = rand(5)+6; for(1..$pw_len) { $password .= $ary[rand(@ary)]; } return $password; } This is actually a labotomised function call that's part of a script I wrote to add users to our system. It generates a random password if the user doesn't supply one. -danny -- // dannyman yori aiokomete || Our Honored Symbol deserves \\/ http://www.dannyland.org/~dannyman/ || an Honorable Retirement (UIUC) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message