Jump to content

Archived

This topic is now archived and is closed to further replies.

aeris130

md5 query

Recommended Posts

Suppose I have the following query:

[code]SELECT * FROM users WHERE username='My_user' AND password='my_password'[/code]

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?

Share this post


Link to post
Share on other sites
md5 are one way encryption so:


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

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.