What is Hashing?
A hash function takes an input of any size and produces a fixed-length string of characters called a digest. The same input always produces the same output, but even a tiny change in the input results in a completely different hash. Hash functions are one-way — you cannot reverse a hash to recover the original data.
MD5
MD5 produces a 128-bit (32-character hex) digest. It was widely used for checksums and data integrity verification. However, MD5 is considered cryptographically broken due to known collision vulnerabilities. Use it only for non-security purposes like file deduplication.
SHA-1
SHA-1 produces a 160-bit (40-character hex) digest. Once the standard for digital signatures and certificates, it has been deprecated for security use since practical collision attacks were demonstrated in 2017.
SHA-256
SHA-256 is part of the SHA-2 family and produces a 256-bit (64-character hex) digest. It is widely used in blockchain, TLS/SSL certificates, and data integrity verification. Currently considered secure for all purposes.
SHA-384
SHA-384 is a truncated version of SHA-512 that produces a 384-bit (96-character hex) digest. It offers a higher security margin than SHA-256 and is often used in government and enterprise applications.
SHA-512
SHA-512 produces a 512-bit (128-character hex) digest. It provides the highest security margin in the SHA-2 family and performs well on 64-bit systems. Ideal for applications requiring maximum collision resistance.
Common Use Cases
Hash functions are essential for file integrity verification (comparing checksums), password storage (storing hashed passwords instead of plaintext), digital signatures, blockchain proof-of-work, data deduplication, and content-addressable storage systems.