![Diffie Hellman Calculator Diffie Hellman Calculator](http://deliveryimages.acm.org/10.1145/3300000/3292035/f2.jpg)
Posted by2 years ago
Example: Diffie - Hellman: Define Public Values: n = g = Both Alice and Bob each pick a private x and compute a public X = g x mod n. Alice Bob; Alice chooses a Private Value PrivateA = Bob chooses a Private Value PrivateB = - or - Alice computes Public Value PublicA = 1 = mod.
Archived
Diffie-Hellman Key Exchange Mathematics
Hey all.
I was researching different methods for Cryptography and came across the Diffie-Hellman Key Exchange. In the example video I watched for it, these were the mathematics used.
We start with two randomly chosen shared variables P and G, where the equation used with these variables is
(Gn) mod(P)
So, then two people in the example named Alice and Bob both have privately generated keys (n). Let's say that the the set of n's generated is {12,15}, respectively. And let's say that G is 3 and P is 17.
Alice generates the number (312) mod(17) = 4, and sends the result to Bob
Bob generates the number (315) mod(17) = 6, and sends the result to Alice
Alice uses her original n, and replaces her original G with Bob's result and gets
(612) mod(17) = 13
Bob uses his original n, and replaces his original G with Alice's result and gets
(415) mod(17) = 13
The key exchange operates on the principle that these two numbers will always be the same, and that if someone intercepted the messages sent between Alice and Bob, it would be extremely difficult to arrive to this final agreed upon number (13) without knowing the privately generated keys.
What I don't get is WHY these two numbers will always be the same. Is it some rule of logarithms that I'm just not seeing? It's not clicking for me.
25% Upvoted
$begingroup$I encountered a question that I can't seem to get around it. Lets say user A and B uses the DHKE defined over $GF(2^8)$ induced by the irreducible polynomial $x^8 + x^4 + x^3 + x^2 + 1$ and the primitive root $10$ (base $2$).
![Diffie Hellman Calculator Diffie Hellman Calculator](/uploads/1/2/5/7/125790777/711729332.png)
- What will be the corresponding public key if user A chooses a private key $X_a=3$?
- What will be the public key of user B if B chooses a private key $X_b=9$?
- What would be the shared secret key between A and B under normal conditions?
My answers says that for 1), its $10^3=1000$. Would that be correct? Because if I understand correctly, it's 10(base 2) but $10^3=1000$ will be base 10, right? For 2) (ans=3A(base 16)) and 3) (0C (base 16)), I am totally clueless... thanks for any help rendered!
LaughyLaughy
$endgroup$