liveBook · Manning

SHA-3

As explained in Hacking Cryptography

SHA-3 is a standardized family of cryptographic hash algorithms based on a sponge construction.

SHA-3 is a standardized family of cryptographic hash algorithms built from Keccak’s sponge construction. It was selected after NIST’s competition, initiated in response to concerns about SHA-1 and SHA-2. section 6.3.2 section 6.3

A sponge processes input in two phases. During absorption, message blocks are XORed into only the rate portion of an internal state before permutation. During squeezing, output is read from that portion while the state is repeatedly permuted, allowing arbitrary-length output. section 6.3.2

The rate–capacity split determines how the construction handles data and resists collisions:

  • Rate (r) identifies the state portion written during absorption and read during squeezing. section 6.3.2
  • Capacity (c) remains untouched by external input and output while still being mixed by the permutation; it determines collision resistance. section 6.3.2
  • For fixed-length SHA-3 variants, collision resistance is the smaller of half the output size and half the capacity. section 6.3.2
Figure 6.6 Sponge construction has an absorption phase and a squeezing phase.
figure

Use the sponge diagram to trace absorption, permutation, squeezing, and the separation between rate and capacity. section 6.3.2

Table 6.2 SHA-3 family of sponge-based hash functions
Hash function Output size \(d\) (bits) Rate \(r\) (bits) Capacity \(c\) (bits) Collision resistance (bits)
SHA3-224 224 1152 448 \(\frac{d}{2} = 112\)
SHA3-256 256 1088 512 \(\frac{d}{2} = 128\)
SHA3-384 384 832 768 \(\frac{d}{2} = 192\)
SHA3-512 512 576 1,024 \(\frac{d}{2} = 256\)
SHAKE128 \(d\) 1,344 256 \(min(\frac{d}{2}, \frac{c}{2}) = min(\frac{d}{2}, 128)\)
SHAKE256 \(d\) 1,088 512 \(min(\frac{d}{2}, \frac{c}{2}) = min(\frac{d}{2}, 256)\)

Compare SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, and SHAKE256 by output size, rate, capacity, and collision resistance. section 6.3.2

The sponge design contrasts with Merkle–Damgård hashing. SHA-1 and SHA-2 use the older construction and are susceptible to length-extension attacks; sponge-based SHA-3 avoids that weakness. section 7.3 section 6.3

How Hacking Cryptography covers it

How deep it goes
Explains absorption, squeezing, rate, capacity, and collision-resistance calculations, but does not provide implementation code.
Examples
Compares SHA3-224 through SHA3-512 and SHAKE128/256 using output, rate, capacity, and collision-resistance parameters.
What it assumes
Assumes familiarity with cryptographic hashes and introduces sponge terminology while contrasting it with Merkle–Damgård processing.
What you can do after
Evaluate hash constructions by tracing sponge phases, rate-capacity parameters, and exposure to length-extension attacks.
How it connects
Connects SHA-3 to cryptographic hash functions, Keccak, sponge construction, Merkle–Damgård construction, collision resistance, and length-extension attacks.

Also explained in

Compare how 3 books explain SHA-3 →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.