# Chosen-Ciphertext Attack on Rabin: Factorize n

At the end of this Wikipedia section, you can see that $$\gcd(|r-s|,n)=q$$ or $$\gcd(|r-s|,n)=p$$ holds. I don't understand why.

• Take the equations for $r$ and $s$ given above the part you reference and write out $r-s$. – yyyyyyy Dec 10 '15 at 11:56