We now consider cd=med=mnecessary for the successful description of an RSA ciphertext. The core of this result is due to which states
aϕ(n)≡1modn for all coprime integers (a,n) and ϕ(n) is .
From the definition of the protocol, we have that
ed≡1modϕ(n),⇒ed=1+kϕ(n) for some k∈Z. Combining this with Euler's theorem, we see that we recover mfrom the ciphertext
cd≡(me)d≡med≡mkϕ+1≡mkϕm≡(mϕ)km≡1km≡mmodnmodnmodnmodnmodnmodnmodn When the requirement gcd(m,n)=1does not hold, we can instead look at the equivalences modulo pand qrespectively. Clearly, when gcd(m,n)=n,we have that c≡m≡0modnand our correctness still holds. Now, consider the case m=k⋅p,where we have that c≡m≡0modpand cd≡(me)d(modq).Since we have already excluded the case that gcd(m,q)=q,we can conclude that gcd(m,q)=1,as qis prime. This means that mℓϕ(q)≡1modqand by the multiplicative properties of the ϕfunction, we determine that mℓnϕ(n)=mℓϕ(q)≡1modq.We conclude by invoking the Chinese Remainder theorem with