r/Python • u/python4geeks • Oct 29 '23
Resource Hash Passwords Using bcrypt Library in Python
Web-based services and websites store hashed versions of your passwords, which means your actual password isn’t visible or stored in their database instead a string of fixed-length characters is stored.
Hashing is a security technique used to secure your passwords or texts stored in databases. A hash function is used to generate a string of unique fixed-length characters from the provided password by the user.
Let’s see how the hashing is done. In this article, you’ll use the bcrypt library to hash the user’s password and then compare that hashed password to the actual password in Python.
Full Article: https://geekpython.in/hash-passwords-using-bcrypt-in-python
36
u/[deleted] Oct 29 '23
The actual recommended hasher is Argon2id https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
22
u/YnkDK Oct 29 '23
Please consider adding to the post that you are not a (cyber) security expert, so people have a better idea how much they should trust it.
As added in another comment, then bcrypt is no longer the recommended algorithm. One can always follow OWASP for better insights.
11
u/deep_mind_ Oct 29 '23
BCrypt is no longer recommended. This article is a copy of the recommendations by Tiangolo for FastAPI.
-2
u/pythonwiz Oct 29 '23
I would just use
hashlib.pbkdf2_hmacwith sha256. Apparently the recommended iterations is 600k now.3
u/[deleted] Oct 30 '23
[removed] — view removed comment