Security / 1 / 3
Authentication
How a service learns who is calling: storing passwords so a leak is not a disaster, sessions and tokens, how long a token lives and how to kill it, logging in through an identity provider, and a second factor.
- 14 min
- Intermediate
- 11 steps
- Leaked hashes cracked
- 62 %
- Login time
- 40 ms
- Account takeovers
- 35 /day
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Attacker → Users DBRequest
SELECT id, email, password_sha256 FROM users;1
Response
120000 rows, first one:
{
"id": "u_42",
"email": "ali@example.com",
"password_sha256": hidden,
"salt": 2null
}
password_sha256· hidden — A fast hash of the password. Hidden here; in the leak it is a ready target for guessing.salt— None. Equal passwords give equal hashes, so one guess cracks everyone who chose123456.
Course: 42 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes