in reply to with CGI, How to have multiple usernames and passwords from a txt file (password.txt) file
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: with CGI, How to have multiple usernames and passwords from a txt file (password.txt) file
by theravadamonk (Scribe) on Sep 26, 2018 at 10:17 UTC | |
by marto (Cardinal) on Sep 26, 2018 at 10:31 UTC | |
by theravadamonk (Scribe) on Sep 26, 2018 at 11:00 UTC | |
by marto (Cardinal) on Sep 26, 2018 at 11:13 UTC | |
by theravadamonk (Scribe) on Sep 27, 2018 at 05:09 UTC | |
| |
by hippo (Archbishop) on Sep 26, 2018 at 11:23 UTC |