Hash Lab

Unkeyed cryptographic

Keccak (pre-NIST padding)

Keccak is the sponge construction that won the NIST SHA-3 competition in 2012. Between the winning submission and the final FIPS 202 standard (2015), NIST changed one byte of the padding scheme. The original variant lived on under the name “Keccak” , most famously as Ethereum’s keccak256 precompile , producing different digests from the official SHA-3 family for the same input.

The padding difference

Same underlying Keccak-f[1600] permutation. Same sponge structure. Same security. Different output for the same input because the padding bytes differ.

At a glance

Common variantsKeccak-224 / 256 / 384 / 512
State1600 bits (5×5×64)
Rounds24 (same as SHA-3)
Length extensionNo (sponge)
StatusCryptographically equivalent to SHA-3; non-NIST padding

Why this matters: Ethereum

Ethereum’s keccak256 opcode (Solidity calls it keccak256(...)) uses the pre-NIST padding because the Ethereum whitepaper was written before FIPS 202 finalized. For any non-empty input, keccak256(x) != sha3_256(x). Many cross-chain bridges and Ethereum-tooling libraries have to be very careful here.

Try it

The multi-algorithm hasherincludes both Keccak-256 and SHA3-256 so the byte-level difference is visible. Try input "" and you’ll see two different 32-byte outputs.

References

Visualize

Keccak-256 on your input

11 bytes · 0-bit digest

Hex digest

Bit grid (0 bits, teal = 1, slate = 0)

Byte pixel art (0 bytes, hue = byte value mod 360°)

Avalanche , flipping the lowest bit of the first input byte changed 0 of 0 output bits

Test Your Knowledge

Quick MCQ check on this algorithm

Start Quiz →

AI Summary

Summarize this page in your favorite LLM