Cryptographic Hash Function

A mathematical algorithm that maps data of arbitrary size to a bit array of a fixed size, acting as a unique digital fingerprint.

In blockchain, hash functions link blocks together (the hash of the previous block is included in the current block), creating an immutable chain. They also protect passwords, verify file integrity, and enable digital signatures.

        graph LR
  Center["Cryptographic Hash Function"]:::main
  Pre_cryptography["cryptography"]:::pre --> Center
  click Pre_cryptography "/terms/cryptography"
  Pre_computer_science["computer-science"]:::pre --> Center
  click Pre_computer_science "/terms/computer-science"
  Pre_algorithm["algorithm"]:::pre --> Center
  click Pre_algorithm "/terms/algorithm"
  Rel_bitcoin["bitcoin"]:::related -.-> Center
  click Rel_bitcoin "/terms/bitcoin"
  Rel_blockchain["blockchain"]:::related -.-> Center
  click Rel_blockchain "/terms/blockchain"
  Rel_proof_of_work["proof-of-work"]:::related -.-> Center
  click Rel_proof_of_work "/terms/proof-of-work"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explain Like I'm 5

Fingerprint Machine 🕵️‍♂️ Imagine a magic machine where you can put in *anything*—a letter, a book, or even a whole library—and it spits out a unique sticker with a short code on it. If you put the exact same book in again, you get the exact same sticker. But if you tear out just *one tiny page* and put the book in, the sticker code changes completely. You can't look at the sticker and recreate the book (it's one-way), but you can use the sticker to prove that the book hasn't been changed.

🤓 Expert Deep Dive

Cryptographic hash functions like SHA-256 and Keccak-256 are the workhorses of blockchain. They underpin Proof of Work (finding a hash below a target), Merkle Trees (efficient data verification), and Address Generation (deriving public keys). Security depends on Pre-image Resistance (difficult to find input from output) and Collision Resistance (difficult to find two inputs with same output). As quantum computing advances, older standards like MD5 and SHA-1 have been deprecated due to collision vulnerabilities, driving the move towards SHA-3 and quantum-safe algorithms.

🔗 Related Terms

📚 Sources