I need to find c of the encryption of m = 100 using RSA given " p = 89, q = 101 and e = 7 ". Then, i need to decypher the obtained c
I have already calculated n = p * q, which is 8,989 and φ(n) = (p-1)(q-1) which is 8,800
For calculating d i found the formula de ≡ 1 (mod φ(n)) quite confusing, so i used d = 1 + (k) * φ(n) / e (which, as far as I'm concerned works the same), by doing that I got 1,257.
I'm not sure if there's a way to calculate c ≡ m^e (mod n) much more efficiently, because i just did the 100^7 operation, which is quite large, and calculating the mod i got 7170, resulting c = 7170.
How do I decypher c efficiently? Using the RSA formula for decyphering (M = C^d mod pq) the operation would be structured like this: M = 7170^1257 mod 8,989, and it's to big of a number to calculate.
Calculating $7180^{7543}$ and then reducing mod $8800$ would be ridiculously inefficient.
A simple method, which is very fast for numbers this small, is to reduce mod $8800$ after every multiplication. That way, you never have to deal with numbers greater than $8799\times 7543$.
But for cryptographically strong numbers, hundreds of digits long, you need to use a powering ladder. See this link for a description.