Students sign in against a stored hash, see one letter change the whole hash, crack an unsalted stolen list by hashing common guesses, then add a salt, and sort what a hash is for against what encryption is for (AC9TDI10K01 node 4, first half; Public and private keys is the second).
Security and privacy · How systems are kept safe · about 45 minutes · Open the student lesson
Classroom resources
Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
WorksheetOpen in PrintDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can explain how sites check passwords without storing them.
I can explain what a salt adds.
I can say when a hash fits and when encryption does.
Timing
Predict and Try 6 min · Worked example 12 min · Vary 10 min · Practise and Make 12 min
Before class
Try the boards yourself. The hash is real SHA-256 (shown short); the passwords in the lesson are practice ones. Tell students never to type a real password into any board.
The kit's typical width: hashing secures stored passwords; public key cryptography (next lesson) secures data in transit; they address different threats, and mixing them up is why this node is a hinge. Split from Hashes and keys on 25 Oct so each gets a full lesson. Simplifications: real sites use slow hashes built for passwords (bcrypt, Argon2) and store the salt beside the hash.
Links: Secret messages' key sharing (agreeing a key in public) is the other half of how HTTPS starts.
Running the lesson
Predict: students who chose "your password" assume sites keep it.
Try: count how many digits changed for one letter.
Worked example: ask why the same password must always give the same hash.
Vary: ask why the thief can crack Ana and Ben without reversing anything; then what the salt changes.
Make: remind students not to type a real password; it is a made-up passphrase.
In class
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
Think, pair, share(start) A website is hacked and its password list stolen. Should the site have stored your password at all?
What could it store instead?
How could it still tell you typed the right one?
Store a one-way fingerprint (a hash), not the password. Salt is the second step. Keep it defensive.
One-way rule(predict, 5 min)
Give each student a rule that is easy to apply but can't be undone: add the digits of a number, then double it. Each student hands over only the result. Can the class work out the starting number?
Several numbers give the same result, so you can't tell which went in. Real hashes are built so that is practically hopeless, and different inputs almost never collide.
Same password, same hash(investigate, 3 min)
Two students both use the same password. What do their stored fingerprints look like? What might an attacker learn?
Matching fingerprints show matching passwords. That is why salt is added: a different extra bit for each person.
What is stored?(investigate) A site stores your password's hash. When you sign in, what does it do? Hashes what you type and compares it The site never keeps the password, only the hash to compare against.
The hard part (on purpose)
Hashing is one-way, which runs against intuition, and students call it encryption. Use the meat grinder (you can't un-mince) as the anchor, and the sort in Practise to pull hash and encryption apart.
When students get stuck
What you will see
A question to ask
The fix
A student says the site turns the hash back (Sam's mistake).
Why does the site send a reset link instead of your password?
It can't reverse the hash.
A student calls hashing encryption.
Could anyone, with any key, turn the hash back into maple?
Encryption is undone with a key; a hash can't be undone at all.
Answers to the checks
a stolen list: A website is hacked and its list of passwords is stolen. If the site did its job properly, what do the attackers find for your account? A hash. The site never kept the password: it stores the hash, and at sign-in hashes what you type and compares.
Try: sign in with a hash: The site stores only Kai's hash. Type Kai's password (maple). Then change one letter to a capital. What happens to the hash?
maple matches the stored hash; Maple gives a completely different one. The site can check you without ever storing the password.
Two tools: Why can a site check your password without storing it? The same password always gives the same hash It compares hashes: hash what is typed; if it equals the stored hash, the password was right.
Find the mistake: Sam explains how Forgot password works. Click the line where it first goes wrong. line 3 Line 3: a hash can't be turned back. That is why sites send a reset link instead; a site that emails you your old password is storing it, which is a warning sign.
Same password, same hash: Ana and Ben both use maple. With no salt, a stolen list shows the same hash twice. What does that tell a thief? They share a password: crack one, crack both Same password, same hash. A salt (a few random characters per person, added before hashing) gives Ana and Ben different hashes.
Crack the list: This list was stolen from a site with no salt. Type passwords people often pick, one at a time, and watch for a row lighting up.
Same password, same hash: Ana and Ben both use maple, and Cara's sunshine1 lights up too. Dev's long passphrase never does: nobody would guess it.
Salt: Type maple, then switch on the salt. Ana and Ben both use maple. Are their hashes the same?
Different salts, different hashes: a list of pre-hashed common passwords no longer matches, and nobody can tell that two people share a password.
Emailed passwords: A site emails you your old password when you click Forgot password. What does that tell you? It stores your password, not a hash: a bad sign A hash can't be reversed, so a well-built site can only send a reset link.
Passphrases: Why are long passphrases safer even when sites store hashes? A long unusual one isn't on guess lists Attackers hash lists of common passwords and compare, so guessing still works on common passwords. Length and unusual words defeat the guess lists.
Hash or encryption?: Which tool fits? Sort each one. A site keeps your password so it can check it next time → A hash; Your card number on its way to an online shop → Encryption; Checking a downloaded app is exactly the file its maker published → A hash; A private message to a friend across the internet → Encryption; A news headline anyone can read → Neither Hash what only needs checking; encrypt what someone has to read again. A hash is not encryption: it can't be undone, even with a key.
Review: access: Review: which is authorisation? Only teachers may change marks Authorisation is what you may do once signed in.
a strong passphrase: Make up (don't use a real one) a passphrase of at least four unrelated words and 20 characters. Watch its hash.
Long and unusual: not on any list of common passwords, and still easy to remember.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: crack a list, then salt it › Crack the list
Open task: any program that does what the step asks.
Vary: crack a list, then salt it › Salt
Open task: any program that does what the step asks.
a strong passphrase
Open task: any program that does what the step asks.
Stretch and support
Stretch: Why do security experts recommend a password manager? What does it change about using the same password on several sites?
Support: Two cards: Only needs checking → hash (one way). Has to be read again → encryption (a key undoes it).
Exit ticket
Why can't attackers read passwords from a list of hashes, and what can they still do? What does a salt stop?
A hash can't be reversed, but common passwords can be guessed: hash the guess, compare. A salt makes the same password hash differently for each person, so one guess no longer cracks everyone who chose it.
What each step is for
a stolen list: Committing to what a stolen password list contains tests the new move: sites store hashes, which can be checked but not reversed.
Try: sign in with a hash: Typing the password and seeing its hash match the stored one settles the prediction: the site checks hashes, never storing the password.
Worked example: hashes and salt: Following a sign-in through hashing, then two people with the same password, models the new move. Sam thinks a hash can be turned back, the misconception planted after the method.
Vary: crack a list, then salt it: Students see why a hash alone is not the end of the story: common passwords crack by guessing. Then the salt fixes the giveaway of two matching rows.
hashes: Spotting good and bad password storage, why guessing still works, hash or encryption (the hinge: the two get mixed up), and a review of access control.
a strong passphrase: Building a passphrase that meets a strength rule reverses the process: students start from what makes a hash hard to guess and make a password to match.
Where it leads
Next: Public and private keys (protecting data while it travels).