Question: For this homework, you will write a program that involve Python concepts like classes, decorators, gen- erators and iterators. You will be writing an RSA

 For this homework, you will write a program that involve Pythonconcepts like classes, decorators, gen- erators and iterators. You will be writing

For this homework, you will write a program that involve Python concepts like classes, decorators, gen- erators and iterators. You will be writing an RSA encryption/decryption system that conforms to the . Write a class called RSA that will contain all of the functions in the program. In the constructor for Write a function called inputFunc that reads in the number of entries from the user. Then, read in . Write a function called printFunc that takes in a number and prints "message is" followed by the Write a generator function called primeGen that will take a minimum value as a parameter and then following specifications RSA initialize an empty list and set variables e and d to 0. (10 points) those many values and add them to the list. (5 points) number. (5 points) yield the next prime numbers. Please note that this input parameter will be quite large and you might want to use long if you're using Python 2. (10 points) Write a function called keyGen. This function will read in a minimum value from the user. Then, it will use the primeGen generator to get the next 2 prime numbers and generate the value N and the keys e and d. Print e and N but not the other values. (10 points) . You would probably also need to write helper functions for the Lowest Common Multiple (LCM), . Write a function called encrypt that takes in a number as a parameter and returns the RSA encrypted Write a function called decrypt that takes in an encrypted number as a parameter and returns the Write a decorator function for printFunc that will print "The encrypted" before the printed message. Write another decorator function for printFunc that will print "The decrypted" before the printed Write a function called messages that calls inputFunc and keyGen and then, uses an iterator to Greatest Common Divisor (GCD) and the Totient function. value of the number. (5 points) RSA decrypted value. (5 points) (10 points) message. (10 points) iterate through the list and encrypts each of the numbers using the encrypt function. Store the results in another list. Then, go through the second list and print each encrypted number using the decorator for the encrypted message. (15 points) . Verify your results be decrypting each of the encrypted messages and checking if you get the old value back. Print the decrypted values using the decorator for the decrypted message. (10 points) . In main, create an RSA object and call the messages function. (5 points) For this homework, you will write a program that involve Python concepts like classes, decorators, gen- erators and iterators. You will be writing an RSA encryption/decryption system that conforms to the . Write a class called RSA that will contain all of the functions in the program. In the constructor for Write a function called inputFunc that reads in the number of entries from the user. Then, read in . Write a function called printFunc that takes in a number and prints "message is" followed by the Write a generator function called primeGen that will take a minimum value as a parameter and then following specifications RSA initialize an empty list and set variables e and d to 0. (10 points) those many values and add them to the list. (5 points) number. (5 points) yield the next prime numbers. Please note that this input parameter will be quite large and you might want to use long if you're using Python 2. (10 points) Write a function called keyGen. This function will read in a minimum value from the user. Then, it will use the primeGen generator to get the next 2 prime numbers and generate the value N and the keys e and d. Print e and N but not the other values. (10 points) . You would probably also need to write helper functions for the Lowest Common Multiple (LCM), . Write a function called encrypt that takes in a number as a parameter and returns the RSA encrypted Write a function called decrypt that takes in an encrypted number as a parameter and returns the Write a decorator function for printFunc that will print "The encrypted" before the printed message. Write another decorator function for printFunc that will print "The decrypted" before the printed Write a function called messages that calls inputFunc and keyGen and then, uses an iterator to Greatest Common Divisor (GCD) and the Totient function. value of the number. (5 points) RSA decrypted value. (5 points) (10 points) message. (10 points) iterate through the list and encrypts each of the numbers using the encrypt function. Store the results in another list. Then, go through the second list and print each encrypted number using the decorator for the encrypted message. (15 points) . Verify your results be decrypting each of the encrypted messages and checking if you get the old value back. Print the decrypted values using the decorator for the decrypted message. (10 points) . In main, create an RSA object and call the messages function. (5 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!