In the very early stages of designing a site and im just messing around with the login / register features What are people's opinions on storing passwords? From a security point of view and a general usability point of view! Site will be just for general info (its going to be student related) and i wont be storing any sensitive information but still know the passwords should be encrypted Is storing as MD5 the best solution (i know this has its own problem as regards lost passwords etc) Or is a two way encryption better? Havent really had much luck finding a good 2 way encryption algorithim (if anybody knows one that'd be cool)
Sorry to burst your bubble but FF has a good storage system for passwords. Reasons I wouldn't use it: 1. FF already does it 2. I wouldn't give any password to a site to store I'd rather store it on my computer. Good Luck tho
I don't think this is a good answer since he was referring on how to store the users's password on the server (is it!?). Well, I use md5 to encrypt the passwords before I store them into the database. INSERT INTO table_users (user, pass) VALUES ($user, md5($pass))
Well, md5 is a good encryption system, though I use a 2 way encryption algorithm(encrypt to store, decrypt to login).
Yeah its for storing passwords on the server srobona dont suppouse you want to share your 2 way algorithim Havent really found any good 1's on the internet Kind want users to be able to retrive their passwords if lost and MD5 dosent allow for this!
Well there's always a trade-off. So you should consider what is your higher priority. One-way enc is faster, but since it's one way, you can't decrypt it (theoretically). Two-way enc is generally slower, but allows you to retrieve back the password when needed. For what purpose do you want to encrypt the password in the db?
Have a look at this discussion of storing passwords (among other things): http://www.sitepoint.com/article/php-security-blunders You should be able to correct the "collision" scenario by generating both sha and md5 versions and checking against both. Generating a string that "collides" with both should be significantly harder than just one of them.
Use sha1! That is thebest solution. Search at google and you will find millions of pages describing why
If the "2 way encryption algorithm" means one could manually decrypt an encrypted password, then I'd simply stay away from it. MD5 encryption is just fine for storing passwords in a live environment, and sha1 can do the job just as well.
"2 way encryption algorithm" doesn't mean that any body can decrypt it. If you allow any one to decrypt an encrypted password, then it means nothing to use password, doesn't it?
Got your point here. An easily decryptable password scheme would be similar to storing unencrypted passwords. Ironically, I've seen scripts that were not encrypting passwords which was funny.
Agreed. In fact, I see 'forced resetting' as a FEATURE, not a BUG. If someone is currently able to access my email and the forum I was using just retrieved my password, then that person would be able to access my forum account without me knowing. At least if they are forced to reset that password, I would possibly think that something was up when I tried to logged in myself and apparently had the wrong password...