On Monday 24 March 2003 05:38, Tony wrote:
> Is there a program that will give unique passwords to be as login
> passwords. I seems to always stumble over deciding what it do.
>
> Idealy the program would do somethin like running the backgound generating
> passwords or random numbers and when asked generate a login password...
>
> Thanks
>
This C program will generate random passwords.
/* Copyright (C) Jan-Espen Pettersen
* This software is distributed WITHOUT ANY WARRANTY
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int min_lenght = 8;
int max_lenght = 30;
int a;
long int b;
char *c =
"-abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ---_/*+1234567890!#---1234567890-";
char *d;
long int e;
srandomdev();
e = random();
e = min_lenght + (e % ((max_lenght - min_lenght) + 1));
printf("lenght=%d\n", e);
e++;
d = (char *) malloc(e);
e--;
d[e] = 0;
a = 0;
while (a < e)
{
b = random();
b = b % strlen(c);
d[a] = c[b];
a++;
};
printf("password=\"%s\"\n", d);
};
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message