Resources for the global digital safety training community.
Credits Last Updated 2024-07
This activity runs participants through a very simple, but real-world example - the checksum of a credit card.
This activity runs participants through a very simple, but real-world “hash” example - the checksum of a credit card. It is less robust than the hash functions the rest of the lesson will focus on, but provides a tangible example.
If you’ve ever put your credit card number in a form and gotten an error before you even added the date or security code, this is how that happens. Almost every credit card number uses what’s called the Luhn Algorithm as a self-check.
We can test this ourselves!
It’s worth noting that this alone only lets you verify numbers (and generate test numbers), and indeed it’s an open standard. Without correct expiration dates, name, and security codes this is absolutely useless for payment activity.
More detail on credit card checksums is available at https://www.freeformatter.com/credit-card-number-generator-validator.html
This is a simple check that provides a way to validate a set of data. While credit cards are just a short string of numbers, a more complicated process could check for errors or typos in other formats, including text or even files.
Can participants come up with ideas where this might be useful?
If they are struggling, suggest things like copying or downloading files over bad connections, or checking to see if a file is a duplicate of another file.
What if a system could provide more than just a format check, but a guarantee that a string of text or a file was - or was not - the same as another, or hadn’t changed?
Why would you want something like that?