Jump to content

[SOLVED] Password Encryption Suggestions


Mongoose+

Recommended Posts

Hello,

 

I am looking to encrypt passwords before storing them in MYSQL. I am wondering which method is better. If neither are good, are there any better suggestions.

 

Option 1:

I make a fake key like dfah3jh3j4h2j9 then I get the username and password from the web form, sanitize it for XSS and make a new hash variable using sha1 with username.key. I go into the mysql query using AES_ENCRYPT(password,hash).

 

Option 2:

I make the same hash using sha1(username.key) and instead of AES_ENCRYPT I simply encrypt the password using sha1(password.hash) and store that into the mysql field.

 

I have no need for password lookups, so a decryption is not necessary. Any suggestions or thoughts would be appreciated.

 

Thanks,

Mongoose+

Link to comment
https://forums.phpfreaks.com/topic/148790-solved-password-encryption-suggestions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.