Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User
- {
- var $username='User';
- var $password='Anything';
- var $hash="$2y$10$";
- var $salt;
- function EncryptPassword()
- {
- $passwordcrypt=crypt($this->$password,$this->$hash . $this->$salt);
- echo "The crypted password is"."$passwordcrypt"."<br>";
- echo "<br>".$this->$salt."<br>";
- }
- }
- if (isset($_POST['login'])) {
- $person= new User;
- $person->$username = $_POST['username'];
- $person->$password = $_POST['password'];
- $person-> $salt = md5(microtime());
- $person->EncryptPassword();
- echo "encrypted password is <br>".$person->$password_encrypt;
- echo "<br>encrypted password salt is <br>".$person->$salt;
- }
- $salt = 'thisissomecrazystrings';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement