Cryptography enables interactions that are hard to understand by using physical analogies. For example, when you log into a website and get the error message that your password doesn’t match, what’s actually happening?
Upon entering your password guess, the website creates a hash of your password, and checks that hash against the hash they have stored in their database.
A hash is a cryptographic operation that takes a string of numbers and letters and reliably transforms it to a long string of letters and numbers that looks like gibberish.
For example, if your password was “pineapple14” the SHA-256 hash of that would be “56690781b307bdc43cf4af9e50cfc633ecab6ddfdf3bb282d97f43426a0274ea”
Rather than storing:
username: Zack password: pineapple14
the website should store:
username: Zack passwordHash: 56690781b307bdc43cf4af9e50cfc633ecab6ddfdf3bb282d97f43426a0274ea
Then when you type in your password, it’s hashed and if it matches the string above, you are allowed into your account.
What are the benefits of this type of system? Well, the biggest benefit is that the website you’re logging into doesn’t store a whole list of every customer’s password! All that is stored is the hash, and it’s mathematically infeasible to go from 56690781b307bdc43cf4af9e50cfc633ecab6ddfdf3bb282d97f43426a0274ea to “pineapple14.” Thus, even if a hacker does access the database, they won’t be able to steal everyone’s passwords.
I think this is such a clever use of cryptography and mathematics in a way that makes our systems safer to use, and more resistant to exploitation. I will be doing more research over the next weeks to understand and explain other uses of cryptography that help make the world a better place.