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
- What Are Zero-Knowledge Proofs — And Why Every Major Blockchain Is Building Around Them
- How Do Crypto Bridges Work — And Why Are They Such a Hack Target?
- Why Smart Contract Audits Fail: What Post-Mortems Reveal About the Limits of Security Reviews
- Swap crypto with ChangeNOW
Sources
- NIST, “Cryptographic hash function” — defines the fixed-length output and the computational goals of preimage and collision resistance.
- NIST FIPS 180-4, Secure Hash Standard — specifies SHA-256 and other secure hash algorithms used to generate message digests.
- Ethereum.org, “Ethash” — explains why Ethereum’s Keccak-based hashes are not identical to standardized SHA-3.
- OWASP, “Password Storage Cheat Sheet” — recommends adaptive password-hashing schemes instead of fast SHA-256 alone for stored passwords.
- Satoshi Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System” — describes SHA-256 proof-of-work and hash-linked blocks in Bitcoin’s original design.