Question: Please write your code in the given .Rmd file and submit your script. ? Create an encryption function that takes a message (M), encryption exponent

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

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. ?THEN

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!