Question: (40 pts) Now you will implement RSA encryption. Remember, we can encrypt a message M with C- M mod n and decrypt the cipher C

(40 pts) Now you will implement RSA encryption. Remember, we can encrypt a message M with C- M mod n and decrypt the cipher C with Written part: (a) Use the list of primes that you generated in part 1 and select two primes of 4 digits each. That M - cd mod n is, select p and q such that 1000?p, q ? 9999. (These will give you your n-p, q) (b) Now, find an e such that e is relatively prime with (p-1)(-1). Prove that ged(e, (p-1)(-1 1 with Euclid's algorithm. (c) Find d, the inverse of e modulo (p- 1)(a - 1) using Euclid's algorithm again Now implement two functions: encrypt (M,e,n), which returns the cipher, C, and decrypt (C,d,n), which returns the original message, M. Both of these functions should make use of your fast modular exponentiation from part 2. Use your functions to perform block encryption on the message: "I am in a glass case of emotion" Use a block size of 3 letters. You may convert this message to a numerical form by hand before feeding it to your function and you may also disregard spaces. (For a challenge, have your encrypt function take this message as a character string, and encode it with ASCII values before encrypting
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
