How hash functions work
A hash function is a one-way mathematical operation. It's easy to compute the hash of an input, but computationally infeasible to reverse — to find the input given only the hash. This property is called preimage resistance.
Two different inputs producing the same hash is called a collision. A good hash function makes collisions extremely rare and hard to manufacture intentionally. This property — collision resistance — is what makes hashes useful for security applications.
SHA256, for example, always produces a 256-bit (32-byte) output expressed as a 64-character hexadecimal string. 'hello' always becomes 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Change 'hello' to 'Hello' and the hash is completely different.
SHA256 — the current standard
SHA256 is part of the SHA-2 family, published by NIST in 2001. It's the hash function used in Bitcoin's proof-of-work, TLS certificate signatures, Git object hashing, and password hashing schemes like bcrypt's underlying structure.
For verifying file integrity, SHA256 checksums let you confirm that a downloaded file hasn't been tampered with. Download the file and the expected checksum from the source, run SHA256 on the file, and compare. If the hashes match, the file is intact.
SHA256 is computationally intensive enough that brute-force attacks against properly salted password hashes are impractical. For direct data integrity verification (not passwords), SHA256 is fast enough for any practical use.
MD5 — why it's no longer secure
MD5 was designed in 1991 and was once the standard for checksums and password hashing. It produces a 128-bit (32 hex character) output. It's extremely fast to compute.
The problem is that MD5 is cryptographically broken. Researchers demonstrated in 2004 that it was practical to generate MD5 collisions — two different inputs with the same hash. In 2008, a team created a fake SSL certificate trusted by browsers using an MD5 collision. MD5 is no longer suitable for any security-sensitive purpose.
MD5 still appears in non-security contexts where speed matters and collision resistance isn't required — like checksums for large file downloads over a trusted channel, or as a quick content hash for caching. But if security is a concern at all, use SHA256 or SHA512 instead.
- MD5: 128-bit output, fast, cryptographically broken — not for security
- SHA1: 160-bit output, deprecated, known weaknesses — avoid
- SHA256: 256-bit output, current standard — use this
- SHA512: 512-bit output, higher security margin — use for sensitive data
- bcrypt/Argon2: designed for passwords — use these for storing passwords
Generating and verifying hashes online
The Irreva Hash Generator supports MD5, SHA1, SHA256, and SHA512. Enter any text and get all four hashes instantly. The computation runs in your browser using the Web Crypto API, so your input never leaves your device.
For file verification, generate a hash of the file locally and compare it against the checksum published by the software distributor. This confirms that no one modified the file between publication and your download.
For developers, hashing strings is useful for generating cache keys, creating deterministic IDs from content, and building simple fingerprinting systems. These use cases don't require cryptographic security — even MD5 works fine for them.
