We are given: and (all mod some ), and we want .

Firstly, we want to find some pair of numbers and such that . We can try random pairs , until we find two pairs such that . Then by dividing both sides by we get . So = , and .

Now that we have , we can find by raising both sides to the power of . If does not have a unique inverse modulo , then it’s over.