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 Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/ 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) ... Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/#findComment-454346 Share on other sites More sharing options...
haku Posted January 31, 2008 Share Posted January 31, 2008 and use sha1, not md5. More secure. Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/#findComment-454348 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. ??? Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/#findComment-454351 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 Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/#findComment-454352 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! Link to comment https://forums.phpfreaks.com/topic/88719-solved-md5-encryption/#findComment-454371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.