Password hashing (bcrypt, Argon2)
Storing passwords as slow, salted one-way hashes, so a stolen database does not reveal them and cracking each one costs real time and money.
A cryptographic hash like SHA-256 is built to be fast, which is exactly wrong for passwords: attackers can try billions of guesses. Password hashing functions are deliberately slow and use a unique salt per password. OWASP’s Password Storage Cheat Sheet recommends Argon2id with at least 19 MiB of memory, 2 iterations and parallelism 1; scrypt, bcrypt with a work factor of at least 10, or PBKDF2-HMAC-SHA256 with 600,000 iterations are the fallbacks.
A questionnaire asks “how are passwords stored?”, and “encrypted” is the wrong answer, because encryption can be reversed. If a database leaks with weak hashes, it may also trigger breach notification duties. The best stored password is one you never hold: company login through SSO or passkeys moves that risk off your database.
Sources
- OWASP: Password Storage Cheat Sheet cheatsheetseries.owasp.org
Related terms
- Cryptographic hash function (SHA-256): A function that turns any data into a short fixed-size fingerprint that is practically impossible to reverse or to match with different data.
- Passkeys: Passwordless login with a key pair stored on your device or password manager, unlocked by fingerprint, face or PIN.
- MFA (2FA, multi-factor authentication): Logging in with two or more kinds of proof, such as a password plus a code from an app or a security key.
- Data breach notification: The legal duty to report a security incident to a regulator, and sometimes to the people affected, within fixed deadlines such as 72 hours under GDPR.
- Secrets management (leaked API keys): Keeping API keys, passwords and tokens out of code and chats, in a store with access control, rotation and audit.
