Diffie-Hellman Visualized

The following shows Diffie-Hellman public keys and shared secret.  The residues modulo 79 are coloured in an increasing and then decreasing LCH colour scale (0 is yellow, 40 is blue-green).   The prime is p=191.  Every five seconds, the primitive root g changes.  If A=g^a is Alice’s public key and B=g^b is Bob’s public key, the pixel at position (A,B) shows the corresponding shared secret.  You’ll often see a smooth gradient in column (g,B) and row (A,g), since in these cases the shared secret agrees with one of the public keys.