# RSA encryption exponent

In RSA public-key material (e, N), why must the encryption exponent e be relatively prime to $\phi(N)$? Why must any public key encryption algorithm resist CPA?

why must the encryption exponent e be relatively prime to $\phi(N)$
If it's not, then the decryption will not be unique. That is, there will be multiple messages $M_1 \ne M_2$ such that $M_1^e \bmod N = M_2^e \bmod N$; hence if the decryptor receives that common value, he will not be able to determine if the original message was $M_1$ or $M_2$
For the public exponent: if $e$ is not prime to $\phi(n)$, then several distinct messages will "encrypt" to the same integer modulo $n$, and the decryption will be ambiguous. This is not good. It could be fixed by enforcing a sufficiently redundant padding so that, upon decryption, the "correct" message can be recovered (that's what happens with Rabin's cryptosystem, which uses $e = 2$, which is not prime to $\phi(n)$). However, that's cumbersome, and it is much simpler to simply require that $e$ is prime to $\phi(n)$. This makes $e$-th power exponentiation a permutation of the set of integers modulo $n$.