dream25 Posted June 5, 2007 Share Posted June 5, 2007 hi.. how to code for a secured password...Please Help me..Thanks in Advance Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/ Share on other sites More sharing options...
jitesh Posted June 5, 2007 Share Posted June 5, 2007 save encryplted password in database and descrypt when retrive. Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268286 Share on other sites More sharing options...
taith Posted June 5, 2007 Share Posted June 5, 2007 for example... store md5('password'); into the database.. then for your login... $user=$_POST[username]; #secure that $pass=md5($_POST[password]); $query=mysql_query("SELECT * FROM `users` WHERE `login`='$user' AND `pass`='$pass' LIMIT 1"); if $query pulls the row, your in, if not, redirect to login page Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268305 Share on other sites More sharing options...
dream25 Posted June 5, 2007 Author Share Posted June 5, 2007 Thanks.. here my doubt is how we know that MD5 password is working... Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268327 Share on other sites More sharing options...
taith Posted June 5, 2007 Share Posted June 5, 2007 echo md5($_POST[password]); she works Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268330 Share on other sites More sharing options...
Lumio Posted June 5, 2007 Share Posted June 5, 2007 md5 is not that save because many webapplications useing MD5 SHA-1 is better and the best is to make your own encryption For example: <?php function myownEncrypter($s) { $s = strrev($s).md5(strlen($s)); $s = sha1($s); return $s; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268333 Share on other sites More sharing options...
dream25 Posted June 5, 2007 Author Share Posted June 5, 2007 Thanks.. will u please explain the code what u gave.. and where will i use this function.. <?php function myownEncrypter($s) { $s = strrev($s).md5(strlen($s)); $s = sha1($s); return $s; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268338 Share on other sites More sharing options...
Lumio Posted June 5, 2007 Share Posted June 5, 2007 You use this function like md5... it's just a function that makes a little different hash. Sorry, I'm a little lazy so: strrev strlen md5 sha1 Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268343 Share on other sites More sharing options...
taith Posted June 5, 2007 Share Posted June 5, 2007 ya... if you md5 somin... you got bout 80% chance of finding its value on a google search lol.... however... sha1 is almost as bad... so you never want to encrypt one on its own... say... echo sha1(md5($s).strrev(sha1($s))); Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268345 Share on other sites More sharing options...
dream25 Posted June 5, 2007 Author Share Posted June 5, 2007 Thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/54267-secured-password/#findComment-268348 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.