SHA vs SHA-3: Understanding the Future of Hashing
From SHA to SHA-3: The Evolution of Hashing Algorithms
What is Hashing?
At its core, hashing is the process of taking any input (text, image, file, etc.) and converting it into a fixed-length string of characters, usually represented in hexadecimal. This output is called a hash or digest.
For example:
Input: "Hello"
Hash (SHA-256): 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Notice how:
-
The output length is fixed, no matter the input size.
-
Even a tiny change in input (like “hello” instead of “Hello”) gives a completely different hash.
-
The process is one-way – you cannot reverse a hash back to the original input.
Because of these properties, hashing is widely used in data integrity verification, password storage, blockchain, and digital signatures.
🔹 The Journey from SHA-1 to SHA-2
The Secure Hash Algorithm (SHA) family was developed by NIST (National Institute of Standards and Technology) and NSA.
-
SHA-1 (1995)
-
Produced a 160-bit hash.
-
Used in SSL certificates, Git, and older systems.
-
Problem: It became vulnerable to collision attacks (where two different inputs produce the same hash). In 2017, Google and CWI Amsterdam demonstrated a practical collision for SHA-1.
-
-
SHA-2 (2001)
-
A family including SHA-224, SHA-256, SHA-384, and SHA-512.
-
Stronger and more secure than SHA-1.
-
Still widely used today in TLS/SSL, Bitcoin blockchain (SHA-256), and file integrity checks.
-
Weakness: While still secure, SHA-2 uses the Merkle–Damgård construction, which is considered structurally less resilient against future cryptographic advances.
-
Why SHA-3?
By the mid-2000s, cryptographers anticipated that even SHA-2 might eventually be at risk. To future-proof hashing, NIST launched the SHA-3 competition (2007–2012).
The winner was Keccak (pronounced “catch-ack”), designed by Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche.
SHA-3 was standardized in 2015 as FIPS 202.
How Does SHA-3 Work? (The Algorithm)
Unlike SHA-1 and SHA-2, which use the Merkle–Damgård structure, SHA-3 is built on a sponge construction.
Here’s how it works:
-
Absorbing Phase
-
The input message is divided into blocks.
-
Each block is XORed into part of the internal state.
-
Then, a permutation function
fis applied to the state.
-
-
Squeezing Phase
-
Once the input is fully absorbed, the algorithm outputs the hash by “squeezing” bits out of the state.
-
If more bits are needed,
fis applied again and more bits are squeezed out.
-
Key Features:
-
Configurable output length – unlike SHA-2, SHA-3 can generate variable-length digests.
-
Different internal math – SHA-3 is not just an “upgrade” of SHA-2 but a fundamentally different design.
-
Resistant to length-extension attacks – a known issue in SHA-2.
-
Post-quantum resilience (to some extent) – while not fully quantum-proof, SHA-3 is considered stronger against future cryptanalysis.
🔹 SHA vs SHA-3: A Quick Comparison
| Feature | SHA-1 | SHA-2 (SHA-256) | SHA-3 (Keccak) |
|---|---|---|---|
| Year Introduced | 1995 | 2001 | 2015 |
| Hash Size | 160-bit | 224, 256, 384, 512-bit | Flexible (SHA3-224 to SHA3-512) |
| Construction | Merkle–Damgård | Merkle–Damgård | Sponge construction |
| Security | Broken (collisions) | Secure (widely used) | Secure, future-proof |
| Example Uses | Legacy systems | Blockchain, TLS, SSL | IoT, blockchain extensions, future cryptosystems |
🔹 Where is SHA-3 Used Today?
Although SHA-2 is still dominant, SHA-3 adoption is slowly growing in:
-
Blockchain research (Ethereum originally considered it).
-
IoT security where flexible digest size is valuable.
-
Digital signatures & key derivation where resistance to advanced attacks is critical.
🔹 Conclusion
The move from SHA to SHA-3 is not about replacing a broken system (like SHA-1’s case) but about future-proofing security.
-
SHA-2 is still secure today, but SHA-3 provides an alternative design with different mathematical foundations.
-
Think of SHA-3 as a backup plan – if SHA-2 is ever broken, we already have a standardized, battle-tested alternative.
Hashing remains one of the cornerstones of cybersecurity, and the SHA family shows how cryptography evolves to stay ahead of attackers.
Comments
Post a Comment