Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class User
  2. {
  3. var $username='User';
  4. var $password='Anything';
  5. var $hash="$2y$10$";
  6. var $salt;
  7.  
  8. function EncryptPassword()
  9. {
  10. $passwordcrypt=crypt($this->$password,$this->$hash . $this->$salt);
  11. echo "The crypted password is"."$passwordcrypt"."<br>";
  12. echo "<br>".$this->$salt."<br>";
  13. }
  14.  
  15. }
  16. if (isset($_POST['login'])) {
  17. $person= new User;
  18. $person->$username = $_POST['username'];
  19. $person->$password = $_POST['password'];
  20. $person-> $salt = md5(microtime());
  21. $person->EncryptPassword();
  22. echo "encrypted password is <br>".$person->$password_encrypt;
  23. echo "<br>encrypted password salt is <br>".$person->$salt;
  24. }
  25.  
  26. $salt = 'thisissomecrazystrings';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement