I have the following equation: $y^2 \equiv r^2 \pmod n $
I know the values of y and n, I just need to find the values of r.
Assuming that $y = 12654$ and $n = 79061$, my working is as follows:
$ 12654^2$ mod $79061 = r^2$ mod $79061$
$25191 = r^2$ mod $79061$
The prime factorization of 79061 is $173*457$
Hence,
$r^2 = 25191$ mod $173$ $=>$ $106$ mod $173$
$r^2 = 25191$ mod $457$ $=>$ $56$ mod $457$
So now I have two equations,
$r^2 = 106$ mod $173$ and $r^2 = 56$ mod $457$
I am stuck here, I would appreciate if someone can help me move forward.
I've stumbled upon other similar questions where the answers show that they get rid of the squared but I cannot understand how they do it.
The equation can be rewritten as $(y-r)(y+r)=y^2 -r^2\equiv 0 \pmod n$. Now each of the two factors of $n$ must divide at least one of the factors of $y^2 -r^2$.