πŸ“– Term 🟒 Plain English πŸ”° Beginner

πŸ”‘ Hashing Hashing

Hashing runs any input β€” a word, a file, a transaction, even a whole block β€” through a fixed math function that spits out a short, fixed-length string called a hash. The same input always produces the same hash, but you can never run it backward to recover the original.

πŸ’‘
Common misconception β€” Is hashing just another word for encryption you can "decrypt"? No! Encryption is reversible with a key to keep things secret. Hashing has no key and no undo β€” it's one-way, used to verify that data hasn't changed.
Any input, any size πŸ“„ "hi" 🎬 a movie file ⛓️ a whole block βš™οΈ Hash function e.g. SHA-256 πŸ”‘ One hash always 64 chars 🚫 no way back 🌊 Avalanche change 1 character… "Codex" β†’ 3f9a…7c1 "codex" β†’ e02b…84d (totally different)
πŸ“„πŸŽ¬β›“οΈ Inputs of any size all funnel into βš™οΈ one function β†’ πŸ”‘ one fixed-length hash. It's one-way β€” no path back, and 🌊 changing a single character flips the whole hash.

πŸͺͺ The simple version β€” a digital fingerprint

Think of a hash as a digital fingerprint for a piece of data. Feed in anything and the function returns a unique-looking string that identifies it. Two useful things follow from this. First, it's deterministic: the same input always gives the exact same hash, so anyone can re-check it. Second, it's a tamper-evident seal: if even one character of the data changes, the fingerprint no longer matches, so any meddling shows up instantly.

πŸ§ͺ The four properties that make it useful

PropertyWhat it means
πŸ” DeterministicThe same input always produces the exact same hash
➑️ One-wayYou can go input β†’ hash, but never hash β†’ input
🌊 Avalanche effectChange one character and the whole hash looks totally different
πŸ’₯ Collision resistanceIt's practically impossible to find two inputs with the same hash

πŸ“ The output is always a fixed length. SHA-256 returns a 256-bit hash β€” written as 64 characters β€” whether you hash a single letter or an entire movie.

πŸ”— Why crypto leans on hashing

A blockchain is a chain of blocks, and hashing is the glue. Each block stores the hash of the block before it. Tamper with an old block and its hash changes, which breaks the link to every block that follows β€” so the fraud is obvious to the whole network. Hashing also creates the strings you actually see on a block explorer: transaction IDs, block hashes, and wallet addresses are all hash-derived.

⛓️ Where you'll meet it: Bitcoin and Ethereum

Bitcoin uses a function called SHA-256 for mining (Proof of Work), for verifying transactions, and for generating addresses. Ethereum uses a different one called Keccak-256. The names differ, but the job is the same: produce a fixed-length fingerprint that no one can fake or reverse.

🚨 Things beginners get wrong

  • πŸ”“ "A hash can be decrypted" β€” It can't. There's no key and no reverse path; the only way to match a hash is to hash the original input again
  • 🟰 "Hashing equals encryption" β€” Different jobs. Encryption hides data so it can be unlocked later; hashing fingerprints data so changes get caught
  • πŸ“ "A bigger file makes a bigger hash" β€” No. The output length is fixed by the function, not by the input size

❓ FAQ

Is hashing the same as encryption?
No. Encryption is reversible: with the right key, an encrypted message can be turned back into the original to protect confidentiality. Hashing has no key and no undo button β€” it is one-way, used to verify that data hasn't changed and to create identifiers.
Can you decrypt or reverse a hash to get the original input?
No. A hash is one-way. You can compute the hash from an input, but you cannot work backward from the hash to recover what was put in. The only way to match a hash is to already have the original input and hash it again.
Why does every hash look the same length?
The function always outputs a fixed length, no matter how big the input is. SHA-256, the function Bitcoin uses, always produces a 256-bit hash written as 64 characters β€” whether you hash one letter or a whole movie file.

πŸ”— Related