So say we have some affine cipher $C\equiv mP+n$ mod($N$). In my number theory textbook it states that in this type of cipher, $m$ and $N$ must be coprime. I am wondering why that is. The transformation could still occur even if they weren't coprime.
So why do $m$ and $N$ have to be coprime?
If $m$ is not coprime to $N$, the transformation will not be injective. For example, $P=0$ and $P=N/\gcd(m,N)$ would both produce $C=n$.