in reply to Tales from the crypt()
#!/usr/bin/perl -w use strict; my $data = "Perlmonks!"; $data = crypt( $data, "hj" ); print $data, "\n"; #Results in... C:\perl>perl crypt_test.pl hjCQi34Qt4uGE C:\perl>
#!/usr/bin/perl -w use strict; my $password; my $salt; print "Please enter password: "; chomp( $password = <STDIN> ); print "Enter two-char salt: "; chomp( $salt = <STDIN> ); $password = crypt( $password, $salt ); # Then to 'verify' the authenticity, use # the value of $password you obtained earlier. print "Please enter your password: "; chomp( my $guess = <STDIN> ); print "Imposter!" if( crypt($guess, $password) ne $password);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Tales from the crypt()
by derby (Abbot) on May 25, 2002 at 04:44 UTC | |
|
Re: Re: Tales from the crypt()
by IlyaM (Parson) on May 25, 2002 at 21:15 UTC |