in reply to Protecting passwords in source
Encrypt the password. Don't decrypt it. When you enter your password, simply encrypt what you enter, and compare it to what is encrypted in the program.
Example:
'password' encrypts to 'D4k454NwEj3'.
Put this into your program. When your program asks for the password, have it create the encrypted version of it, using the same algorithm. Then compare the two results. That way, your clear-text password is never kept on the disk, and your evil cow-orkers won't be able to get at it.
Check the CPAN archives for encryption modules.
|
|---|