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
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