Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help, I need this completed in c++ based on the given code I provided --------------------- RSA key generation: 1. Implement Fermat test 2. Use

Please help, I need this completed in c++ based on the given code I provided

---------------------

RSA key generation: 1. Implement Fermat test 2. Use Fermats test to generate two large prime numbers (p,q), each should have a size >= 512 bits; 3. Save p and q in a file named p_q.txt, one integer per line and making sure no white space saved; 4. Use extended Euclidean algorithm to generate two pairs of keys: (e,n), (d,n), where n=p*q; 5. Save the two pairs of keys in two separate files: e_n.txt and d_n.txt, one integer per line and no white space;

Given code:

// Standard libraries #include #include #include

// 'BigIntegerLibrary.hh' includes all of the library headers. #include "BigIntegerLibrary.hh"

int main(){ /* The library throws 'const char *' error messages when things go * wrong. It's a good idea to catch them using a 'try' block like this * one. Your C++ compiler might need a command-line option to compile * code that uses exceptions. */ try { std::cout << "a couple of test cases for Algorithms!!! "; BigUnsigned big1 = BigUnsigned(1); for (int i=0;i<400;i++) { big1 = big1*10 +rand(); } std::cout << "my big1 !!! "; std::cout << big1; BigUnsigned big2 = BigUnsigned(1); for (int i=0;i<400;i++) { big2 = big2*10 +rand(); } std::cout << "my big2 !!! "; std::cout << big2; std::cout << "my big3 = big1*big2 !!! "; BigUnsigned big3 = big1*big2; std::cout <

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

Describe the premium pay benefit practice.

Answered: 1 week ago