home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1332
< prev
next >
Wrap
Internet Message Format
|
1990-12-28
|
3KB
From: dave@lsuc.on.ca (David Sherman|LSUC|Toronto)
Newsgroups: alt.security,alt.sources
Subject: Re: automatic password creation
Message-ID: <1990May13.224948.2139@lsuc.on.ca>
Date: 13 May 90 22:49:48 GMT
hogan@csl.sri.com (Emmett Hogan) writes:
>
>On one of our OLD, ANCIENT, ARCHAIC machines around here (so I am
>told, it is gone now) we used to have a program that generated
>nonsense passwords, but used an algorithm that combined vowels and
>consonants in such a way as to make them pronounceable and thus easier
>to remember. The user was given a choice of three or four of these
>words to choose from when he/she wanted to change their password. It
>would be trivial to have the program check to make sure that it didn't
>generate a "real" word by accident.
>
>Has anyone seen or written such a beast for UNIX systems?
I wrote this program in 1985. It's called "genp" (generate passwords).
We have about 1,200 new law students a year who need accounts, and we
use genp to generate them.
------------------ cut here, save as genp.c, and compile -----------
/* genp - generate pronounceable passwords.
* David Sherman, The Law Society of Upper Canada, dave@lsuc.on.ca
*/
#include <stdio.h>
char pwd[100];
char *vowels[] =
{
"a",
"e",
"i",
"o",
"u",
"y",
"ai",
"ou",
"oy",
"ay",
"ow",
"ar",
"al",
"el",
"er",
"or",
"ax",
"ex",
"ix",
"il",
0
};
char *consonants[] =
{
"b",
"c",
"ch",
"d",
"dr",
"f",
"fl",
"g",
"h",
"j",
"k",
"kn",
"kr",
"m",
"n",
"p",
"s",
"sh",
"sm",
"sn",
"st",
"t",
"th",
"v",
"z",
0
};
main(argc, argv)
char **argv;
{
register int maxvowels, maxcons;
int total;
register int r, i;
int j;
char **p;
#define DEFTOTAL 50
if(argc < 2)
total = DEFTOTAL;
else
total = atoi(argv[1]);
if(total < 1)
total = DEFTOTAL;
for(p=vowels; *p; p++)
;
maxvowels = p-vowels;
for(p=consonants; *p; p++)
;
maxcons = p-consonants;
srand(getpid());
for(j=0; j<total; j++)
{
r = rand();
strcpy(pwd, consonants[r%maxcons]);
for(i=r%5; i>0; i--)
r = rand();
strcat(pwd, vowels[r%maxvowels]);
r = rand();
strcat(pwd, consonants[r%maxcons]);
for(i=r%7; i>0; i--)
r = rand();
strcat(pwd, vowels[r%maxvowels]);
r = rand();
strcat(pwd, consonants[r%maxcons]);
for(i=r%3; i>0; i--)
r = rand();
strcat(pwd, vowels[r%maxvowels]);
puts(pwd);
}
}
------------------ cut here -----------------------------------------
Sample passwords:
moypexcex
caypeldai
shipelpor
malfyfay
gaysnowthor
powhousnai
koydrosax
howjerkar
flyzilcai
dipalfa
>
>What are your thoughts concerning such an approach to the password dilemma?
I have one concern. If the program source is known, it's possible
to predict the possible passwords -- there are only 30000 lists,
using getpid() as the seed. So, if you are planning on using this
for passwords that matter (our student accounts can't do anything except
take CAI courses), I'd recommend you make a minor change. Add or delete
an entry to or from the vowel or consonant lists, or change the number
of times rand() is called in any of the lines above. Then protect the source.
(I've made such a change already before posting this:-)
David Sherman
The Law Society of Upper Canada
Toronto
--
Moderator, mail.yiddish
{ uunet!attcan att utzoo }!lsuc!dave dave@lsuc.on.ca