wrathican Posted January 31, 2008 Share Posted January 31, 2008 hey im using a database with users registered. they have passwords and usernames i know how to check the login but for some reason the md5 encrypted password when inserted into the DB is different from the one thats gets posted from the login screen i must be doing something wrong Quote Link to comment Share on other sites More sharing options...
drisate Posted January 31, 2008 Share Posted January 31, 2008 When encryted the password looks diffrent. To check if a password is the same ecrypt the sended password and compare them $new_pass=md5($_POST[pass]); if ($new_pass == $the_pass_in_the_DB) ... Quote Link to comment Share on other sites More sharing options...
haku Posted January 31, 2008 Share Posted January 31, 2008 and use sha1, not md5. More secure. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 31, 2008 Share Posted January 31, 2008 are you double encrypting somewhere, such as: <?php $password = md5(md5($_POST['password'])); ?> or you could be encrypting it once, then further down somewhere encrypting it again because you forgot you already encrypted it. ??? Quote Link to comment Share on other sites More sharing options...
drisate Posted January 31, 2008 Share Posted January 31, 2008 Drink a cofee and smoke a cig everytime you start coding and that will never happend hehe Quote Link to comment Share on other sites More sharing options...
wrathican Posted January 31, 2008 Author Share Posted January 31, 2008 ahh dammit, turns out i was double encrypting. thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.