Reputation: 18103
Im making a album system, and you can have the option to activate passwordsecure to it, so you can make your own password to the album.. What would be the most appropiate to use to store this, should i make it md5/sha1 crypted, or store it directly normaly in the db like "123".. ?
Upvotes: 2
Views: 132
Reputation: 42133
Always store passwords in encrypted form and also append salt before encryption....
The Secure Way to Store Passwords with PHP:
$password = 'ilovjenny84';
$salt = 'SHAKY SHARKY 333'; // some random string
$password_hash = sha1($salt.sha1($password.$salt)); // $password_hash = 4c3c8cbb4aa5de1c3ad9521501c6529506c6e5b4
Look at this article also:
PHP encryption for the common man
Upvotes: 3
Reputation: 64419
Don't store it plaintext, that's a no-go. Use a function of the SHA-family (like SHA1 is). Also, use a salt with your passwords.
Upvotes: 0