
Totient function of n counts the positive integer numbers that co-prime to n. These variables are coming from the Euler’s generalization of Fermat’s Little Theorem. Then, we will find the module n and totient n (or shortly phi) variables from p and q. If you set a non-prime number to p or q, then this program will raise an error. A prime number must not be divided by another number less than it without remainder. To have a safety net, we should check the primeness of this p and q pair. In a practical application, these should be large primes but we will use small ones in this example. I look forward to seeing you in Crypto II where we will cover additional core topics and a few more advanced topics.The algorithm expects to pick two prime numbers first. Crypto is a beautiful topic with lots of open problems and room for further research. I hope everyone learned a lot and enjoyed the material. This is the last week of this Crypto I course. Please don't be shy about posting questions in the forum. The problem set this week involves a bit more math than usual, but should expand your understanding of public-key encryption. The lectures contain suggestions for further readings for those interested in learning more about CCA secure public-key systems. There has been a ton of research on CCA security over the past decade and given the allotted time we can only summarize the main results from the last few years. We construct systems that are secure against tampering, also known as chosen ciphertext security (CCA security). The videos cover two families of public key encryption systems: one based on trapdoor functions (RSA in particular) and the other based on the Diffie-Hellman protocol.

Public key encryption is used for key management in encrypted file systems, in encrypted messaging systems, and for many other tasks.

This week's topic is public key encryption: how to encrypt using a public key and decrypt using a secret key.
