#!/usr/local/bin/perl # -*- perl -*- # generate salt srand( $$ ^ $^T ); @a = grep {/[a-zA-Z0-9]/} map {chr($_)} (0..256); $salt = $a[ rand( @a ) ] . $a[ rand(@a) ]; unless($clear=$ARGV[0]){ system "stty -echo"; print "Enter the Clear Text to be encrypted: "; chomp($clear=); system "stty echo"; print "\n"; } print crypt($clear, $salt), "\n";