What is MD5?
MD5 (Message Digest Algorithm 5) is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value, typically represented as a 32-character hexadecimal number. It was designed by Ronald Rivest in 1991.
Properties of MD5 Hashes
- Fixed Length: Always produces a 32-character hexadecimal string
- One-Way: Cannot reverse the hash to get the original input
- Deterministic: Same input always produces the same hash
- Avalanche Effect: Small input changes create drastically different hashes
Common Uses
- File Integrity: Verify downloaded files haven't been modified
- Checksums: Quick comparison of data blocks
- Caching: Generate cache keys from content
- Deduplication: Identify duplicate content
Security Considerations
⚠️ MD5 is no longer considered cryptographically secure due to collision vulnerabilities. For security-critical applications, use SHA-256 or SHA-3 instead.
MD5 vs Other Hash Functions
| Algorithm | Output Size | Security |
|---|---|---|
| MD5 | 128 bits | Weak |
| SHA-1 | 160 bits | Weak |
| SHA-256 | 256 bits | Strong |
| SHA-3 | Variable | Strong |