Diffie-Hellman Key Exchange Example

n = prime # a = alice's private key ap = alice's public key
g = generator # b = bob's private key bp = bob's public key

public -> private key formula:
ga or b mod n
private -> secret key formula:
ap or bpa or b mod n
Alice (private) Public Bob (private)
a (1-20): n (1-100) (prime): b (1-20):
g (1-20):

ga mod n = ga mod n =

bpa mod n = apb mod n =