RSA solving for primes p and q knowing n = pq and p - q I was also given these:
$p+q=n-\phi(n)+1$
$p-q=\sqrt((p+q)^2-4n)$
$\phi(n)=(p-1)(q-1)$
$p>q$  
I've been trying to manipulate this as a system of equations, but it's just not working out for me. I found a similar problem on this site, but instead of $pq$ and $p-q$ being known, it had $pq$ and $\phi(pq)$, so that didn't help. The $\phi(n)$ function has never been mentioned in this class before, so I can't use any definitions of it (aside from the one given above) without proving them. Could someone please point me in the right direction here?

We have 
$$(p+q)^2=(p-q)^2+4pq.$$
Calculating the right-hand side is very cheap. Then calculating $p+q$ is cheap, a mild variant of Newton's Method.  Once we know $p+q$ and $p-q$, calculating $p$ and $q$ is very cheap.
