# how to decrypt if p=q in RSA [duplicate]

p,q should be different,but if I let p = q,and encrypt the plaintext,then I can't decrypt it,so can decrypt it?

## marked as duplicate by AleksanderRas, Ilmari Karonen, kelalaka, Squeamish Ossifrage, Ella Rose♦Jun 8 at 1:18

• if $p=q$ then $n=p^2$ and $\varphi(n)=p \cdot (p-1)$. In your example it gives $d=5^{-1} \mod 13 \cdot 12 =125$. Thus we have $76^{125} \mod 169 = 7$ – Bissi Jun 5 at 17:10