Question: 1 Background 1.1 modpower To calculate the value for 2 3 mod 3 we can use the modpower function. We know that, 2 3 mod

1 Background 1.1 modpower To calculate the value for 2 3 mod 3 we can use the modpower function. We know that, 2 3 mod 3 = 8 mod 3 = 2 Heres the R code to do that library(numbers) modpower(2, 3, 3) ## [1] 2 1.2 coprime To find whether two numbers are relative prime or co-prime, we can use the coprime function in R (numbers package). For example. coprime(20, 3) ## [1] TRUE?

Please write your code in the given .Rmd file and submit your script.

Question 3. Encrypt the following message with the encryption function from question 1: Attack at 1300 hours. (20 points). p and q are random primer numbers (use Primes() fuction from numbers package). Choose p from a range [150, 170] and q from range [290, 350] Calculate N and phi from p and q (follow the steps shown in last Wednesdays class lecture) Take another prime e such that e and phi are co-prime Calculate d as the inverse mode between e and phi You need to set these values only once outside the encrypt and decrypt functions?

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!