I'm currently trying to use bcrypt to encrypt/hash my seed passwords and store them in MYSQL, but it keeps giving me the same password. I'm using Python. Any help would be greatly appreciated!
user.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
seed.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
P粉7104789902024-03-20 16:34:19
You pass the same password and salt every time:
1 2 3 4 5 |
|
If you wish to produce different hashes with the same plaintext using bcrypt
, regenerate the salt each time you generate a hash (as a best practice, you should do this):
1 2 3 4 |
|
P粉8072394162024-03-20 14:47:25
Assumption:
If all of the above are correct, the problem is with authentication, i.e. the "validate_password" method is not in the User class at all. Try to identify it correctly and it should trigger and hash the password.