Bob and Alice want to choose a key they can use for cryptography, but all they have to communicate is a bugged phone line. Bob proposes that they each choose a secret number, $a$ for Alice and $b$ for Bob. They also choose, over the phone, a prime number $p$ with more digits than any key they want to use, and one more number $q$. Bob will send Alice $b q$ $(\bmod p)$, and Alice will send Bob aq $(\bmod p)$. Their key (which they will keep secret) will then be $a b q(\bmod p)$. (Here we don't worry about the details of how they use their key, only with how they choose it.) As Bob explains, their wire tapper will know $p, q, a q$ $(\bmod p)$, and $b q(\bmod p)$, but will not know $a$ or $b$, so their key should be safe.
Is this scheme safe, that is can the wiretapper compute $a b q \bmod p$ ? If so, how does she do it.
Alice says "You know, the scheme sounds good, but wouldn't it be more complicated for the wire tapper if I send you $q^a \quad(\bmod p)$, you send $\operatorname{me} q^b \quad(\bmod p)$ and we use $q^{a b} \quad(\bmod p)$ as our key?" In this case can you think of a way for the wire tapper to compute $q^{a b}$ $(\bmod p)$. If so, how can you do it? If not, what is the stumbling block? (It is fine for the stumbling block to be that you don't know how to compute something, you don't need to prove that you can't compute it.)