House of Shield - Cryptographic Hash Functions & File Integrity Verification
The avalanche effect shows that even a tiny change (like adding one character) produces a completely different hash. This is a critical security property.
Select a demo file to see how file contents are hashed. In real applications, this verifies file integrity.
| Algorithm | Output Size | Security | Speed |
|---|---|---|---|
| MD5 | 128-bit (32 hex) | Broken | Fast |
| SHA-1 | 160-bit (40 hex) | Weak | Fast |
| SHA-256 | 256-bit (64 hex) | Strong | Medium |
| SHA-512 | 512-bit (128 hex) | Strong | Slower |
Security Notes:
$ md5sum filename.txt
$ sha1sum filename.txt
$ sha256sum filename.txt
$ sha512sum filename.txt
$ shasum -a 256 filename.txt
$ sha256sum -c checksums.txt
When downloading software (OS images, applications), vendors provide checksums. Verify the downloaded file matches the published hash to ensure it hasn't been tampered with or corrupted during download.
Example: Ubuntu provides SHA-256 checksums for all ISO downloads on their website.
Passwords should NEVER be stored in plain text. Instead, store a hash of the password. When a user logs in, hash their input and compare it to the stored hash. Even if the database is compromised, passwords remain protected.
Note: Use specialized password hashing algorithms like bcrypt, Argon2, or PBKDF2, not simple SHA-256.
In forensic investigations, hash values prove file integrity. A hash taken at the scene can be compared to the hash of the same file later to verify no tampering occurred during the investigation process.
Critical for maintaining chain of custody in legal proceedings.
Security systems monitor critical system files by storing their hashes. Regular scans compare current hashes to baseline hashes to detect unauthorized modifications, indicating potential security breaches or malware.
Tools: AIDE, Tripwire, OSSEC use this technique.