sub encrypt { @saltset = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/'); $pass = $_[0]; $now = time; ($pert1, $pert2) = unpack("C2", "$username"); $week = $now / (60*60*24*7) + $pert1 + $pert2; $nsalt = $saltset[$week % 64] . $saltset[$now % 64]; $cryptpass = crypt($pass,$nsalt); return $cryptpass; }