Solving $b^e = 1 \mod m$ for $b$

99 Views Asked by At

I would like to find small $b$ such that $$ b^e\equiv1\pmod m $$ for a given $e$ and $m$. (In my application, $m$ is the square of a prime.) How can I find such $b$? (Say, the first 10 or 100.)

I'm interested in something practical for $e$ with 10-20 digits and $m$ with 20-40 digits.

Feel free to close this as a duplicate if you can find the right question!