So we choose two large primes p and q and multiply them together to get n. We also pick an encryption exponent e and so for any message m, we can compute m^e (mod n) which is our ciphertext c.
So anyways, I understand (or rather, I'm familiar with) Fermat's little theorem that x^(p-1) is congruent to 1 mod p, as well as Euler's theorem, which seems to just tie together FLT and the notion that for any prime p, since there are p-1 numbers less than p that are coprime to p, $\phi(p) = p-1$
My question: since c is just m^e, then if we can find d, by solving de = 1 (mod p-1 * q-1), and then compute m by taking c^d = m^ed = m (mod n). What I don't understand is where the equation de = 1 (mod $\phi(n)$) comes from. Like why are we modding by (p-1)(q-1) instead of n?
There is a little section in my book that says the following: "when we are working mod 11 we are essentially working with the exponents mod 10, not mod 11" so I can see how that would relate to my question but I don't see the exact