Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.