/** \brief Decrypt a plaintext string using RSA decryption and stores it * * \param pt[] char Where plaintext gets stored * \param ct[] int Ciphertext * \param d int Private exponent * \param n int Modulus * \return void * */ void decrypt(char pt[], int ct[], int d, int n) { int i, pte[50000] = {}; for (i = 0; ct[i] > 0; i++) pte[i] = decodeRSA(ct[i], d, n); pte[i] = -1; decodetoPlain(pt, pte); return; }
/** \brief Decrypt a plaintext string using RSA decryption and stores it * * \param pt[] char Where plaintext gets stored * \param ct[] int Ciphertext * \param d int Private exponent * \param n int Modulus * \return void * */ void RSA::RSADecrypt( char pt[], int ct[], int d, int n, int size ) { int i; int *pte = new int[size+1]; for (i = 0; i < size; i++) pte[i] = decode(ct[i], d, n); decodetoPlain(pt, pte,size); delete pte; return; }