The attack works here because the group is deliberately tiny.

highlighted = computed this step

What this does show

The example shows the exact shape of the attack: search powers, recover x, then compute the shared value.

search then share\text{search then share}
Toy boundaryThe recovered exponent is used against the peer public value.Toy boundary - 19^6 mod 23stepbitpriorsquaremultiplyresult01111919111916552052skip2

Why tiny matters

The table stops at x=6 only because the group is deliberately tiny.

x=6x=6
Toy boundaryThe recovered exponent is used against the peer public value.Toy boundary - 19^6 mod 23stepbitpriorsquaremultiplyresult01111919111916552052skip2

Honesty boundary

NOTE: toy-modulus; no-side-channel; no-production; never-roll-your-own. This is a toy brute-force illustration only; it is not production discrete-log solving, real-size DH or ECDH, side-channel analysis, quantum discussion, or exploit guidance.

toy only\text{toy only}
Toy boundaryThe recovered exponent is used against the peer public value.Toy boundary - 19^6 mod 23stepbitpriorsquaremultiplyresult01111919111916552052skip2