in reply to Protecting passwords in source

It depends if you need the password in plaintext to pass to something else. If not, you could do a one time shot with the following:
perl -le 'print crypt("your password here", "FO")'
Then in your actual script
my $password = getpassword(); if ( crypt($password, "FO") ne "crypted password from one-liner") { #your code here }
However, this provides a false sense of security. There's nothing that prevents someone from copying your script and changing the conditional to if(1) {. One other caveat: don't bother picking a password that's longer than 8 characters; crypt truncates at 8 characters for historical reasons.

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^2: Protecting passwords in source
by Llew_Llaw_Gyffes (Scribe) on Jul 20, 2005 at 03:53 UTC
    However, this limitation can be readily circumvented by using md5crypt() instead (or, in Perl, Digest::MD5).