08-06-2002, 05:51 PM
Hi, I need to encrypt people's passwords that are getting stored in a database. I've been told to use the Util.pm package. I can't find any documentation on it. I know how to include it, but not how to use it, can anyone give me a little starter on encryption? Just the funtions I need to encrypt a string.
08-06-2002, 06:30 PM
What kind of encryption are you after?
One-way (hashing - i.e. the encrypted text cannot be decoded)
Two-way symmetrical (one key both encodes and decodes the text)
Two-way assymetrical (there are two keys, one for encrypting and one for decrypting)
If you're using passwords I'd personally go for hashing of the passwords myself. There's a builtin function called crypt() (http://www.perldoc.com/perl5.8.0/pod/func/crypt.html) which does just this. What you can do then is compare the encrypted form of the password supplied for authentication purposes with the one stored in the database.