I need to calculate $7^{2012} \mod {13}$ by hand using exponentiation by squaring, but I cant seem to figure it out.
I started with this but I don't know for sure if its correct or where it's going.
\begin{align} (7^2)^{1006} &\equiv 49^{1006} \pmod {13} \\ (10^2)^{503} &\equiv 100^{503} \pmod {13} \end{align}