Password hashing
Why we hash instead of encrypting; salt, rainbow table, slow functions (bcrypt, scrypt, Argon2) and cost factor; verifying a password; what must never be done.
- 25 cards
- 5 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- The numbers
- Scenarios
A few cards from the deck
Password hashing: what is it?
Show the answer
A one-way computation that turns a password into a digest, the only value the server keeps.
The password cannot be recovered from the digest: if the database leaks, the attacker does not get the passwords, only the means to guess them one by one.
A site stores the MD5 of passwords. The database leaks. Why is this serious, although MD5 is not reversible?
- MD5 is so fast that the attacker tests billions of guesses per second
- MD5 is decrypted with a key that the attacker easily finds in the stolen database
- MD5 produces digests too short to be able to hold a complete password
- MD5 gives the same digest to every password of the same length
Show the answer
MD5 is so fast that the attacker tests billions of guesses per second
A fast hash lets common passwords be guessed in seconds; with no salt, a simple precomputed table is enough. For example, the MD5 of "password" is always 5f4dcc3b5aa765d61d8327deb882cf99.
A password is … rather than encrypted, because encryption can be … with the key, whereas a hash cannot be reversed.
Show the answer
A password is hashed rather than encrypted, because encryption can be decrypted with the key, whereas a hash cannot be reversed.
An encrypted password needs a key, which leaks with the database or is stolen with it. The server never needs to read the password again: comparing digests is enough.
Salt: what is it?
Show the answer
A random value specific to each user, added to the password before hashing and stored with the digest.
Two identical passwords give two different digests, and a precomputation no longer works across all accounts. The salt is not a secret.