Diffie-Hellman ProtocolThis is a TOY example, for practice or entertainment purposes onlyYou and I (“I” being this web page) want to perform the Diffie-Hellman protocol to end up with a shared secret consisting of a number from 0 to 99 (this number would in principle become the encryption key for subsequent communications — keep in mind that if we have a “shared secret”, then it is easy to use encryption to communicate!) The protocol in this toy example uses g = 17 as parameter (that is, we compute 17 to the power of something). You will choose a random number (let's call it x), in principle between 1 and 99, but I recommend that you choose something between 1 and 15 or 20 (otherwise, your hand calculator might not be able to deal with results as large as, say 80 to the 80, or 99 to the 99). Ok, once you choose x. then compute 17 to the power x modulo 100 (remember that modulo 100 means that you take only the last TWO digits of the result), enter the result in the box below, and click on the button to continue: The result of 17x modulo 100 is:
Ok, got it — so, I did the same, and my result is 4 Now, as you may remember, the protocol is completed when I take your result and compute that value to the power of my random number, and you take my result and compute that to the power of the random number that you chose. As you should recall, the two results will be the same, and only the both of us will know that value (even if someone else saw the intermediate results that we exchanged, they will not be able to know our "shared secret"). Now, for verification purposes (I clarify that this step is NOT part of the DH protocol), for you to know if you did the calculations correctly, tell me that final result (the "shared secret"), and I will confirm whether you got the right value: The result of 4x modulo 100 is:
Sorry, your answer is INCORRECT. You can use your browser's RELOAD/REFRESH to try again. CORRECT! You got the right answer!!
|