Ninjakreborn Posted July 24, 2006 Share Posted July 24, 2006 I am a little confused on how to hash, and there's not tutorials on it, if I pick salts and I forget what the salt is for each one, I will lose them, the same way with key handling. Sha1, Hash, mdhash, how do I hash them then compare the passwords up against the hash after I get the input from the form? Quote Link to comment https://forums.phpfreaks.com/topic/15485-hash-sha1/ Share on other sites More sharing options...
cmgmyr Posted July 24, 2006 Share Posted July 24, 2006 I use MD5 hashing for my passwords$password = "pass";$md5_pass = md5($password); (insert this into your database)After your user goes through the login convert the inputed password to md5 (like above) and query your database with it. (SELECT * FROM users where username = $username AND password = $md5_pass)Something like that.Hope that helped,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/15485-hash-sha1/#findComment-62807 Share on other sites More sharing options...
Ninjakreborn Posted July 24, 2006 Author Share Posted July 24, 2006 alright perfect thanks, do you ever use sha1 or other types, and what about salt, I have seen a lot about using salt, is there a purpose? Quote Link to comment https://forums.phpfreaks.com/topic/15485-hash-sha1/#findComment-62809 Share on other sites More sharing options...
Joe Haley Posted July 24, 2006 Share Posted July 24, 2006 If someone gets a users password (after having been hashed), its _EASY_ to find a collision for it. (allowing them to log in as that user)If someone gets a users password (after having been salted, then hashed), they may find a collision, but it will do them little good unless they can also get the salt, and algorythum used to hash the password. Quote Link to comment https://forums.phpfreaks.com/topic/15485-hash-sha1/#findComment-62821 Share on other sites More sharing options...
Ninjakreborn Posted July 24, 2006 Author Share Posted July 24, 2006 Ok that was what I don't understand then, how do I overcome the issue, do I use the exact same salt for every single password, like salt it with $salt = brccafor instance, just something random, or a big word, or sentence or something, then when I hash the other password for comparison, then I wuold just use the exact same salt, and if used with the same salt for all the passwords, it will work them all correctly right.I just need hash, get inputted password, hash, then match them up, which is all fine and good, I just want to make sure the salt, using the same oen over and over again, will always have a 100% compared affect. Unlike the stupid crypt() function, that is totally off. Quote Link to comment https://forums.phpfreaks.com/topic/15485-hash-sha1/#findComment-62833 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.