🔑Password Hashing
Also known as Hashed Password, bcrypt, Argon2, Password Salt
Keeping a scrambled copy of a password. It can never be turned back.
Think of it like
Think of it like a blender. A banana goes in and a smoothie comes out. You cannot get the banana back.
Example
Lucy's app stores her password as a 60-character bcrypt string. When the database leaks, the thieves get the strings, not her password.
Why it matters
Definition
Example code
python
bcrypt.hashpw(b"hunter2", bcrypt.gensalt())
# b'$2b$12$RPynI795imQFtnz12B/.6uNyCR5P4ROQy.G9Lkn4FAAtddXaa4eDy'Common mistake
Key takeaways
- 1One way only. It cannot be undone.
- 2Salted. Same password, different hash.
- 3Slow on purpose. bcrypt or Argon2.