 say that is public key algorithm myself Rashmi Dixie. So learning outcome at the end of this session students will be able to explain public key requirements. They are also able to explain what is RSA and what are the steps of RSA and because of which they are able to generate pair of keys using RSA algorithm. So first we will check out what are public key requirements. Public key algorithms rely on two keys where it is compulsory of having computationally infeasibility and computationally easiness. So what is a means of computationally infeasible? It is computationally infeasible to find decryption key by knowing only algorithm and encryption key. And what is computationally easy? It is computationally easy to encrypt or decrypt message when relevant keys are known. So either of the two related keys can be used for encryption with the other used for decryption using the SUM algorithm. And these are forbidden requirements which only a few algorithms have satisfied. So we have seen what are public key requirements. Now we will look out the two more definitions how the security of public key schemes have defined. So it needs a trapdoor one-way function. Now what is one-way function or what is the characteristic of one-way function? Y is a function of X become called as easy and it is not possible to find out X by getting or by applying a inverse of function on a Y. It is somewhat or it is infeasible to get X by applying inverse function on a Y. It is called as one-way function. Now the next definition is trapdoor one-way function. Now what is that Y by applying function on X is easy if K and X are known X by applying inverse function on a Y is easy if K and Y are known but X by applying Y sorry by applying inverse function on a Y is infeasible if Y is known but K is not known. A practical public key scheme depends on a suitable trapdoor one-way function. So it is not possible to get original message by applying reverse function on a cipher text no matter either algorithm is known or key is known. So what are the public key requirements? Like private key schemes brute force exhaustive search attack is always theoretically possible but the keys used are too large which is a greater than 512 bits. Security relies on a large enough differences in a difficulty between easy and hard. The third one is more generally the hard problem is known but is made hard enough to be impractical to break. Problem knowing is different than problem breaking and it requires the use of very large numbers hence is slow compared to private key schemes. Now RSA it is a algorithm by three scientists Rivest, Shamir and Adelman of MIT which is built in a year of 1977. It is best known and widely used public key scheme or public key crypto sorry public key algorithm. It is based on exponential in a finite or Galois field over integers modulo apri. Here it is a characteristic of RSA it is based on modulo apri nb exponential takes on an average big O of log n to the cubical operations. It uses large integers up to 1024 bits and provide security due to cost of factoring large numbers nb factorization takes big O of e raise to log n log n log n operation which is hard. Now what is a use of RSA encryption or how it decryption or how it is built to encrypt a message m the sender obtain a public key of a receiver that is public key two public keys e and n then compute that is cipher text m raise to e mod n where m is between 0 to n and to decrypt a cipher text c the owner uses its own private key which is defined as a pr d and n and computes that is message from the cipher text c raise to d mod n. Now note that the message m must be smaller than the modulus of n that is important point. Now these are the steps of RSA how to generate RSA key that is a public key and private key e n and d n so e and d. So each user generates a public and private key pair by it is purely a mathematical. So start with a selecting two large prime numbers let us say as a p and q then computing their system modulus by taking the multiplication and then taking the mod that is p minus 1 q minus 1 up to that then selecting at random the encryption key e. Now what is a rule for that e it is between 1 and mod of n that is 1 and the second one is gcd that is a greatest common divisor will give you only one that is a common between e and phi of n e is compulsory 1 means there should not be common between e and phi of n and then e d is equal to 1 mod phi of n that is a formula to find out the decryption key and d is between 0 to n. Remember that the publish their public encryption keys p u e and n and keep secret private decryption key that is d and n. How you can say that RSA will work fine finally or it will always gives you good result because it has a characteristic of a Euler's theorem a of phi of n mod n is equal to 1 where gcd between these two is 1 that is of important characteristic RSA by finding n by applying mod of n and then choosing carefully e and d such that it will try to give 100% security cd is equal to m e d where m is equal to 1 plus k multiplied by mod of n and m 1 and by applying 1 raise to k on that m we will get m raise m mod n and in this mathematical formula the security of RSA. Now just we will sort out or we will look out the one example in the next session we will solve the example. Now select primes we will just chosen randomly p17 q11 remember one thing for a calculation we have chosen two digit number numbers are so large or nowadays just think numbers might be anything. Now we are calculating n that is pq by taking the multiplication of 17 and 11 that is 187 then we are going to calculate the phi of n or modulus of n p minus 1 multiplied by q minus 1 that is 16 into 10 160. Now it is a time to select e it depends on a gcd e and phi of n should be 1 so you can choose any here I have taken e is equal to 7. Now it is a time to determine d so what is our formula d e that is a multiplication of d e is equal to 1 mod n 1 mod not n phi of n sorry so phi of n so 1 mod 160 and value of d should be less than 160. So by taking calculations here I find out d is 23 why you can also try to find out d 23 into 7 that is 161 so 161 10 into 160 plus 1 gives you 1 and now it is time to publish public key that is 7 and 187 that is e and n n is 187 by calculating p multiplied by q and keep secret private key now what is private key again d and n so by calculation d is 23 187 so that key will be private. Now student please pause the video and try to figure out the answer what is the question in RSA we select a value e such that it is in between 0 and phi of n and it is relatively prime to phi of n just look at the or just try to recall the algorithm you will get the answer is it true or false what is it is false we select what is the question we select a value e such that it lies between 0 and phi of n and it is relatively prime to phi of n so how we are going to find e we are taking the gcd of e and phi of n and after that we are going to choose the e so this is false so this is a reference thank you.