I am studying for a cryptography final and I have come across something I can just not figure out. My math background is rather weak.
This is related to RSA and concerns itself with raising numbers to large powers. The question is:
Compute $10^{237}\mod 1009$.
I am aware the answer is $852$, but I am unable to calculate it.
I have tried using multiple of powers and looked at Euler's theorem and also Fermat's theorem, but at this point I'm so confused!
Any help would be appreciated.
$1009$ is a prime number and multiplicative groups modulo prime numbers are cyclic, so some numbers have order $1008$, so you won't be able to apply euler fermat or any result relying on the order of the elements.
Here is how exponentiation by squaring works: write the exponent in binary.
$237=11101101$
Proceed to calculate $10,10^2,10^4,10^8,10^{16},10^{32},10^{64},10^{128}$ in base $1009$ by squaring the previous term.
You should get $10,100,919,28,784,175,355,909$.
Since $10^{237}=10^{128}*10^{64}*10^{32}*10^{8}*10^{4}*10$ you want
$909\cdot355\cdot175\cdot28\cdot919\cdot 10 \bmod 1009$ to calculate this simplify mod $1009$ after each multiplication.
Your final result should be $852$