 myself Rashmi Dixit. Learning outcome. At the end of this session students will be able to explain key exchange algorithm. So, what is the concept behind this? So, look at this particular pictorial representation of symmetric encryption. Traditionally symmetric encryption suffered from one shortcoming. It was necessary for either sender or the recipient to create a key and then send to the other party. While the key was in transit it could be stolen or copied by a third party who would be able to decrypt any ciphertext encrypted with the key. Now, this is the disadvantage for symmetric encryption and here comes the Diffie-Hellman algorithm. So, Diffie-Hellman key exchange establishes a shared secret between two parties that can be used for secret communication for exchanging data over a public network. So, exchange of a secret key that is a particular achievement of Diffie-Hellman key exchange and analogy is explained with the help of color example instead of number example. So, two parties Alice and Bob they are publicly agree on a single color. Now, in this example it is a yellow and these both parties also kept one secret color with them. So, Alice grade and Bob kept light blue. They mix both and they exchange with each other and after exchanging they got there means that particular original color. Now, what is Diffie-Hellman key exchange algorithm? So, scheme proposed by Diffie and Hellman in 1976 along with the exposition of public key concept and it is only used for key distribution. It is a practical method for public exchange of a secret key which is used in a number of commercial product. So, public key distribution scheme it cannot be used to exchange an arbitrary message it is used to establish a common key known only to two participant. Key value depends on the participant and their private and public key information. This algorithm is based on an exposition in a finite field modulo a prime or a polynomial which is easy and security relies on a difficulty of computing discrete logarithm. So, let us look at the algorithm step one by one. So, two parties Alice and Bob in step one they both agree on a prime number and generator. Now, in this case the P indicate the prime number and G indicate a generator which is common at both side. Now, step two Alice and Bob both generate their own private key which is secret at their side. So, A and B are the private key of Alice and Bob respectively. Now, it is time to calculate the public key using private key. So, this particular capital A indicate the public key of Alice with the help of this particular formula G raise to a mod P same way B calculate the public key B G raise to B mod P. Now, they exchange their public key because public key is a public. So, step four exchange public key and in step five they calculate the secret key. So, K is equal to B raise to A mod P and at B side also K is equal to A raise to B mod P. So, both side calculate the secret key using other side public key and their own secret key. So, K is the same at both side and this way the exchange of secret key is happen at both side. So, K is equal to G raise to A B mod P and at Bob side also K is equal to G raise to A B mod P. This is the same representation all users agree on a global parameters prime number or a polynomial and primitive root mod Q. Then they both generates their own secret key and from secret key they calculate their public key after that they exchange their public key and it is time to calculate a session key at both side and after calculation it is found that the session key or a secret key K is the same at both side. So, without exchanging actual secret key, secret key is at both side. Only exchange of a public key that is not a new because public key is a public key it is publicly known to everyone. Session key exchange is happen and that is a characteristic of a DP helman key exchange algorithm. Now, we will look at here. So, K is used as a session key in a private encryption scheme between Alice and Bob if Alice and Bob subsequently communicate they will have the same key as before unless they choose a new public key. So, look at this particular diagram whenever public key changes by default that calculation changes and session key changes actually a session key expires after some time that is a important characteristic of a session key. So, attacker needs an X to means for finding out X they must solve the discrete logarithm. So, now take one example. So, Bob and Alice know and have the following things means P is equal to 23 and G is equal to 11. So, G is a generator and P is a prime number. So, these things are known to Bob and Alice. Now, Alice choose a secret random number A is equal to 6 there is a no restriction random number may be even or random number may be odd and same way Bob chooses a secret random number B is equal to 5. Now, Alice compute public key A is equal to G raise to A mod P that is 9 and Bob computes the public key using the formula G raise to B mod P that is P means with their own private key they calculate the public key and then they exchange their public key. So, Alice receives B is public key and Bob receives A is public key. Now, it is time to calculate the secret key. So, K is equal to B raise to A mod P and formula at Bob side K is equal to A raise to B mod P. So, same key exist at both side. So, the common secret key is 8 that is important. So, with the help of only mathematical function Bob and Alice both are able to find out what is a session key for that particular session. So, all of you please pause and try to think what are the advantages and disadvantages of Diffie-Hellman key exchange. So, let us look out the advantages the sender and receiver have no prior knowledge of each other. Communication can take place through an insecure channel sharing of a secret key is a secure. We will just look out this example. So, that you will get idea here what is common P and G both parties agree. Then they choose their own secret key they are not known to anyone and by using that secret key they calculate the public key and as the name indicate public key is publicly available to anyone who wants to communicate. So, they exchange that public key and by using that public key both sides separately calculate the session key which is common. So, that is important that are the advantages sender and receiver have no prior knowledge of each other. Now, what is disadvantage? It is slow yes and more processing is required it is slow why first prime number generator then secret key then calculation of public key then exchange of public key and then calculation of secret key. So, each step involves discrete logarithmic mathematical function. So, it is slow and more processing is required, but Diffie-Hellman establishes a exchange of secret key which is used for symmetric encryption and that exchange takes place with the help of public encryption cryptography or cryptosystem. So, how these things are relate to it each other, but each thing has advantage as well as disadvantage. So, this is a reference. Thank you.