Password Hashing — bcrypt/Argon2 Done Right — Concept Check
Questions on Password Hashing — bcrypt/Argon2 Done Right. Store only slow, salted hashes (Argon2 or bcrypt via pwdlib) — never plaintext, never MD5/SHA-256. hash() on registration, verify() on login, and rehash transparently as algorithms age.
Questions in this quiz
8 questions on Password Hashing — bcrypt/Argon2 Done Right — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer hashes passwords using SHA-256 for a new application. What is a major risk with this approach?
- ASHA-256 is fast, allowing attackers to guess passwords quickly.
- BSHA-256 is slow, which protects against brute force attacks.
- CSHA-256 is secure and widely used for password hashing.
- DSHA-256 automatically salts passwords, making it secure.
2.During a login attempt, a user enters their password, but the system takes longer than usual. What could be happening?
- AThe password is being stored in plaintext, causing delays.
- BThe system is using bcrypt or Argon2, which are deliberately slow.
- CThe system is using SHA-256, which is slow for hashing.
- DThe system is using MD5, which is slow and secure.
3.A service uses bcrypt for password hashing but does not include a salt. What is a potential consequence?
- AThe hash will be slower, providing additional security.
- BThe same password will produce the same hash, making it vulnerable to rainbow table attacks.
- CThe hash will still be secure due to bcrypt's inherent security features.
- DThe system will automatically add a salt, ensuring security.
4.A developer wants to switch from bcrypt to Argon2 for password hashing. What is an advantage of Argon2 over bcrypt?
- AArgon2 does not require salting, simplifying implementation.
- BArgon2 allows for more tunable parameters, enhancing security.
- CArgon2 is faster, making it more secure against attacks.
- DArgon2 hashes are shorter, saving database space.
5.A user reports that their password was leaked, but the database only stores hashes. What might have happened?
- AThe database was not breached; the user is mistaken.
- BThe hashes were stored using a fast algorithm like MD5, allowing quick cracking.
- CThe passwords were stored in plaintext, leading to the leak.
- DThe hashes were stored using Argon2, which is insecure.
6.Why is it important to verify passwords in constant time during login?
- ATo automatically update the hash to a newer algorithm.
- BTo make the login process faster for users.
- CTo prevent timing attacks that could reveal password information.
- DTo ensure the hash is stored securely in the database.
7.A developer uses passlib for password hashing. What is a potential issue with this choice?
- Apasslib automatically salts passwords, which is insecure.
- Bpasslib is faster than bcrypt, making it less secure.
- Cpasslib hashes passwords in plaintext, which is insecure.
- Dpasslib is unmaintained, so security updates may be lacking.
8.What is a key benefit of using Argon2 or bcrypt for password hashing?
- AThey store passwords in plaintext for easy retrieval.
- BThey are slow and salted, making brute force attacks difficult.
- CThey are fast, allowing quick user authentication.
- DThey automatically log passwords for security audits.