Diffie-Hellman
Whitfield Diffie
Martin Hellman
Ralph Merkle
with ECC
A = a * G
B = b * G
Alice finds a * B
Bob finds b * A
a * B = a * (b * G)
= (a * b) * G
= (b * a) * G
= b * (a * G)
= b * A
they've found identical values.
Example:
a = e7991f64243949a1977493de58d95d01e7991f64243949a1977493de58d95d01
A = (b1a8d7d35543861e15617a1ac90febc7cfbc115bf7828a97fc29c0429196dbc4, 0e8e28f387d0bd77b12bf69554af6a4ce79ace1480db3182c30f3b7d411bc900)
b = 18f81194290e4653a6f9e97536c42e12d5137b13f314471992649c9cfe45ca09
B = (f109f12b756bbdf99c5aa73e9ba537a549b6643a501998beb681d1c85f9bc1f5, 6ca559deb05d3da649befdfc364064415d40e79e67a9f5df8310984f0b0e99c6)
a*B = (0c41b72ea791b5913112b7bf854525806706345da26131796d7c742604304e01, 45157632ddb7446448daf2c8d7158c4f253d2f57fb317b977e24142c679d7afc)
b*A = (0c41b72ea791b5913112b7bf854525806706345da26131796d7c742604304e01, 45157632ddb7446448daf2c8d7158c4f253d2f57fb317b977e24142c679d7afc)
with RSA
Configuration Code Book
"shared secret"
2^x (mod 26)
Alice Bob
secret: 3 7
given: 8 = 2^3 24
24^3 = 18 (mod 26) 8^7 = 18 (mod 26)
ab = ba
(g^a)^b = g^ab
g^ab = g^ba
(g^a)^b = (g^b)^a
modulus MUST BE prime