#include #include #include #include using namespace std; long int p, q, n, t, flag, e[100], d[100], temp[100], j, m[100], en[100], i; char msg[100]; int prime(long int); void ce(); long int cd(long int); void encrypt(); void decrypt(); int prime(long int pr) // function to find whether the numbers are prime or not { int i; j = sqrt(pr); for (i = 2; i > p; // getting p flag = prime(p); if (flag == 0) { cout > q; // getting q flag = prime(q); if (flag == 0 || p == q) { cout > msg; // getting the message for (i = 0; msg[i] != NULL; i++) m[i] = msg[i]; n = p * q; // calculating n t = (p - 1) * (q - 1); // calculating t ce(); cout 0) { d[k] = flag; k++; } if (k == 99) break; } } } long int cd(long int x) { long int k = 1; while (1) { k = k + t; if (k % x == 0) return (k / x); } } void encrypt() // encryption { long int pt, ct, key = e[0], k, len; i = 0; len = strlen(msg); while (i != len) { pt = m[i]; pt = pt - 96; k = 1; for (j = 0; j }
Enhance the C/C++ program above to add RSA signature capabilities. Your program should also do the following a. Derive a new set of public and secret keys (you can use the key generation routine from problem 1 above to generate new set of public and secret keys for signature operations) b. Use the functionality of RSA and RSA inverse operations (developed for problem-1 above) to perform signing and verification algorithms You have to submit: 1) The program source code 2) Output of key generation routine/function to show the two keys generated 3) Example plain text input and the output of RSA signing operation 4) The execution output of verification operation