I want to calculate the RSA algorithm by myself . I need to calculate the modulus of a number at a certain power. The thing is that that number at that certain power can get quite big.
Here is what i want :
x = pow(n, p) % q
How can I efficiently determine x?
If you’re using .NET 4, I suggest you look at
BigInteger, which even provides theModPowmethod to do it all in a single operation 🙂