entekhab.netentekhab.nettrilingual encyclopedia

Cryptographic Hash

ENGLISHCryptographic Hashreference
فارسیتابع هش رمزنگاشتیRecommended equivalent
کوردیفەنکشنی هاشProposed equivalent — not standard
Category
Blockchain
Level
Professional

Simple definition

A function that turns any data into a fixed-length fingerprint. The same input always gives the same fingerprint, and the fingerprint cannot be turned back into the data.

Professional definition

A deterministic one-way function mapping input of any length to a fixed-length digest, built so that finding an input for a given digest, a second input matching a known one, or any colliding pair, is computationally infeasible. It has no key and is not encryption: there is nothing to decrypt.

Technical definition

Three properties are distinct and must be stated separately. Preimage resistance: given a digest, finding any input producing it is infeasible. Second-preimage resistance: given one input, finding a different input with the same digest is infeasible. Collision resistance: finding any two distinct inputs sharing a digest is infeasible, and it is the weakest of the three, because the birthday bound halves effective security. SHA-256, standardised in FIPS 180-4, emits 256 bits regardless of input size.

Academic definition

A deterministic map from arbitrary-length strings to fixed-length digests for which preimage, second-preimage and collision finding are computationally infeasible, and which, being keyless, is not a cipher.

Mechanism

The useful behaviour is avalanche: one flipped input bit rewrites the entire digest unpredictably, so a digest both names data and detects any change to it. Chains lean on this twice — to link blocks, where a rewritten past breaks every later header, and to price mining, where an unpredictable digest leaves brute-force search as the only strategy.

In practice

Who uses it
Protocol implementers, wallet and signing-library authors, auditors checking file or state integrity, and analysts matching transaction identifiers.
Why it matters
It compresses data of any size into a short, comparable commitment, which is what makes block linking, Merkle proofs and proof-of-work scoring possible at all.
Limitations
A digest shows data is unchanged, not that it is authentic or authorised. Anyone can hash anything, and low-entropy inputs such as short passwords can simply be guessed.

Common mistakes

  • Calling hashing encryption, or expecting to recover the input from a digest.
  • Trusting a digest alone as proof of who produced a file.
  • Reading collision resistance as a guarantee rather than a computational assumption.

Examples

everyday

A publisher prints the digest of a software release. Anyone who downloads the file can hash it and compare. A match proves the bytes are unchanged; it proves nothing about who built them.

numeric

For a 256-bit digest, a generic preimage search costs about 2^256 attempts, while a birthday collision search costs about 2^128. Collision resistance is therefore the binding constraint when a protocol chooses a digest length.

Given
  • digest length n = 256 bits
  • no structural weakness, generic attacks only
Steps
  1. preimage work ~ 2^n = 2^256
  2. collision work ~ 2^(n/2) = 2^128
2^256 versus 2^128 operations

These are generic bounds against an idealised function. A break in the specific function can lower them, which is why standards are retired before they fail.

Mathematical foundation

W_{pre} \approx 2^{n}, \qquad W_{coll} \approx 2^{n/2}

Variables

nDigest length in bitsbits
W_{pre}Expected work for a generic preimage searchhash operations
W_{coll}Expected work for a generic birthday collision searchhash operations

Procedure

Read the digest length in bits. Generic preimage search scales with two to that power; generic collision search scales with two to half that power, because random digests begin to repeat after roughly the square root of the output space.

Worked example

Given
  • n = 256 (SHA-256)
Steps
  1. W_pre ~ 2^256
  2. W_coll ~ 2^(256/2) = 2^128
about 2^128 operations to find a collision, which is the practical security level

Interpretation

The halving is why a 256-bit digest is described as offering 128-bit collision security. It sets the design margin; it does not promise any specific function will hold.

Assumptions

  • Generic attacks only: the function is modelled as an ideal random function with no exploitable structure.
  • Work is counted in hash evaluations and ignores memory and parallelism costs, which matter in practice for collision search.
Limits of the formula
  • These are not proofs of security. They are the best generic attacks known; a structural break lowers the real cost, as the history of earlier hash standards shows.
  • The bounds say nothing about resistance to brute-forcing low-entropy inputs, which no digest length can fix.

Related terminology

related
Merkle Tree Digital Signature Public-Key Cryptography Proof of Work Nonce Block Hash Rate
Commonly confused with

Public-Key Cryptography

Hashing is keyless and one-way: nothing is hidden for later recovery. Public-key cryptography uses keys and is reversible in the specific sense that a signature can be verified or a ciphertext decrypted.

Sources

FIPS 180-4: Secure Hash Standard (SHS)
NIST · SHA-256 specification and digest lengths
https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf URL verified
Bitcoin: A Peer-to-Peer Electronic Cash System
bitcoin.org · 2008-10-31 · section 4: hashing in proof-of-work
https://bitcoin.org/bitcoin.pdf URL verified
Mastering Bitcoin, 2nd ed.
O'Reilly · 2017 · chapters on keys, addresses and mining, on hash function properties
Print source

Editorial status

Needs expert reviewconsensusv1.02026-11-05

Flagged by the editor as uncertain on a linguistic, mathematical or regulatory point.

Kurdish headword فەنکشنی هاش is this project's proposal and needs native-expert review; practitioners mostly say هاش. FIPS 180-4 defines SHA-256 and its digest length; the generic attack costs are standard cryptographic results stated as assumptions, not claims from that standard.