Skip to main content
Expand on why $(b-1,n)$ allows to factor $n$ when $b^2=1 \mod n$
Source Link

If you know an even $m$ such that $a^m \equiv 1 \mod n, (a,n)=1$, e.g. a multiple of $\phi(n)$ then there is a standard probabilistic algorithm to factor $n=pq$. Write $m = 2^rs$ with $s$ odd. Pick a random $a$ and compute $a^s, a^{2s}, a^{4s},\ldots$. If $a^s \ne 1 \mod n$, then at some point in the calculation, you find $b \ne 1 \mod n$ with $b^2 \equiv 1 \mod n$. If $b \ne -1 \mod n$, then, as $b^2-1=(b-1)(b+1) \mod n$, you factor $n$ by computing $(b-1,n)$. This will succeed with probability $> 1/2$, so if it fails, pick another $a$. By picking enough $a$'s, you make the probability of success as close to $1$ as you like.

If you know an even $m$ such that $a^m \equiv 1 \mod n, (a,n)=1$, e.g. a multiple of $\phi(n)$ then there is a standard probabilistic algorithm to factor $n=pq$. Write $m = 2^rs$ with $s$ odd. Pick a random $a$ and compute $a^s, a^{2s}, a^{4s},\ldots$. If $a^s \ne 1 \mod n$, then at some point in the calculation, you find $b \ne 1 \mod n$ with $b^2 \equiv 1 \mod n$. If $b \ne -1 \mod n$, then you factor $n$ by computing $(b-1,n)$. This will succeed with probability $> 1/2$, so if it fails, pick another $a$. By picking enough $a$'s, you make the probability of success as close to $1$ as you like.

If you know an even $m$ such that $a^m \equiv 1 \mod n, (a,n)=1$, e.g. a multiple of $\phi(n)$ then there is a standard probabilistic algorithm to factor $n=pq$. Write $m = 2^rs$ with $s$ odd. Pick a random $a$ and compute $a^s, a^{2s}, a^{4s},\ldots$. If $a^s \ne 1 \mod n$, then at some point in the calculation, you find $b \ne 1 \mod n$ with $b^2 \equiv 1 \mod n$. If $b \ne -1 \mod n$, then, as $b^2-1=(b-1)(b+1) \mod n$, you factor $n$ by computing $(b-1,n)$. This will succeed with probability $> 1/2$, so if it fails, pick another $a$. By picking enough $a$'s, you make the probability of success as close to $1$ as you like.

Source Link
Felipe Voloch
  • 30.5k
  • 6
  • 85
  • 151

If you know an even $m$ such that $a^m \equiv 1 \mod n, (a,n)=1$, e.g. a multiple of $\phi(n)$ then there is a standard probabilistic algorithm to factor $n=pq$. Write $m = 2^rs$ with $s$ odd. Pick a random $a$ and compute $a^s, a^{2s}, a^{4s},\ldots$. If $a^s \ne 1 \mod n$, then at some point in the calculation, you find $b \ne 1 \mod n$ with $b^2 \equiv 1 \mod n$. If $b \ne -1 \mod n$, then you factor $n$ by computing $(b-1,n)$. This will succeed with probability $> 1/2$, so if it fails, pick another $a$. By picking enough $a$'s, you make the probability of success as close to $1$ as you like.