From red@crunch.usgmrl.ksu.edu Wed Aug 9 22:57:09 1995 Date: Wed, 9 Aug 1995 15:58:33 -0500 From: red@crunch.usgmrl.ksu.edu (Rick Dempster) Message-Id: <9508092058.AA21701@crunch> To: ulla@Stupi.SE Subject: Re: Password generator Content-Type: X-sun-attachment ---------- X-Sun-Data-Type: text X-Sun-Data-Description: text X-Sun-Data-Name: text X-Sun-Charset: us-ascii X-Sun-Content-Lines: 18 -> -> I`m looking for a password generator, something to generate new -> passwords for a lot of accounts. -> I use genpass to generate random passwords for root for all of my systems. It can be modified to generate any number of random passwds you like. I generate more characters than needed and then select 8 out of each set. I do this because other people have a copy of the generated passwords but the don't have the key to where to start, its in my head. Rick Dempster Net Admin USGMRL ---------- X-Sun-Data-Type: c-file X-Sun-Data-Description: c-file X-Sun-Data-Name: genpass.c X-Sun-Charset: us-ascii X-Sun-Content-Lines: 65 /* genpass.c * * * This program was written to generate root passwords. * Each password will be eight characters in length and * be a mix of alpha, numeric and special (characters * over the 1 though 0 keys). * * This program call a random number generator random.c * any must be supplied with new seeds every time. * */ #include #define SEED_X 249 #define SEED_Y 15036 #define SEED_Z 4343 int ix=SEED_X, iy=SEED_Y, iz=SEED_Z; void main() { double random(); int i,j, value; /*************************************************************/ printf("Enter the month --> "); fscanf(stdin,"%d",&ix); printf("Enter the day --> "); fscanf(stdin,"%d",&iy); printf("Enter the minute --> "); fscanf(stdin,"%d",&iz); printf("\n\nYour key is %d\n\n\n",(int) (random() * 122 + 1.0)); for (j=1; j<=10; j++) { for (i=1; i <= 24; i++) { do { value = (int) (random() * 122 + 1.0); } while ((value<35)|| (value>122)|| (value==39)|| (value==94)|| ((value>42)&&(value<48))|| ((value>57)&&(value<65))|| ((value>90)&&(value<97))); printf("%c",value); } printf("\n"); } } ---------- X-Sun-Data-Type: c-file X-Sun-Data-Description: c-file X-Sun-Data-Name: random.c X-Sun-Charset: us-ascii X-Sun-Content-Lines: 65 /**************************************************************** * * SOURCE FILE: random.c * * * FUNCTION: random() * * * DESCRIPTION: This functions is a C code implementation * of the Wichmann-Hill algorithm pseudo- * random number generator. * References: EECE 836 Class hand-out. * * * DOCUMENTATION * FILES: None. * * * ARGUMENTS: none. * * * RETURN: double * random() returns a pseudo-random number * between 0 and 1. * * * AUTHOR: Richard E. Dempster * * * DATE CREATED: 15 September 1991 * * * REVISIONS: None. * * ****************************************************************/ #include extern int ix, iy, iz; double random() { double modf(), intpart; ix = 171 * (ix % 177) - 2 * (ix / 177); iy = 172 * (iy % 176) - 35 * (iy / 176); iz = 170 * (iz % 178) - 63 * (iz / 178); if (ix < 0) ix += 30269; if (iy < 0) iy += 30307; if (iz < 0) iz += 30323; return(modf((double) ix / 30269.0 + (double) iy / 30307.0 + (double) iz / 30323.0, &intpart)); }