Suppose I have:
y = b^x mod p
and I also know the values of b, x and p, and p is also prime.
Is there a closed-form way to find z such that y^z = b mod p?
Suppose I have:
y = b^x mod p
and I also know the values of b, x and p, and p is also prime.
Is there a closed-form way to find z such that y^z = b mod p?
Note: The following is actually the algorithm assuming $b$ is unknown. It will find an answer for $z$ under the assumption that $x$ and $p-1$ are relatively prime (which is a necessary and sufficient condition for unknown $b$). To see how knowledge of $b$ can change the problem, see the first comment to this post.
Note that $$b \equiv y^z \equiv b^{xz} \pmod{p}$$ which is true if $$xz \equiv 1 \pmod{(p-1)}$$ which can in turn be solved for $z$ relatively efficiently by the extended euclidean algorithm.