From bern@penthesilea.uni-trier.de Wed Aug 16 01:03:01 1995 Date: Wed, 16 Aug 95 01:02:36 +0200 From: bern@penthesilea.uni-trier.de (Jochen Bern) Message-Id: <9508152302.AA23735@penthesilea.Uni-Trier.DE> To: ulla@Stupi.SE Subject: Re: Password generator Reply-To: bern@uni-trier.de X-Url: http://www.informatik.uni-trier.de/~bern/ X-Mailer: SUN OpenWindows 3.0 Mailtool plus JoesMailtool 1.1.2b X-Mailer-Source: ftp://ftp.informatik.uni-trier.de/pub/sunos/JoesMailtool/ Organization: Computer Science Department, University of Trier, Germany > I`m looking for a password generator, something to generate new > passwords for a lot of accounts. This one's more inclined to secure, really random Passwords which might not be easy to learn: penthesilea:/home/TI/bern% cat c-*/password.c #include #include char lowercase() { return random()%26+'a'; } char alphanum() { long num; num=random()%62+'0'; if (num>'9') num+='A'-':'; if (num>'Z') num+='a'-'['; return num; } main() { long i, j; char pass[9]; i=(long)time((time_t)0); srandom(i); j=random()^i; srandom(j); sleep(1); /* Required or next Call will get same time() */ pass[0]=lowercase(); for (i=1;i<8;i++) pass[i]=alphanum(); pass[8]='\0'; printf("%s\n",pass); } penthesilea:/home/TI/bern% password xgPA3f8V penthesilea:/home/TI/bern% password eIuaT6wX Note that the generated Passwords will *probably* pass 2.x Restrictions (i.e., contain a Digit), but not 100% sure. Regards, J. Bern -- /\ /""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""\ / \/ bern@uni-trier.de (Size Limit!) | P.O. Box 1203 | Ham: \/\ / J. \ bern@ti.uni-trier.de (SUNAttachm.OK) | D-54202 Trier | DD0KZ / \ \Bern/ No Finger etc.; Use Mail (Subj. "##" for Autoreply List) and \ / \ /\ WWW. /\/ \/ \____________________________________________________________/