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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started