Python Forum
Is there a Python equvalent to PHP password_hash()?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a Python equvalent to PHP password_hash()?
#7
If you ever wanted to use php again check below

The problem here is you're rehashing an already hashed password im assuming if you're collecting the password column then hashing it and trying to match, I will explain how password_verify() works below.

So assuming you created your database right your password column should be something like
Quote:password VARCHAR(255);
Then when you register or insert the user you will use password_hash() on the unhashed password and store the result of that as your password in the database.

Now when you want to match you will select the password column from database and compare it with the unhashed password you have stored somewhere like this
Quote:password_verify($unhashed, $hashed);

it will return boolean result, true if it matches and false if its different.
Reply


Messages In This Thread
RE: Is there a Python equvalent to PHP password_hash()? - by snickers - Jan-02-2021, 10:15 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020