File Hash Information
Understanding file hashes and checksums for verifying file integrity.
What is a File Hash?
A file hash, or checksum, is a string generated by running a file through a hash function. It acts like a digital fingerprint for the file, so even a very small change produces a very different result.
Key Properties:
- Deterministic: The same file always produces the same hash.
- Unique-like: Different files are expected to produce different hashes.
- One-Way: You cannot reverse a hash to recover the original file.
- Avalanche Effect: Small changes produce a completely different hash.
Common Hash Algorithms
- Length: 128 bits (32 hex characters)
- Speed: Very Fast
- Security: Not secure (collisions found)
- Use Cases: Quick checksums, non-security file verification
Example: d41d8cd98f00b204e9800998ecf8427e
Warning: Do not use for security purposes.
- Length: 160 bits (40 hex characters)
- Speed: Fast
- Security: Deprecated (collisions demonstrated)
- Use Cases: Legacy systems, Git commits
Example: da39a3ee5e6b4b0d3255bfef95601890afd80709
Note: Being phased out for security uses.
- Length: 256 bits (64 hex characters)
- Speed: Moderate
- Security: Secure (recommended)
- Use Cases: File verification, blockchain, SSL/TLS
Example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Recommended: Industry standard for file verification.
- Length: 512 bits (128 hex characters)
- Speed: Moderate
- Security: Very Secure
- Use Cases: High-security applications, digital signatures
Example: cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce...
Maximum Security: Best for high-value files.
How to Verify File Hashes
Command Line Tools
On Windows (PowerShell):
Get-FileHash -Algorithm SHA256 filename.zip
On macOS/Linux:
shasum -a 256 filename.zip
sha256sum filename.zip
md5sum filename.zip
Using certutil (Windows):
certutil -hashfile filename.zip SHA256
Common Use Cases
Verify that downloaded software has not been tampered with by comparing its hash to the official source.
Check whether files were corrupted during transfer or storage by comparing hashes before and after.
Identify duplicate files by comparing hashes when byte-for-byte identity matters.
Confirm backups and copies are exact matches of original files using hash comparison.