

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Hash Functions
incomplete
2: Hash Collisions
incomplete
3: Hashmaps
incomplete
4: Deterministic
incomplete
5: One Way
incomplete
6: Toy Hash Function
incomplete
7: Toy Hash Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Hash functions are one-way functions. Assuming the hash function is a good one, it should be impossible to obtain the input given only the output. The only way to find a message that produces a given hash is to attempt a brute-force search of all possible inputs to see if they produce a matching hash.
A critical operation in most hash functions is the modulo operation (%).
16 % 7 = 2
Notice how the modulo operation is irreversible. If I only give you the output of x % 7, (which, when x=16 produces 2) you can't know that x was 16. It could have been 9, 23, 30, etc.