learning-it by example

Back to the video

How Sites Store Passwords: Hash, Salt and Slow Hashes

Two users, one password, the same plain hash. A salt and a slow hash fix it.

Video #281 ยท How it works, by example

Steps in the video

  1. 0:00 Same password, same hash
  2. 0:36 The idea
  3. 1:13 Setup
  4. 1:33 Three ways to store
  5. 1:56 A salt for every user
  6. 2:33 The attacker's side
  7. 3:07 Timing one guess
  8. 4:11 What this does not show
  9. 4:50 Mistakes to avoid
  10. 5:22 My take and next steps
  11. 5:56 Recap

Files

  • crack.py (39 lines)
  • run.py (27 lines)
  • store.py (37 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

All users, passwords and the wordlist are made up; the scrypt cost is a demo value, not a recommendation.

Sources

Learning IT by Example.