Here is the example to show simple calculation :
- Alice and Bob agree to use a prime number p = 23 and base g = 5 (which is a primitive root modulo 23).
- Alice chooses a secret integer a = 6, then sends Bob A = ga mod p
- A = 56 mod 23 = 8
- Bob chooses a secret integer b = 15, then sends Alice B = gb mod p
- B = 515 mod 23 = 19
- Alice computes s = Ba mod p
- s = 196 mod 23 = 2
- Bob computes s = Ab mod p
- s = 815 mod 23 = 2
- Alice and Bob now share a secret (the number 2).
Done :)
Nice explanation
ReplyDelete