Question: The purpose of this problem is to give you a better understanding as to the mechanisms of RSA. Write a function that receives as its
The purpose of this problem is to give you a better understanding as to the mechanisms of RSA. Write a function that receives as its parameters primes p and q, calculates public and private RSA keys using these parameters, and outputs n, z, d and e as printouts to the standard output. The function should also accept a stream of ASCII characters and encrypt this input using the calculated RSA keys. The program should take plain text from the standard input and print the cipher text to the standard output. The encryption should be carried out character-wise, that is, take each character in the input and encrypt it independently of other characters in the input. For this problem, you are allowed to select any reasonable system to determine that the end of the input is reached. You may select any output format, as long as it is unambiguous. Make sure to document clearly in your code any assumptions you make about the input and encryption algorithm.
Step by Step Solution
3.40 Rating (163 Votes )
There are 3 Steps involved in it
Here is a solution that demonstrates how to calculate the RSA keys and encrypt a stream of ASCII cha... View full answer
Get step-by-step solutions from verified subject matter experts
