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: g^{a or b} mod n |
private -> secret key formula: ap or bp^{a or b} mod n |
Alice (private) | Public | Bob (private) |
---|---|---|
a (1-20): | n (1-100) (prime): | b (1-20): |
g (1-20): | ||
g^{a} mod n = | g^{a} mod n = | |
bp^{a} mod n = | ap^{b} mod n = |