Here :
Can the sum of two squares be used to factor large numbers?
an idea to factor a large number $N=a^2+b^2$ is shown.
Under which conditions does a representation $$N^2=u^2+v^2$$ exist , such that $\gcd(N,\gcd(u,v))$ is a non-trivial factor of $N$ ?
I guess this is the case, when $N$ has at least one prime factor of the form $4k+1$ and is not a prime power, but I am not sure whether this is true and how it can be proven.