Upload to Canvas a PDF of your work for the following problems

Assignment: due Wednesday, 11:59 pm

You will need to do some/most of the calculations below using the gmp package.

  1. Compute the RSA ciphertext for the following modulus, public exponent, and plaintext.
library(gmp)
rsaModulus <- as.bigz("195788142788358164233804492957398488634726254
80010690459681625329893085627204988093818307212739677049956352567177
87746099255774603493751657981591279103676377321834690778523173801439
56666453740761405761559112081931710294389007965357426686841571207915
63250256451028748849392888561065149545396193209901120150922222695733
85885218236653180615298633266570810577713313325153177729917576091579
04367035499790847594316987574068066165228272596810445659823407499566
73617955415896513151098470897855653135143572581766041083134024184173
37290933287861015998551958245267490476692680563890349711670121990426
2326557198534825303109914717")
rsaExponent <- as.bigz("65537")
plainText <- as.bigz("453787497332492283997614676595994471")

Observe that, for this example, the ciphertext number has many more digits than the plaintext number. Try some other short ciphertexts? Does this usually happen?

  1. Out of all the positive integers that are less than 1 million, what percentage of them have six digits? What does this have to do with the observation at the end of question 1?

  2. Suppose that an implementation of RSA uses the public encryption exponent 65537 and the (small) public modulus 371319292755115219695668554559. Alice sends the ciphertext 50412340282781311528939282945. Determine the plaintext.