phathead22 has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to encrypt a password variable in PERL? Should I maybe pass it from
a config file? Thanks PH

Replies are listed 'Best First'.
Re: Encrypted passwords?
by Beatnik (Parson) on Jan 26, 2001 at 05:34 UTC
    If you're looking for a one way encryption, crypt() will do. CPAN lists alot of crypt modules that encrypt/decrypt. Among those listed are Rijndael (aka AES), Blowfish and DES and even a plain ROT13.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
Re: Encrypted passwords?
by TStanley (Canon) on Jan 26, 2001 at 05:30 UTC
    You can also take a look at the Digest::MD5 module as well. CPAN has this one and other similar modules.

    TStanley
    In the end, there can be only one!

      The other advantage to MD5 is that it encrypts to a constant size (within certain parameters I assume) of about 32 characters depending on what kind of information (bin, hex, base64) you're encoding.

      This is very handy if you're using a database to handle your passwords.

Re: Encrypted passwords?
by wardk (Deacon) on Jan 26, 2001 at 05:25 UTC

    crypt can encrypt all sort of stuff, incuding passwords.

Re: Encrypted passwords?
by john1987 (Acolyte) on Jan 27, 2001 at 01:36 UTC
    to encrypt ur passwords, u should use .htaccess. its a poweeful tool wen used right. if u use hypermart they have a section that encrypt words or phrases with ease. later. -john