About the Shake-128 Hash Generator
SHAKE128 is an extendable output function rather than a fixed digest. The Keccak sponge absorbs your message 168 bytes at a time, and then keeps squeezing bytes out of the state for as long as you keep asking. Set the length to 256 bits and you get something that behaves like a hash; set it to 2048 and you get a deterministic stream, all derived from the same input.
The 128 in the name is the security level, not the output size. Whatever length you request, an attacker needs roughly 2^128 work to find a collision or a preimage, and asking for more bytes never buys more strength. That is the number to keep in mind when sizing the output: past 256 bits you are collecting material, not security. Note also that SHAKE128 with a 256-bit output is not SHA3-256, because the two use different padding bytes, so their digests differ for identical input.
Extendable output is what you want when a protocol needs a specific number of pseudorandom bytes. Post quantum schemes lean on it heavily to expand seeds into matrices and noise, mask generation functions in signature padding use it, and it makes a tidy key derivation step when a single secret has to yield several independent keys. Here the sponge runs in plain JavaScript inside the page, output length is set in bits and must be a whole number of bytes, and the result can be shown as hex or Base64. Because it is a prefix stream, a shorter request is always the beginning of a longer one. The higher security level lives at the Shake-256 Hash Generator, and the fixed length cousin at SHA3-256.
How to use
- Paste the seed, message or identifier you want to expand on the left.
- Set Output bits to the length the protocol asks for, in multiples of eight.
- Switch to Base64 if the bytes are going into a text field rather than a hex dump.
- Copy the stream, or download it for use as key material.
Common questions
- Is SHAKE128 with 256 bits the same as SHA3-256?
- No. SHA3-256 appends the padding byte 0x06 and SHAKE128 appends 0x1F, and the two also use different rates, so the outputs never match.
- Does a longer output make it more secure?
- No. The security level stays at 128 bits however many bytes you squeeze. Extra length is useful for key material, not for strength.
- Is a short output a prefix of a longer one?
- Yes. Asking for 128 bits gives exactly the first 16 bytes of a 256-bit request on the same input, which is a defining property of the sponge.
- Where is SHAKE128 actually used?
- Mostly inside post quantum cryptography, where lattice schemes expand seeds into large public matrices, and in mask generation for modern signature padding.