Hash

A cryptographic hash function accepts data of any length and returns a digest with a fixed length. The same input gives the same digest, while secure hash designs make it computationally infeasible to recover an input from its digest or to find two different inputs with the same digest. A digest is often displayed as hexadecimal text, but it represents output bits rather than a unique label guaranteed to identify one input.

How cryptographic hashing works

Applications pass a message, file, transaction, or other data into a hash function and receive a fixed-size digest. A small input change typically produces a very different output, which makes hashes useful for checking whether data changed. Since the output has a fixed length and inputs can be arbitrarily long, collisions must exist in principle; a secure function is designed to make finding one impractical.

Different networks use different algorithms. Bitcoin uses SHA-256 in its proof-of-work process, applying it twice to a block header and comparing the result with a target. Ethereum uses Keccak-256 in parts of its protocol. Keccak-256 is related to the algorithm standardized as SHA-3, but Ethereum’s version uses different padding and is not identical to standardized SHA3-256.

Where hashes are used

Blockchains use hashes to identify data and link structures together. A Merkle tree combines transaction digests into a root that can summarize a larger set. Blockchain software also uses hashes in block identifiers and integrity checks. Outside blockchains, hashes can help compare files or detect accidental changes.

A hash is not encryption: encryption is designed to be reversed with the right key, while a cryptographic hash has no decryption key. A hash also does not hide low-entropy data by itself. Someone can guess likely inputs, hash each guess, and compare the results. For that reason, ordinary fast hashes such as SHA-256 should not be used alone to store passwords; password storage calls for a salted, deliberately slow password-hashing scheme.

Common misconceptions

  • “A hash is impossible to reverse.” A secure hash is designed to make finding a matching input computationally infeasible. Guessing a predictable input can still work, and the original input may be known from another source.
  • “Every different input has a unique hash.” Fixed-size outputs mean collisions exist in principle. The security goal is to make it impractical to find two inputs with the same digest.
  • “A matching hash proves who created a file.” A digest can help detect a change, but authenticity requires a trusted reference or a separate mechanism such as a digital signature.
  • “SHA-3 and Ethereum’s Keccak-256 are interchangeable.” They are closely related, but their padding differs; use the exact algorithm expected by the protocol or application.

Social Media Sentiment

A 2021 r/crypto thread asks whether encryption would become equivalent to hashing if the decryption key were discarded. Replies distinguish a hash function from reversible encryption and question how anyone could verify that a supposedly discarded key is truly unavailable. This is one technical discussion, not a survey of cryptography practitioners.

Last updated: 2026-10

Related Terms

See Also

Sources