Advertisement
reenadak

salt generator

Feb 20th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1.     /*
  2.     - Salt Generator
  3.     - Generates salt which can be added to an encrypted password to make it harder to
  4.       decrypt. You will need to store the salt in a column in the user's row on the
  5.       database for when you check the password is correct when the user logs in again.
  6.     */
  7.    
  8.     public function generateSalt() {
  9.         $salt = hash("sha1", rand() . rand() . rand());
  10.         return $salt;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement