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 1. Create an encryption function that takes a message (M), encryption exponent (e) and modulus (N) as input parameters and returns the cipher-text for M as output. (20 points)

Question 2. Create a decryption function that takes the cipher-text (C), the decryption exponent (d), and the modulus (N) as input parameters and returns the message (M) as output. ?

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!