For equation $B^e \bmod M = X$, if all values except exponent $e$ are known, can an $e$ value that works be efficiently found?
I suppose if a low value of $M$ is used, it might be quite easy. But, what if $M$ could be extremely large? Would there still be an efficient way, to find an $e$ value that satisfies the equation?
Here's how I would go about it:
Definition of mod
$$B^e\equiv X\mod M\iff B^e=Mz+X\tag{1}$$
Now here's the thing you can give other versions of this, that will help later on:
$$B^e\equiv X\mod M\iff B^e-Mz=X\tag{1.1}$$ $$B^e\equiv X\mod M\iff B^e-X=Mz\tag{1.2}$$
Parity arguments show the following:
More generally, mod some value $p$ :
ex.
$\text{RSA 129}=11438162575788886766923577997614661201021829672124236256256184293\\ 5706935245733897830597123563958705058989075147599290026879543541$
without using it's known factorization I'll pick a value to raise to a large exponent :
$B=21806107020153883717 %e=95265861131261374403$ $B^e\equiv\\ 465582739100135667877678674908247905157690272448726064526691925293304506566\\59160707291360021700048766504679931475355766192192353 \pmod {\text{RSA 129}}$
Okay a few things, both $B$ and $X$ are odd, that tells me the $z$ value, is even because $\text{RSA 129}$ is also odd. In fact they are congruent mod 4,3,and 23 under $2^{30}$ so $z$ is divisible by 276. Now one other rule, is that if $X$ isn't a power the normal integers in general, that $e$ is at least the ceiling of the normal logarithm base $B$ of $M$. In that case, it's definitely at least 7; so not much help but some. That together with the previous fact, brings our $z$ to a minimum of 20497140. Not too shabby.
$$X\equiv 1097299953583374764\pmod B$$ $$M\equiv 5996405295634794488\pmod B$$
We can also work from the fact that $B^e$ is $0 \pmod B$ to get $Mz\equiv -X\pmod B$ in PARI GP, that gives us back $z\equiv 8804812713198121952\pmod B$ which only has a factor of 276 if $B$ is multiplied by a number that is $88 \pmod {276}$ so we get $z\equiv 1927742230486739889048 \pmod {6018485537562471905892}$ This is better, to say the least. in fact this raises our minimum to $8$. It's still slow, but we got on the correct track as far as size of $z$ shown is concerned.