MySQL Forums
Forum List  »  Perl

Re: validating username and password in db???
Posted by: Nick Roper
Date: April 30, 2005 02:21AM

Hi Naveen,

Try:

use Digest::MD5 qw(md5 md5_hex md5_base64);

and then

$chkpassword = $query->param("password");
$md5password = md5($chkpassword);

Then validate:

if (($chkuser eq $name) && ($md5password eq $password))
{

etc....

}

Note: This will load the Digest::MD5 module and give you access to the following functions:

md5 - returns the md5 digest as a binary string
md5_hex - returns as a hex string
md5_base64 - returns as a base64 encoded string

Depending on how the password has been hashed, you may need one of the other functions.

Let me know if this works.

Nick

--
Nick Roper

Options: ReplyQuote


Subject
Written By
Posted
Re: validating username and password in db???
April 30, 2005 02:21AM
May 02, 2005 01:16AM
May 02, 2005 02:19AM
May 02, 2005 04:08AM
May 02, 2005 06:08AM
May 02, 2005 06:19AM
May 02, 2005 06:36AM
May 02, 2005 07:25AM
May 02, 2005 11:49PM
May 03, 2005 03:58PM
May 04, 2005 04:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.