What method would you call safest and most secure? I took these snippets off php.net. I\'m just wondering because people posted their own and I just couldn\'t catch on to u
If you change the first example to :
this will be secure enough for 99% of the application.
The only question is how to generate the salt. I recommend a fixed salt ($salt2) and on salt generated for each user ($salt1) which is stored in the database along the password.
This way you're pretty secure against rainbow table attack even if someone retrieves the content of your database.