Mathematician + Developer + Cat DadMath, code, cats, books and faith. Since 2024.
Hash Garden
Deterministic botanical entropy. Type a seed and pick a hash function, and its output grows a glowing garden: the same seed always grows the same plants. Flip one bit and the whole thing changes. Hover any branch to see the exact hash bytes it grew from. Press Space to pause.
Garden
Species...
Digest...
Graph...
Controls
The math
Nothing in the garden is random. Every angle, length, color and petal is read from one long stream of hash output, so a seed always grows the same garden, and a share link carries the whole garden in a few words.
Seed to stream. The grower hashes a domain-separated message built from a fixed tag, the grower's name, your seed and the mutation number , with zero bytes keeping the fields apart:
The fixed-length hashes (SHA-256, SHA3-256, Ascon-Hash256) give 32 bytes at a time, so they run in counter mode, with the counter as four little-endian bytes:
The extendable-output functions (SHAKE128, Ascon-XOF128) simply squeeze for as many bytes as the garden asks for. The extra plants in a grove append one more field, , so each grows from its own stream. In a mixed bed the grower's name already keeps the five streams apart, so each plant there is exactly the plant that grower would grow alone.
Bytes to shapes. Four bytes make a number in ,
and every choice is a function of a fresh : a length between and is , a whole number from to is , and a coin that lands heads with probability is the test .
The plant grows breadth-first. Each branch reads its curve, its leaves, maybe a bloom, and then how many children it will have and where along it they sprout. That makes the plant a branching process (a Galton-Watson tree) driven by the stream, cut off after
branches, where is the Complexity slider and is the species' density. Hover a branch to see the stream bytes it was read from; those bytes also decided its leaves and where its children start, so the whole lit-up subtree hangs off them.
Wind. Each branch bends rigidly about its base, and its angle is its parent's angle plus its own bend:
Here is the Wind slider, the branch depth, where the branch starts, , and a per-branch phase; the trunk takes only a third of its bend. The gust rolls across the garden from left to right, and because the bends add up along the path from the root, twigs swing far more than the trunk, the way a real tree moves.
The avalanche. A good hash has the avalanche property: flip any single input bit and every output bit flips with probability one half, independently of the others. So the number of digest bits that change is binomial,
and about 95% of flips change between 112 and 144 bits. Set View to Avalanche to watch it happen: the readout counts the changed bits of the full 256-bit digest (changed hex digits are pink), and the two gardens have nothing in common, not even their first branch.
SHA-256 grows the Crystalline cypress: narrow forks, one or two children per branch, crystal leaves and star blooms. SHA-256 is a Merkle-Damgard hash: the message is cut into 512-bit blocks, and each block is mixed into a 256-bit state by 64 rounds of
where uses to choose bits from or , and takes a bitwise majority vote.
SHA3-256 grows the Sponge orchid: wide forks, two or three children, curling stems and orchid blooms. SHA-3 is a sponge: a 1600-bit Keccak state absorbs the message 1088 bits at a time, keeps 512 bits of capacity out of reach, and is stirred by 24 rounds of five steps. The only nonlinear step works along every row of the state:
SHAKE128 grows the XOF willow: long, deep, drooping branches and misty blooms. It is the same Keccak sponge with a rate of bits and a capacity of 256, but it is an extendable-output function: once the message is absorbed, the sponge is squeezed for as much output as you like,
so the garden's stream needs no counter at all.
Ascon-Hash256 grows the Lightweight fern: every branch forks into exactly two, with feathery fronds. Ascon is NIST's lightweight cryptography standard, built for tiny chips: a 320-bit state of five 64-bit words absorbs 64 bits at a time and is stirred by 12 rounds of a 5-bit S-box followed by a linear layer that mixes each word with rotated copies of itself, for example
Ascon-XOF128 grows the Ascon vine: wandering, curling stems hung with lanterns. It runs the same 320-bit Ascon permutation as Ascon-Hash256, but squeezed as an extendable-output function, 64 bits per permutation call, for as long as the garden keeps asking.
References: NIST FIPS 180-4, "Secure Hash Standard" (2015); NIST FIPS 202, "SHA-3 Standard" (2015); NIST SP 800-232, "Ascon-Based Lightweight Cryptography Standards" (2025); Webster and Tavares, "On the Design of S-Boxes" (1985), for the avalanche criterion.