kyle.mace.35 0 Light Poster

I am not going to lie, this is for a class project but I am lost and can't figure out where things are going wrong.

We were tasked with coding an RSA algorithim based off a lab we previously did in class. The lab and project description can be found in the attached files.

Now we need to use very large prime numbers 100+ digits long large. To get around c++ data size limit of long long I am using a third party library called BigInteger.

The program already has 2 primes put into for use to calculte the modulus and eulur totient. Those are set at p=38693 and q=39887. These are known primes that I put in myself.
The program then requires a public key, e. The user puts in e, I usually use 127 or 65537.

I am getting a really weird problem where the RSA encryption and decryption proccess work fabulous when p and q are small, but once they get larger say p=74797 and q = 76003 still with an e of 127 the process screws up on some of the letters in the message.

The code can be found at Click Here

Sorry if this is hard to understand its a really funky problem and I am unsure of how to describe it. Just run the program and you will see.