Great Circle Associates Majordomo-Workers
(August 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Quickies
From: Oliver Xymoron <oxymoron @ waste . org>
Date: Wed, 19 Aug 1998 11:12:09 -0500 (CDT)
To: Jason L Tibbitts III <tibbs @ hpc . uh . edu>
Cc: majordomo-workers @ greatcircle . com
In-reply-to: <ufahfz9hec3.fsf@sina.hpc.uh.edu>

On 18 Aug 1998, Jason L Tibbitts III wrote:

> Anyone have code to generate a reasonable password randomly?  I feel that
> assigning random garbage as initial passwords is just going to result in
> people not using them.

This code generates alphanumeric passwords of different forms in a fairly
easy to expand way. I already use something like this to give out list
passwords.

#!/usr/bin/perl

srand(time+$$);

sub f
{
  return substr(@_[0],int(rand(length(@_[0]))),1);
}

@forms=qw/
    xxxxxxx
    xxxxxx0
    000xxxx
    xxx0000
    xxxx000
    0xxxxx0
    xxxxx00 
    00xxxxx 
    xxx00xxx 
    00xxxx00
    Cvcvcvc
    cvcvc000
    000cvcvc
    Cvcvcvc0
    xxx00000/;

%groups= (
	  'x' => "abcdefghijkmnpqrstuvwxyz",
	  'X' => "ABCDEFGHJKLMNPQRSTUVWXYZ",
	  'c' => "bcdfghjklmnpqrstvwxyz",
	  'C' => "BCDFGHJKLMNPQRSTVWXYZ",
	  'v' => "aeiou",
	  'V' => "AEIOU",
	  '0' => "0123456789"
	  );

$pw=$forms[int(rand(@forms))];
$pw=~s/(.)/f($groups{$1})/ge;

print "$pw\n";

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 



References:
  • Quickies
    From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Indexed By Date Previous: Re: Quickies
From: "Frank P. Bresz" <fpb@BreszLand.COM>
Next: Re: Quickies
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Indexed By Thread Previous: Re: randomness (was Re: Quickies)
From: Rich Pieri <rich.pieri@prescienttech.com>
Next: Re: Quickies
From: Brock Rozen <brozen@torah.org>

Google
 
Search Internet Search www.greatcircle.com