Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please explain your steps and process to get this code In C + + create the following functions: MRT = > Use Miller - Rabin
Please explain your steps and process to get this code
In C create the following functions:
MRT Use MillerRabin Primality Test to choose a prime number with s bits and check the primality test.
EA Use Euclidean Algorithm to evaluate gcd
EEA Use Extended Euclidean Algorithm to find modular inverse of the value
powmodsm Square and multiply algorithm to evaluate exponentiation.
Now write the code for
RSA Key Generation use above functions should be
Choose two primes p and q of s bits using MRT where p is not equal to q
Calculate npq and npq
Chose randomly e from the set of n and check using EA if gcden if not chosen again until it fulfills the condition.
Calculate de mod n using EEA. Note that d should be at least s bits
Output kPubne and kPr d
RSA Encryption with input kPubne and random plaintext x and output should be ciphertext y evaluate exponentiation using the function powmodsm
RSA Decryption with input kPr d and ciphertext y and output should be plaintext x evaluate exponentiation using the function powmodsm Please make sure to check that you get the same plaintext value before the encryption.
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