Why it worked
The post taps into a widely shared curiosity among tech-savvy individuals and developers, presenting a common technical question in an easily digestible format with a visual aid.
Summary
The post poses a common question about password hashing: if passwords are hashed for security, how does the server verify the correct password. It then shows a SQL query and its output, displaying a hashed password for a user.
Structure
- 1Pose the question about password hashing
- 2Show a SQL query to select user data
- 3Display the query results with a hashed password
On-screen text
Can I ask a dumb question:
If we hash passwords so nobody can read them,
how does the server know my password is
correct?
SELECT id, email, password_hash FROM users LIMIT 1;
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS
myapp_dev=# SELECT id, email, password_hash FROM users LIMIT 1;
id email password_hash
1 john.doe@example.com $2b$12$KIXQ8qv6k1.V1Q9pg7Q5weD8Y7ZQ6iL6Q7L8M9n0oP1Q2R3S4t5u
(1 row)
myapp_dev=#