Password security for photo albums
Im making a album system, and you can have the option to activate passwordsecure to it, so you can make your own开发者_JAVA百科 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".. ?
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
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.
精彩评论