in reply to Mention password in the script -encrypted form

Do you just want to encrypt a password with the standard unix hash method in your script? Here is a small script that encrypts a password:

use strict; my $inp; srand(time() ^ $$); print "Please enter password:\n"; system "stty -echo"; chop($inp= <STDIN>); print "\n"; system "stty echo"; my $i= chr(rand(26)+ord('a')) . chr(rand(26)+ord('a')); print crypt( $inp,$i ),"\n";

But you can't use the encrypted form to connect to some service that needs the password. That is not possible!

If that is what you wanted you have to store the password in the clear. You can only really secure it if you store the password in a file only the script can read (in unix the script has to have its suid-flag set so it is executed with the rights of the script owner and the password file should be only readable by the script owner)