my $p = "howdy"; my $salt = substr($p,0, 2); #define salt however you want my $crypted = crypt($p, $salt); print "Crypted form of $p is $crypted\n"; #### my $p="ho8dIXKikSTi2"; #better than displaying actual password my $password=param('password'); my $salt = substr($p,0, 2); my $crypted = crypt($p, $salt); if ($p eq $crypted) { #it worked } else { #try again }