ed ≡ 1 modλ(n) stuck
Given $n=pq$ and $\forall m: m ≡ m^{ed} \bmod n$, how can we show that $ed \equiv 1 \pmod {\lambda(n)}$?


Well, the most straightforward approach is first to show that we must have both:

$$ed \equiv 1 \pmod{p-1}$$

$$ed \equiv 1 \pmod{q-1}$$

We can combine these equivalancies into one, using the Chinese Remainder Theorem; however as $p-1$ and $q-1$ are not relatively prime, we get:

$$ed \equiv 1 \pmod{\text{lcm}(p-1, q-1)}$$

This turns out to be a necessary and sufficient condition.  Sometimes, we denote $\lambda(pq) = \text{lcm}(p-1, q-1)$; you'll sometimes see this formulation.