[step:Apply the multiple-of-totient factoring theorem with $r$ random witnesses]With $m = 2^a b$ in hand, we invoke the [Factoring from a Multiple of the Totient](/theorems/???) theorem, whose hypothesis is precisely: $N = pq$ with $p, q$ distinct odd primes, and $m$ a positive multiple of $\phi(N)$ with $m = 2^a b$, $b$ odd, $a \ge 1$. Both hypotheses are verified: $N = pq$ is the RSA modulus by construction, and $m = de - 1$ is a multiple of $\phi(N)$ by the previous step, with $a \ge 1$ since $4 \mid \phi(N) \mid m$.
The theorem states: for $x$ chosen uniformly at random from $(\mathbb{Z}/N\mathbb{Z})^\times$, the algorithm
\begin{align*}
&\text{compute } y_0 := x^b \bmod N, \\
&\text{for } i = 1, \dots, a: \; y_i := y_{i-1}^2 \bmod N, \\
&\text{if any } y_i = 1 \text{ with } y_{i-1} \ne \pm 1, \text{ return } \gcd(y_{i-1} - 1, N)
\end{align*}
produces a non-trivial factor of $N$ with probability at least $1/2$ over the choice of $x$.
Our extractor runs this procedure for $r$ independent draws $x_1, \dots, x_r$ from $(\mathbb{Z}/N\mathbb{Z})^\times$. (Drawing uniformly from $(\mathbb{Z}/N\mathbb{Z})^\times$ is done by drawing uniformly from $\{1, \dots, N - 1\}$ and rejecting if $\gcd(x, N) > 1$; since $|(\mathbb{Z}/N\mathbb{Z})^\times| = \phi(N) \ge N - p - q + 1$ and $p, q \le \sqrt{N}$ are both large, rejection occurs with negligible probability and in fact exposes a factor of $N$ directly.)[/step]