2020-04-18, 09:56 PM
Well to be honest its first time a costumer asked me for a SHa1 store and load from database as its not that safe anymore , myself i use bcrypt all the time.
However im trying to come together with this? login / signup system and at signup everything works perfectly , sha1 encrypts it and stores it to the database
Now the issue its the loading from database , even tho i write the same password it still doesnt work
this is the code from loading the Sha1
Storing
Help me pelase , i really need this.
However im trying to come together with this? login / signup system and at signup everything works perfectly , sha1 encrypts it and stores it to the database
Now the issue its the loading from database , even tho i write the same password it still doesnt work
this is the code from loading the Sha1
PHP Code:
$hashpass = sha1($userpass);
? ? ? ? ? ? ? ?if (password_verify($hashpass, $row['password']))
? ? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? ? ?session_start();
? ? ? ? ? ? ? ? ? ?$_SESSION['userid'] = $row['Master_ID'];
? ? ? ? ? ? ? ? ? ?header("Location:../index.php?login:sucess");
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?else{
? ? ? ? ? ? ? ? ? ?header("Location:../login.php?error:wrongpassword");
? ? ? ? ? ? ? ? ? ?exit();
? ? ? ? ? ? ? ?}
Storing
PHP Code:
$hashedpass = sha1($password);
? ? ? ? ? ? ? ? ? ? ? ?mysqli_stmt_bind_param($stmt, "sss", $username, $email, $hashedpass);
? ? ? ? ? ? ? ? ? ? ? ?mysqli_stmt_execute($stmt);
? ? ? ? ? ? ? ? ? ? ? ?header("Location:../index.php?Signup:Sucessful");
Help me pelase , i really need this.