Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
