This is just a small example of the algorithm itself. In real-life situations, you should use the multiplicative group of integers modulo p, where p is prime, and g is a primitive root modulo p to ensure maximum security. This example only shows the logic of how two actors in a key exchange can know the same secret key without transferring it publicly. Try changing the common or secret value of the actors to see how all the numbers change. The input fields are color-coded to show which numbers are the same, step by step.
For more information visit the Wikipedia page.
Coloring: