Tech Talk
Insights · Tech Talk

Let's Hash It Out

What a hash is, why your password is safer because of one, and what any of it has to do with breakfast.

If you’ve ever ordered hash browns, you already know where this month’s word comes from. “Hash” traces back to the French hacher, to chop. Take something, chop it up, and mix it until you can’t tell what went in. Developers borrowed the word for something that does roughly the same thing to data.

Some quick definitions:

A hash (noun): a short, fixed-length string of characters produced from any piece of data, whether that’s one word or an entire file.

To hash (verb): to run data through a hash function to get that string.

The three rules of a good hash

Rule 1: Same in, same out. Hash the word “pancake” today and hash it again next year, and you’ll get the identical result both times.

Rule 2: A tiny change scrambles everything. Here’s what a common hash function (SHA-256) makes of two nearly identical words:

One extra letter, and the two results look completely unrelated.

Rule 3: There’s no going backward. You can’t take a hash and work out what made it, except by guessing and checking. The chopping only goes one direction.

Why your password is safer because of it

Here’s where hashing earns its keep. When you create an account on a well-built system, it stores a hash of your password instead of the password itself. The next time you log in, it hashes whatever you typed and compares the two. If they match, you’re in.

So if someone ever broke into that database, all they’d find is a list of fingerprints. To recover a password, they’d have to guess it and check it, one fingerprint at a time.

Good systems add two more precautions:

Hash or encryption?

People often mix them up, but they do opposite jobs. Encryption scrambles data so someone with the right key can unscramble it later, like a locked box. Hashing is more like a paper shredder that turns the same page into the same confetti every time. You encrypt things you’ll need to read again, like a medical record. You hash things you only need to check, like a password.

Where else hashes show up

And the # key?

In the UK, # is called the hash key, and that’s where the “hash” in hashtag comes from. That puts one little word on triple duty: breakfast, passwords, and every #TBT you’ve ever posted.

So the next time someone says “let’s hash it out,” you’re allowed to ask which kind.

Talk to us

Bring us the hard version of your challenge.

Thirty minutes with a senior engineer, no pitch and no pressure. Whatever you decide, you'll leave with a clearer map of what you're about to do.

Start the conversation Keep reading