There are many problems with what you are doing, but the worst is working with plain text passwords. Never, ever, for any reason store plain text passwords, especially paired with user names!
A fairly light weight technique that is much more secure and needs very little extra work is to store a cryptographic hash of the password combined with a seed (often the user name can be used as the seed). To check a supplied password use the same hash process that was used to generate the hash originally then compare the two hash codes.
use strict; use warnings; use Digest::MD5; print Digest::MD5::md5_hex("username" . "SamplePassword");
Prints:
c0075ad4e26ec3dee225ccb6387b0b77
In reply to Re: with CGI, How to have multiple usernames and passwords from a txt file (password.txt) file
by GrandFather
in thread with CGI, How to have multiple usernames and passwords from a txt file (password.txt) file
by theravadamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |