# Modular Arithmetic - Approaching this type of problems

For my upcoming exam in Algorithms, as part of Cryptography, we are supposed to be able to solve these types of questions. I don't have the notes from that lecture, so I'm finding it difficult to figure out on my own.

A commented solution or references to what to I should read would be great.

Here is a an example problem:

Knowing that $7919$ and $7907$ are prime, solve the following:

$892^{(7918)(7909)}\mod(7919\cdot7907)$.

Noting that the power $7918$ is one less than the prime $7919$, look up Fermat's little theorem. This also helps for the power $7909$ which is just three greater than one less than $7907$ (if you get what I mean).
\begin{align} 892^{(7918)(7909)} &\equiv \left(892^{7918}\right)^{7909} \pmod{7919} \\ &\equiv 1^{7909} \pmod{7919} \\ &\equiv 1 \pmod{7919} \end{align}
For the modulus that is the product of two primes, look up the Chinese remainder theorem. Using that theorem, you can find the value of the expression modulo $7919$ (as I did above), find the value modulo $7907$ (for which I gave you a hint), then combine those two to get your final value.