Jump to content


Photo

md5 query


  • Please log in to reply
2 replies to this topic

#1 aeris130

aeris130
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 24 March 2006 - 07:27 PM

Suppose I have the following query:

SELECT * FROM users WHERE username='My_user' AND password='my_password'

Now, since my passwords are encrypted in md5, the only way to type them in like this would be to use their decrypted form. Is there any way to decrypt "my_password" before comparing it to the database?

#2 holowugz

holowugz
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 24 March 2006 - 07:36 PM

md5 are one way encryption so:


$username = $_POST['username'];
$my_password = md5($_POST['password']);

SELECT * FROM users WHERE username='$username AND password='$my_password'

#3 aeris130

aeris130
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 24 March 2006 - 07:44 PM

Ah, thanks a lot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users