Question: I'm writing an RSA 64 bit C++ code, I don't want to encrypt and decrypt data, I just want to generate the Public and Private

I'm writing an RSA 64 bit C++ code, I don't want to encrypt and decrypt data, I just want to generate the Public and Private key. The required is "The user should input the size of prime numbers , which maximum size is 18 Digits, 64 bits, then the code must generate 2 Prime numbers

each with the same size the user has input". For example, the user inputs: 15, then the code has to generate 2 Primes each with size 15 digits long. I have declared the 2 Prime numbers

as long long int data type, now the value of n is: n = p * q; So I have declared n as string, because it might be 128 bits long, so it cann't be stored in long long. And phiVal is: phi = (p - 1) * (q - 1); So I have declared phi as string. Now I have to find Public and Private keys. The equations are: e * d mod n = 1 1 < e < phi e is coprime to phi And d is the multiplicative inverse of e. So, as long as n and phi are strings, how can I find the value of e and d? Sorry for taking long. student submitted image, transcription available below Regards.

CAUsers ABDELSALAMDocuments Visual Studio 2015\Projects\Project4DebugProject4.exe Input Number of Digits 18 First Prime Number p = 1eeeeeeeeeeeeeeee3 Second Prime Number q = 100000000000000013 n-p *q100000808008166660000666ee00e39 phi(n) - (p 1) * (q -1) 1000000066006ee0140006000eeeee86e24 Execution Time: 0.15s

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!