**Instructions:**
This applet shows that

(

*g*^{a} mod

*p*)

^{b} mod

*p* =
(

*g*^{b} mod

*p*)

^{a} mod

*p*.
Enter numbers

*a* and

*b* in boxes labled

`num1:`,

`num2:`, and

`mod:`. Enter numbers

*g*
and

*p* in boxes with those labels. Click on

`Doit`.
Both calculations appear in the boxes of the right column with labels
showing exactly the operations performed.

Source code