info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: password generation


From: Martín Marqués
Subject: Re: password generation
Date: Tue, 25 Sep 2001 08:09:52 -0300

On Mar 25 Sep 2001 05:30, you wrote:
> Martin,
> First one will hash a password, which you can throw into the CVSROOT/passwd
> file
> Second one will generate a random password for you.

Thanks! The hash was what I was looking for... That´s perl no?

Saludos... :-)

> Andrew
> ========================================
> # Hash a password
> sub HashPassword {
>   my ($self) = shift;
>   my $Password = shift || carp("No password supplied!");
>   srand (time());
>   my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 :
> 97))";
>   my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
>   my $crypttext = crypt ($Password, $salt);
>   return ${crypttext};
> }
>
> # Generate a random password
> sub GeneratePassword {
>   my ($self) = shift;
>   my $Charstring="23456789ABCDEFGHJKMNPQRSTUVWXYZ";
> #  my
> $Charstring="23456789ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz,.?!$%^
> &*()address@hidden<>";
>   my @Chars = split(//, $Charstring);
>   my $passwordLength = 12;
>   my $passwd = "";
>   srand (time());
>   for (my $i = 1; $i < $passwordLength; $i++) {
>     my $charPosition = int (rand ($#Chars));
>     $passwd .= $Chars[$charPosition];
>   }
>   return $passwd;
> }
> ========================================
> -----Original Message-----
> From: Martín Marqués [mailto:address@hidden
> Sent: 24 September 2001 22:52
> To: address@hidden
> Subject: password generation
>
>
> How can I generate passwords for my cvs server, so that it doesn't use the
> system passwords.
> Carrfull!!! I want a way to generate the passwords, not how to make cvs
> authenticate against another password file (I know how to do that).
>
> TIA

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        address@hidden
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]