Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I need to veryify a UNIX user from a webpage. I am trying to compare the encrypted password entry in the password file with the one submitted on the webpage. I can never get a match, however. I'm using the standard encryption function:
sub encrypt { @saltset = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/'); $pass = $_[0]; $now = time; ($pert1, $pert2) = unpack("C2", "$username"); $week = $now / (60*60*24*7) + $pert1 + $pert2; $nsalt = $saltset[$week % 64] . $saltset[$now % 64]; $cryptpass = crypt($pass,$nsalt); return $cryptpass; }
However, this function uses the time to set the salt. So my question is, since this function will return a different encrypted password every time, how do I authenticate a user?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: UNIX user authentication
by trantor (Chaplain) on Oct 31, 2001 at 19:33 UTC | |
Re: UNIX user authentication
by davis (Vicar) on Oct 31, 2001 at 20:00 UTC | |
Re: UNIX user authentication
by fokat (Deacon) on Oct 31, 2001 at 21:09 UTC | |
Re: UNIX user authentication
by claree0 (Hermit) on Oct 31, 2001 at 19:34 UTC |
Back to
Seekers of Perl Wisdom