Hello,
I work on a web application that uses md5_hex to store and verify passwords. I needed to write a perl program that can be run from the command line and connects up to the database but the user must pass in a username and password. I made the authentication pretty much exactly the same as how the web application uses it. This all works fine on my development server. However, when I take the code over to the production server at another site the password authentication fails from the command line but passes on the web. I print out what the password is md5_hexed into and it is clearly different than what it is on the development server (the password is hardcoded right now just for testing).
I find this very baffling, especially since the web authentication on the production server works fine (through apache and mod_perl). Could the command line program be using a different version of Digest::MD5 than the web?
How can I force it to use the latest version? This is how I use the Digest::MD5
This is a very simplifed version of it of course.
Thanks for the help.
Later
I work on a web application that uses md5_hex to store and verify passwords. I needed to write a perl program that can be run from the command line and connects up to the database but the user must pass in a username and password. I made the authentication pretty much exactly the same as how the web application uses it. This all works fine on my development server. However, when I take the code over to the production server at another site the password authentication fails from the command line but passes on the web. I print out what the password is md5_hexed into and it is clearly different than what it is on the development server (the password is hardcoded right now just for testing).
I find this very baffling, especially since the web authentication on the production server works fine (through apache and mod_perl). Could the command line program be using a different version of Digest::MD5 than the web?
How can I force it to use the latest version? This is how I use the Digest::MD5
Code:
use Digest::MD5 qw(md5_hex);
sub verify
{
my ($passSentIn,$storedPass) = @_;
my $md5pass = md5_hex("$passSentIn");
if($md5pass eq $storedPass)
{
#do stuff
}
This is a very simplifed version of it of course.
Thanks for the help.
Later