Found $a^2\equiv b^2(\mod RSA\_1024)$ What are the chances?

126 Views Asked by At

Due to the size of the numbers, I am writing them as a code. Below are $a$ and $b$

a=80278846025207087253812813084693650646782549588152274634862232723618413462835355627661425057154718817646203036787361789019154978426688179631727879117849293572

b=135066410865995223349603216278805969938881475605667027524485143851526510604859533833940287150571909441798207282164471551373680419703964191743046496589193977393315813777129389297288265075115575960054958289438639275463892263131793849936024104418058782035233213340541172117090595565908311631518329098119041633991

$$a\ne b(\mod{RSA\_1024})$$ $$a^2 \equiv b^2(\mod{RSA\_1024})$$

Before continue reading the question you may want to stop now and go check those numbers by your self.

Here the link to wiki

RSA_1024=13506641086599522334960321627880596993888147560566702752448514385152651060 48595338339402871505719094417982072821644715513736804197039641917430464965 89274256239341020864383202110372958725762358509643110564073501508187510676 59462920556368552947521350085287941637732853390610975054433499981115005697 7236890927563


How ever after looking closely you will soon find out that: $gcd(a-b,RSA\_1024) = RSA\_1024$

I made an observation and experimentally found out that $f(x)$ values will repeat $4$ times in each interval of $kN-(k-1)N$ for some integer $k > 1$, unless $x = q$ as defined below.

$$N = qr$$ $$f(x)=x^2\mod{N}$$

Where $q,r$ are big prime numbers and $q<r$.

I have been partially able to explain those repitations:

$$f(x) = x^2 \mod N = (N-x)^2 \mod N$$

Because

$$(N-x)^2=N^2-2Nx+x^2=N(N+2x)+x^2=x^2(\mod{N})$$

This is how I constructed the $a$ and $b$ values above, this means that the values will repeat for $x>\frac{N}{2}$

If you will find a repetition in the range of $0<x<\frac{N}{2}$, another one will be in the range of $\frac{N}{2}<x<N$ due to the reason just mentioned. Each time that I found such a repitition in the range of $0<x<\frac{N}{2}$, I been able to factor $N$, so I think it's related to the ability to represent N as a difference of squeres, but I don't know how to prove that each value in $f(x)$ can be part of that difference.

So assuming it is true, it makes it easy to find the second kind of repitition that leads to factoring of $N$. Earlier I found an easy way to find $f(x)$ that is smaller then $\sqrt{N}$ by looking into $f_{min}(X)$

$$f_{min}(x)=\lceil\sqrt{xN}\rceil)$$

Many $f(f_{min}(x))$ values will be smaller then $\sqrt{N}$, and since we know that all the square values smaller then $\sqrt{N}$ belong to $f(x)$ it means that they apear exactly once in the range of $0<x<\sqrt{N}$ and they also must repeat exactly once in the range of $\sqrt{N}<x<\frac{N}{2}$

So by examinig $f(f_{min}(x))$ in the range of $\sqrt{N}<f_{min}(x)<\frac{N}{2}$ there is a big chance to get a perfact squre.

By experiment I saw that there are about $\frac{N}{4}$ values of $f_{min}(x)$ that is in the range. It means that there is a chance of $1:\frac{N}{4\sqrt{N}}$

How ever in experinet I saw much better resutls, the chance was more like $1:N^{\frac{1}{4}}$ it could be due to $f_{min}$ not been a linear function, it has bigger gapes for smaller values of $x$ and so the change is incrissed.

Any way this is my bottom line, my question is: What are the chances factoring $N$ this way?