# RSA Encryption: What happens if n is a factor of the message M? [duplicate]

From what I have learned about RSA encryption, the message M and the modulo n must be coprime because Euler's theorem only holds for coprime numbers? for example, what happens if I choose p = 3, q = 11, n = p*q = 33, ϕ(n) = 20, e = 7, d = 3, and I choose the message M to be 66? when I try to encrypt the message : m^e mod n, i get 66^7 mod 33 which equals 0? Am i doing something wrong here, or does RSA not work when M happens to be a multiple of n?

• Well, $66\bmod 33$ also equals $0$. ;) – fkraiem Aug 3 '15 at 0:51
• $M$ must be less than $n$. – mikeazo Aug 3 '15 at 1:38