#!/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 = ); print "Enter two-char salt: "; chomp( $salt = ); $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 = ); print "Imposter!" if( crypt($guess, $password) ne $password);