Date: Tue, 21 Dec 1999 15:09:17 +0200 From: Giorgos Keramidas <charon@hades.hell.gr> To: Fabrizzio Batista <fabrizzio.batista@lojasobino.com.br> Cc: freebsd-questions@freebsd.org Subject: Re: SALT Algorithm in PERL Message-ID: <19991221150917.F728@hades.hell.gr> In-Reply-To: <000601bf4ae3$0ac55780$65010180@lojasobino.com.br> References: <000601bf4ae3$0ac55780$65010180@lojasobino.com.br>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 20, 1999 at 10:09:17AM -0200, Fabrizzio Batista wrote:
|
| Hi gurus,
|
| I am using a FreeBSD box (3.3 S) in a ISP, and I need to make a
| script that change the users passwords. I am using the PERL language
| to make this, but I donīt have the SALT Algorithm.
If I recall this correctly, you can use a random pair of characters
from the [a-zA-Z0-9./] character class. Given a routine in perl that
returns a random integer between 0..63 (i.e. one called &rand64), you
can use:
# excuse the too long line here ;)
$universe = "./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$s0 = $universe[&rand64];
$s1 = $universe{&rand64];
$salt = "$s0$s1";
or something similar to this one, my perl is not that good, and I might
have made some silly mistake.
--
Giorgos Keramidas, <keramida@ceid.upatras.gr>
"What we have to learn to do, we learn by doing." [Aristotle]
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991221150917.F728>
