I am studying 7th and I am having hard time with this problem. Need help. How to find the value of B in the following equation?
A=B^e mod C
Thanks in advance :-)
I am studying 7th and I am having hard time with this problem. Need help. How to find the value of B in the following equation?
A=B^e mod C
Thanks in advance :-)
One particular method works if $C$ is prime and $A$ is coprime to $C$. Then all nonzero remainders modulo $C$ make up a cyclic group, i.e. there is one generator (call it $G$) such that $1, G, G^2,\ldots,G^{C-2}$ is the set of all of those remainders, with $G^{C-1}=1$. This number is called "primitive root modulo $C$" (Cf. Wikipedia article.) There is no known algorithm for finding $G$, but it is usually found fairly quickly via trial-and-error.
Now, $A=G^i$ for some $i$, $0\le i\le C-2$ and finding $B=G^j$ such that $B^e=A$ is equivalent to finding $j$ such that $j\cdot e=i\pmod{C-1}$. Surely the bigger problem here is finding $i$, which is generally hard. However, it may happen that $A$ is already a primitive root modulo $C$, so you can take $G=A, i=1$ and the whole problem reduces to inverting $e$ modulo $C-1$.
(Side note: this method is analogous to calculating $B=A^{\frac{1}{e}}$ as $B=G^{\frac{1}{e}\log_G A}$ in $\mathbb R$, for a nicely chosen base $G$ ... sort of.)
Apart from $C$ being prime, there are other cases where the group of all invertible remainders $\pmod C$ is cyclic: when $C=2, C=4, C=p^k$ or $C=2p^k$ for an odd prime $p$ and an exponent $k\ge 1$. One can use a similar approach in those cases.