I am trying to implement the RSA Key Generation algorithm for a school project. I am having trouble with the encryption stage of the algorithm. It requires me to raise a user inputted integers to the power of a random number (random number has a criteria) and these random numbers are usually 2 or 3 digits long; eg. 23^239 = d
. In most situations, the 'd' value is 100s of digits long and I cannot find anything to store it as. I have tried long long
but the return value is always negative.
How can I generate and store very large numbers?