# Generate a Salt $fullname = "Users Name"; $now = time; ($pert1, $pert2) = unpack("C2", "$fullname"); $week = $now / (60*60*24*7) + $pert1 + $pert2; $salt = ($week % 64) + ($now % 64); $salt = sprintf("%lx", $salt); # Use crypt to encrypt our password $passwd = crypt($password, $salt); #### my $salt = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]; my $passwd = crypt($password, $salt);