⌘K

Security

Hashing

Hashing converts data of any size into a fixed-length fingerprint using a one-way function, so the same input always produces the same output but the output cannot be reversed.

Updated 12 Aug 2026

A one-way fingerprint

A hash function reads any amount of data and emits a fixed-length value. The same input always yields the same hash, a tiny change to the input produces a completely different hash, and there is no practical way to work backwards from the hash to the original data.

Hashing, encryption and encoding

Reversible?Needs a key?Purpose
Encoding (Base64)YesNoTransport binary as text
Encryption (AES)Yes, with the keyYesConfidentiality
Hashing (SHA-256)NoNoIntegrity and verification

Two different jobs

Integrity hashing wants speed: SHA-256 verifies a downloaded file or detects that a document changed. Password hashing wants the opposite — deliberately slow, memory-hard functions such as bcrypt, scrypt or Argon2, each with a unique random salt, so an attacker who steals the database cannot test billions of guesses per second.

MD5 and SHA-1 are broken for security purposes: collisions can be produced deliberately. Never use them for signatures, certificates or passwords.

Text Diff

When a hash says two files differ, the Text Diff shows you exactly where.

Try Text Diff

Characteristics

  • Fixed-length output regardless of input size
  • Deterministic — identical input always gives identical output
  • Avalanche effect: one changed bit rewrites the whole hash
  • One-way by design, with no key involved

Common uses

  • Verifying file downloads and detecting corruption
  • Storing passwords safely with a salt and a slow algorithm
  • Content addressing in Git commits and caches
  • Deduplicating files and building integrity checks

Advantages

  • Cheap and fast integrity checking of arbitrary data
  • Protects stored passwords even if the database leaks
  • Fixed-size output is convenient as a key or index
  • No key management burden

Limitations

  • Cannot recover the original data — by design
  • Fast hashes are unsuitable for passwords
  • Legacy algorithms are collision-prone and must be retired
  • Unsalted hashes fall quickly to rainbow tables

Examples

A single-character change rewrites the entire digest
sha256("ToolSera")  -> 5f8c1a...  (64 hex characters)
sha256("Toolsera")  -> b2e7d4...  (completely different)

Frequently asked questions

What is hashing used for?

Verifying integrity, storing passwords, deduplicating content and addressing data by its fingerprint.

What is the difference between hashing and encryption?

Encryption is reversible with a key; hashing is one-way and has no key.

Why do passwords need a salt?

A unique salt per password stops attackers reusing precomputed tables across accounts.

Is MD5 safe to use?

Not for security. It is acceptable only for non-adversarial checks such as cache keys.

Can two inputs share a hash?

Yes, that is a collision. Strong modern algorithms make finding one computationally infeasible.

Related terms

All terms

Related tools

Related guides

All guides