dave_pl has asked for the wisdom of the Perl Monks concerning the following question:
my $pass = <STDIN>; my $user = <STDIN>; my @salt = ('a'..'z', 'A'..'Z'); my $passc = crypt($pass, @salt[int(rand(@salt))] . @salt[int(rand(@sal +t))]); open my $fh, '>pass.pwd' or die $!; print $fh "$userñ$pass"; close($fh);
my $user = <STDIN>; my $pass = <STDIN>; my $bolead = 0; open my $fh, '<pass.pwd' or die $!; while(<$fh>){ my ($one, $two) = split(/\ñ/, $_); if($one eq $user){ $bolead = crypt($pass, $two) eq $two; } } if($bolead == 1){ print "MATCH"; }else{ print "NO MATCH"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: crypt help
by Random_Walk (Prior) on Apr 05, 2005 at 08:27 UTC | |
by dave_pl (Sexton) on Apr 05, 2005 at 08:51 UTC | |
by Random_Walk (Prior) on Apr 05, 2005 at 09:15 UTC | |
by dave_pl (Sexton) on Apr 05, 2005 at 10:06 UTC | |
by dave_pl (Sexton) on Apr 05, 2005 at 11:04 UTC | |
|
Re: crypt help
by Zaxo (Archbishop) on Apr 05, 2005 at 08:34 UTC | |
|
Re: crypt help
by TedPride (Priest) on Apr 05, 2005 at 09:24 UTC | |
by Random_Walk (Prior) on Apr 05, 2005 at 14:36 UTC |