Salting a password hash
A random value added to a password before hashing, so identical passwords give different hashes. Each user gets their own salt, which defeats precomputed hash tables.
Understanding Salting a password hash in Years 9–10 Digital Systems
What it does: Different salts for each user mean the same password hashes to a different result for each account. Adding a salt changes the hash, so a table of unsalted hashes no longer contains the matching value. A salt is random data mixed in with the password before hashing. It does not make the hash reversible. The salt is joined to the password first, then the combined text is hashed, so the result is unique to that salt. The fix is to generate a new random salt for each user, for example salt = random_string(16).
Common mistakes: A salt must be random. A fixed, guessable text like "abc123" can be built into an attacker's precomputed table. It should be salt ← random_bytes(16). The salt must be saved with the hash. Without it the system can't repeat the hashing when the user logs in. It should be save(user, salt, hash).
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 25–40) and word search (Modules 13–40).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
saltFill in the Blanks
Spot the Error
Student with a class code? Join your class →