In this lesson, we discuss Diffie-Hellman Symmetric Key Protocol. It is a specific method for secure exchange cryptokey over a public channel has been used extensive throughout secure communication. One of the first public key protocols was original conceptualized by Ralph Merkle and then after the two person who published, which is Whitfield Diffie and Martin Hellmann. The famous Diffie-Hellman Key Exchange method allow two party that has no prior knowledge to each other to be able to jointly establish a shared secret key over an insecure channel. This key can then be used to encrypt subsequent communication using a symmetric key cipher like AES. In 1997, somehow it would reveal that much earlier, James H. Ellis, Clifford Cocks, Malcolm J. Williamson of GCHQ, which is British signal intelligence agency, actually much earlier has find out and shown how public key cryptography can be achieved using similar kind of scheme. And Diffie-Hellman is based on discrete algorithm problem because it's very difficult to figure out private key from even public key. Here is a Diffie-Hellman key example. Assume Alice and Bob would like to exchange a secret symmetric key for their secure communications. First, they need to be agree upon a modulus, which is a prime p, and a base g for computing the public key and symmetric key. In this case, Alice proposed using p equal prime p using 53 and g using 17 on a public channel. And note that g cannot be 0 or 1 or p-1, which is 52. Both agree on that. Now, Alice then try to compute its public key and select the private key. Alice choose the private key to be five and compute public key based on g to the power of private key mod p, which is 17^5 mod 53. The value is 40, and this is her public key. Alice then announce this public channel, this public key in public channel to Bob, and so Bob receive and keep a record that Alice's public key is 40. Next, Bob choose a private key, seven, and compute his public key using the same formula; 17^7 mod 53, which is six. He then announce in the public channel, say, yeah, my public key, Bob's public key is six, and Alice make a record of Bob public key is six for future communication. Bob like to send Alice a secure message. He say, let me compute the Diffie-Hellman exchange key as follows. I will use Alice public key, 40, as a base. I'll use my private key, seven, as exponent, so 40^7. And then the result we make a modulo operation, divide by 50, so basically take them remainder. That's mod 53. We got the result, 38. This we are use as a session key. And because Diffie-Hellman, I know Alice is going to compute with the same result. Let me send her now the encrypted message using AES-128-ECB electronic code mode, book mode we both agree on. Alice, after a certain period of time, receive these encrypted messages. He say, this is sent by Bob, let me figured out what is the session key he's using to communicate with me. Let us compute the session key using Bob's public key which I have a record he announced a moment ago, which is public key six. Let me use that as a base and then I'll use my private key five as exponent, so 6^5. And then we make the mod 53 operations, which is divide 53 and take the remainder. And the result, magically, is exactly 38. You can try to verify indeed if that's the case. I also know Bob used AES-128-ECB as a cipher type operation. Let me decrypt the messages. Aha, I know what he say. Let me reply. And I'll be sending over the public channel to Bob with the message "Ditto!" Now the question is, what Bob sent? Can you figure out what Bob say in the secret messages? And if you can solve it, you got bonus grade if you can figure it out.