I am currently studying modular arithmetic for a course in cryptography. I have proved many operations, but I am stuck in one:
Assume $n,a\in \mathbb{N}$ and $n\ge 2$. Prove that if $\gcd(a,n)=1$ then:
$$a^{m \, \pmod{\varphi(n)}} \equiv a^m\pmod n$$
where $\varphi$ is the Euler function.
I am sure that I have to use the Euler theorem:
If $n,a\in \mathbb{N}$ and $n\ge 2, \gcd(a,n)=1$ then:
$$a^{\varphi(n)} \equiv 1 \pmod n$$
It may be obvious, but I cannot see it.
Thanks for your help.
If $m=d+k\varphi(n)$, then $$ a^m=a^{d}(a^{\varphi(n)})^k\equiv a^d\mod n$$ since $a^{\varphi(n)}\equiv 1 \pmod n$. And $m\equiv d \pmod{\varphi(n)}$, so this is the desired result.