#!/usr/bin/perl
# returns crypted argument
# GPL Copyright (c) 2001 Bas Meijer
# adds just a little randomness: pid orred with time
MAIN:
	# initialize pseudo randomness
	srand($$|time);	
	local($passwd) = $ARGV[0];
	local($salt_string, $len, $salt, $epasswd);
	# different salts render different crypted strings for same string
	$salt_string = "abcdefghijkmnopqrstuvwxyz1234567890";
	$len = length( $salt_string );
   $salt=substr($salt_string,rand($len),1).substr($salt_string,rand($len),1);
	# crypt(3) should be available
	$epasswd = crypt($passwd, $salt);
	print "userPassword: crypt{$epasswd}";
__END__
