The method described below is different from Euler sum of two squares factorization method. The method below does not require 2 sum of two squares representations to factor a number.
This post was inspired by the post on using the sum of two squares to determine if a number is square free (see Can the sum of two squares be used to determine if a number is square free?"). We will show below that the sum of two squares can definitely be used to factor integers. However, at this point in time, it is not known if this method is fast enough to factor large numbers (hundred digits).
We start with a simple example of $N=a^2+b^2=3*5=15$. We know that this number cannot be decomposed into a sum of two squares (2sq rep). So we square $N$ to get $N^2=M=3^2*5^2=225$. We calculate the two squares representation (2sq rep) of $M$ and find $M=9^2 + 12^2$. At this point we take the GCD of $GCD(9^2,12^2)=9$. So $9$ is a common factor and this means that $M$ can be rewritten as $M=3^2*3^2 + 3^2*4^2= 3^2*(3^2+ 4^2)=3^2*5^2$. The last step is not needed. Once a common factor is found, we know that it is a factor of M and its square root is a factor of N.
To show that the method works for an arbitrary numbers we will provide few more examples. However at this point we only consider numbers of the form $N=pq$ or numbers of the form $N=pq^2$.
Example #1. $N=7*37=259$, $N^2=259^2=67081=84^2 + 245^2$. We calculate $GCD(84^2,245^2)=7^2$. So we find that $7^2$ is a factor of $N^2$ and that $7$ is a factor of $N$.
Example #2. $N=13*17=221$, $N^2=221^2=48841=21^2 + 220^2=85^2 + 204^2= 104^2 + 195^2=140^2 + 171^2$. We calculate the GCD for each 2sq rep.
$$ \begin{split} \gcd(21^2,220^2)&=1\\ \gcd(85^2,204^2)&=289=17^2\\ \gcd(104^2,195^2)&=169=13^2\\ \gcd(140^2,171^2)&=1 \end{split} $$
We that the first and last 2sq rep give no information on the factors of $N^2$ but the 2nd and 3rd 2sq rep provide the squares of the factors of N. This example shows that the sum of two squares can factor an integer provided we consider all 2sq representations of $N^2$ since we don't know which one is going to provide us with the information on the factors.
We now provide an example where the sum of two squares does not work.
Example #3. $N=19*31=589$. This number does not have a sum of two squares. We square it to get $N^2=589^2=0^2 + 589^2$. This 2sq rep provides no information on the original factors of N.
The question is this: can the sum of two squares get the factors of $N^2$ in a reasonable amount of time?
I agree that this method cannot factor products of the form $pq=(4x-1)*(4y-1)$. That was shown in example $3$. – user25406 Jan 09 '19 at 13:22