Course contentsShow
← Computer Science
Lesson 2428 of 2,87254. Cryptography FundamentalsFree lesson

SHA-3 and Keccak

Learning about the newer SHA-3 standard based on the Keccak algorithm and its sponge construction.

SHA-3 and Keccak

What you'll learn: How SHA-3 improves upon earlier hash functions using a fundamentally different internal design called the sponge construction.

A Fresh Start in Hash Function Design

After theoretical weaknesses emerged in MD5 and SHA-1, and to provide a safety margin beyond SHA-2, NIST held a public competition from 2007–2012 to select a new cryptographic hash standard. The winner was Keccak (pronounced "catch-ack"), which became SHA-3 in 2015.

Unlike the Merkle-Damgård construction used by MD5, SHA-1, and SHA-2, SHA-3 uses a completely different internal structure called the sponge construction.

The Sponge Construction Analogy

Think of a sponge alternating between absorbing water and squeezing it out:

  1. Absorbing phase: The input message is broken into blocks and XORed into part of the internal state, with each block processed through a permutation function
  2. Squeezing phase: Output is extracted from the state by applying the same permutation repeatedly

The state is divided into two parts: the rate (which interacts with input/output) and the capacity (which remains hidden, providing security). A larger capacity means more security against collision attacks.

Key Advantages

  • Flexibility: SHA-3 can produce variable-length outputs (SHA3-224, SHA3-256, SHA3-384, SHA3-512)
  • Different structure: Not vulnerable to length-extension attacks that affect SHA-2
  • Extendable Output Functions (XOFs): Variants like SHAKE128 and SHAKE256 can produce arbitrarily long outputs
  • Simpler design: Easier to implement in hardware and analyze for security

SHA-3 doesn't replace SHA-2 (which remains secure), but provides a robust alternative with different mathematical foundations.

Key Takeaway: SHA-3, based on the Keccak algorithm's sponge construction, offers a structurally different and flexible approach to cryptographic hashing that complements the existing SHA-2 family.