# RSA Inverse Multiplication

I have $$n,e$$ and $$c$$, $$p$$ and $$q$$ are prime, but $$q$$ is the inverse multiplication of $$e$$ and $$p$$ so $$q = e^{-1} \bmod p$$

How can $$i$$ get $$p$$ and $$q$$ back?

• Welcome to Cryptography.SE. What is the origin of this question? What did you try to solve up to now? – kelalaka Mar 18 at 18:47
• I looked for some properties to make it, for sure there is some trick – billst Mar 18 at 18:49
• Also, if you're referring to the standard CRT parameters, we have $dp = e^{-1} \bmod p$ and $qinv = q^{-1} \bmod p$. Are you referring to one of them? – poncho Mar 18 at 18:49
• but i dont have no one of then, i dont have d, p and q – billst Mar 18 at 18:53
• what do you have? – poncho Mar 18 at 18:58

If $$e$$ is not too large, then it is easy.
The relation $$q = e^{-1} \mod p$$ can be rearranged to $$qe = 1 + kp$$ for some integer $$k$$; or in other words, $$p/q \approx e / k$$; that is, $$p/q$$ is extremely close to a simple rational, and that makes factorization easy.
• @billst: obviously, you could try various values of $k$ (and you know that $k < e$, so there's a limited number); just checking $q \approx \sqrt{ (k/e) N }$ for the various $k$ should recover the value $q$ fairly quickly – poncho Mar 19 at 14:53