Skip to content

What is a hash, and why websites never store your real password

A hash is a one-way fingerprint of your data. Learn how hashing protects passwords, what salting does, and how it differs from encryption, in plain language.

By SenangWebsite team5 min read

You have probably wondered, at least once while typing a password into a login box, what actually happens to it. Does the company see it? Where is it kept? The reassuring answer is that a well-run website never stores your password at all. Not in a file, not in a database, nowhere.

It stores something called a hash instead. Understanding that one idea explains a lot about how the safer parts of the internet work.

The short answer: a hash is a one-way fingerprint of your data. The website stores the fingerprint, not the password, and uses it to check future logins without ever holding the original.

The fingerprint idea

Take any piece of text, feed it into a hash function, and you get back a fixed-length string of letters and numbers. The same input always produces the same output, but there is no way to work backwards from the output to the input.

Here is the word "password" hashed with a common function called SHA-256:

5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

Change one single letter in the input, even one, and the entire output changes beyond recognition. That behaviour is called the avalanche effect, and it is what makes hashes useful for checking things without revealing them.

The fingerprint comparison is close. Your fingerprint identifies you uniquely, yet nobody can reconstruct you from it. A hash identifies your password uniquely, yet nobody can reconstruct the password from it.

What makes a good hash

Three properties matter, and they are easy to check:

  • One-way. You can hash text, but you cannot unhash it. This is the whole point.
  • Fixed length. A one-page document and an entire book produce hashes of the same size.
  • Collision resistant. Two different inputs practically never produce the same output.

Well-known hash functions include the SHA family, such as SHA-256, and the older MD5, which you may still meet in old systems. A note of caution there: MD5 is considered broken for security purposes today, because computers have become fast enough to clash its fingerprints. You will still see it used for simple file checks, but nothing that needs to withstand an attacker.

Salting, in plain words

Hashing has one weakness on its own: if two people choose the same password, their hashes match, and someone with a big table of common passwords and their hashes can look yours up in seconds.

The fix is a salt, a random chunk of data mixed into the password before hashing. Two users with the password "dragon" get salts like x7qp2 and m9ftz, producing completely different hashes. The attacker's lookup table becomes useless, because every hash is now unique even for identical passwords.

Good systems salt every password individually. This is why, when you hear about a company leaking its database, the important question is whether passwords were hashed and salted. If yes, the damage is limited. If the passwords were stored in plain text, everyone involved has a bad month.

Encryption vs hashing: the difference

People mix these up constantly, and the distinction is genuinely simple:

  • Encryption is reversible on purpose. With the right key, you can decrypt the data back to the original. Use it when someone authorised will need to read the data again, like a locked letter.
  • Hashing is one-way by design. There is no key that unhashes anything. Use it when you only need to verify, never to recover, like a fingerprint.

So a messaging app encrypts your messages, because both sides need to read them. A login system hashes passwords, because it only ever needs to check them.

Where hashes show up beyond passwords

Once you know the concept, you spot hashes in everyday places:

  • File downloads. Sites publish a hash of a file so you can verify your copy matches the original, catching corrupted or tampered downloads.
  • Document comparison. Matching hashes mean two files have identical content.
  • Blockchain systems. Every block's hash depends on the previous one, which is what makes tampering evident.

Try it yourself

The fastest way to make this click is to produce a few hashes and watch the avalanche effect live. The Hash Generator on SenangWebsite computes several hash types at once, and the dedicated SHA Generator and MD5 Generator show the individual functions in action. Type a sentence, see the fingerprint, change one comma, and watch the whole fingerprint rearrange itself.

For the password-safe variety specifically, the Bcrypt Generator produces bcrypt hashes, a family built for passwords with built-in salting and deliberately slow computation, which is exactly what you want when someone attacks by guessing billions of possibilities.

Everything runs locally in your browser, so you can hash your own test phrases without sending them anywhere. Try hashing your actual password once, just to see the fingerprint it would leave behind. Then close the tab, because the point of hashing is that the fingerprint is all anyone should ever hold.

Back to all articles