This is a toy unauthenticated DH transcript, not real TLS breaking.
highlighted = computed this step
Authentication is the missing piece
TLS-style certificate checks bind identity to the transcript, so the public value is not just a bare number.
identity binds the transcript
It is not magic arithmetic
The same small DH math still recomputes. The fix is authenticated protocol design around the math.
authenticate before trusting
Honesty boundary
NOTE: toy-modulus; no-side-channel; no-production; never-roll-your-own. Toy unauthenticated DH only. This is not packet interception mechanics, malware, real TLS breaking, downgrade attacks, certificate bypasses, side channels, production exploit guidance, or real-size DH or ECDH.
toy unauthenticated DH only
Summary
This toy transcript makes the failure visible: Alice shares with Eve, Bob shares with Eve, and Alice and Bob never share with each other.