Digital Forensic Tools

What is a hash value?

Short answer

A hash value is a short fixed-length fingerprint made from data by a hash function. If even one bit of the data changes, the hash changes, so hashes help show data is unchanged.

How a hash works

A hash function reads any amount of data and produces a fixed-length result called a hash value or digest. The same data always gives the same hash. A tiny change in the data gives a very different hash.

You cannot rebuild the data from the hash. It is a fingerprint, not a compressed copy.

Common algorithms

MD5 and SHA-1 are older. Researchers have shown that attackers can create two different inputs with the same hash for these, called a collision. SHA-256 belongs to the SHA-2 family defined by NIST in the Secure Hash Standard, and it is widely used now. Many labs record more than one algorithm. Follow your lab's own procedure.

Uses in forensics

Hashes are used in several ways.

  • Check that an image matches the original drive
  • Check that a copy or export has not changed
  • Find known files, using hash sets such as the NSRL
  • Find exact copies of a file across a case

Fuzzy hashes

A normal hash changes completely if one byte changes. A fuzzy hash, such as one made by ssdeep, gives a similarity score. It helps find files that are similar but not identical.

Hash algorithms

MD5SHA-1SHA-256
Length of result128 bits160 bits256 bits
Known collisionsYesYesNone known
Common use todayLegacy checksLegacy checksMain choice

Example

An examiner images a drive and the tool reports a SHA-256 hash for the drive. After copying the image to a server, the examiner hashes the copy. Both values match, so the copy is an exact copy of the image.

Common mistakes

  • Thinking a hash shows who made or changed a file.
  • Comparing only the first few characters of two hashes.
  • Hashing the wrong thing, such as a partition instead of the whole drive.
  • Believing the hash is encryption.
  • Using a hash made at one time to prove a file is unchanged without a record of when it was made.

Key terms

Hash function
A method that turns any data into a fixed-length value.
Digest
Another word for the hash value.
Collision
Two different inputs that give the same hash.
Hash set
A list of hashes of known files, used to include or filter files.

Questions you may be asked

Why does a matching hash show a copy is exact?

Any change to the data would change the hash. So if both hashes are equal, the data is the same for practical purposes.

Why is SHA-256 preferred to MD5 today?

MD5 has known collisions, so it is weak for proving that data was not altered on purpose. SHA-256 has no known collisions.

Free tools to practise with

Learn more

Written in our own words from public forensic training material and standards. Last reviewed 24 Nov 2026. Procedures and laws differ by country and agency. Follow your own lab's procedure.