if you have x^(y*z) and you know x and z, you can compute x^y by taking the z'th root, right?
If you've got xy×z and also know x and z, you better believe you can get y out of it too. You'd usually solve it by taking the log rather than trying to fuss around with
log(M) = log(xy×z) = log(x) × y × z ∴ y = log(M) ÷ log(x) ÷ z
and you've only got one unknown in that. The thing about the discrete logarithm stuff is that it's all in a modulo-prime space that is a group and you actually send less information about than you're really claiming; only one party has enough to solve the equation you're fretting over. The math is pretty difficult for anyone who didn't do number theory () at college level, but actually does work.