smc Posted March 3, 2007 Share Posted March 3, 2007 Hey everyone, I really don't understand this MD5 buisness. Basically I want to encrypt my user's passwords into MD5 when they register but then how do I un-encrypt them so the script can verify if they're password is correct when they are logging in? If anyone could explain I would be very greatful! Link to comment https://forums.phpfreaks.com/topic/41049-passwords-in-php/ Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 you cant unencrypt md5, it's a one way encryption. what you CAN do though, is md5() the password they input and see if the md5 hash of that matches the md5 hash in the database Link to comment https://forums.phpfreaks.com/topic/41049-passwords-in-php/#findComment-198800 Share on other sites More sharing options...
coldkill Posted March 3, 2007 Share Posted March 3, 2007 That is what you need to do. md5() you can't decrypt. When the person enters the data md5 that and check it against what you have in the database. If it matches then they have input the correct password. md5 isn't supposed to help with brute forcing, it's supposed to encrypt data so it can't be read but not so it can't be compared against something. Link to comment https://forums.phpfreaks.com/topic/41049-passwords-in-php/#findComment-198808 Share on other sites More sharing options...
smc Posted March 3, 2007 Author Share Posted March 3, 2007 Ahh awesome, thanks! Link to comment https://forums.phpfreaks.com/topic/41049-passwords-in-php/#findComment-198811 Share on other sites More sharing options...
DeathStar Posted March 3, 2007 Share Posted March 3, 2007 or this may help you out a bit in register page : to get it in an encrypted form into the db md5('{$_POST['password']}') and on the login verifying page to check it: userpass`=md5('{$_POST['password']}')"); hope that helps Link to comment https://forums.phpfreaks.com/topic/41049-passwords-in-php/#findComment-198812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.