Computing $a^b$ (mod c) where b is a very large number

185 Views Asked by At

I've been asked to compute the value of an expression in the form of $a^b$ (mod $c$), where $a, c$ are prime and $b$ is extremely large. How would I use modular arithmetic to do so? I'm thinking that Fermat's Theorem might be helpful, but not sure how.