1

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.

Mulishia
  • 11
  • 2

4 Answers4

1

You know $r^2$ modulo $p$ and $q$ (the prime factors). There we have exactly two solutions: $y$ and $-y$ modulo $p$ resp. $q$. (we have a field modulo a prime so no more then $2$).

Now the CRT now allows us to combine the $4$ pairs of solutions (corresponding to the 4 possible choices of sign) to $4$ solution modulo $n=pq$.

So e.g. solve the systems $x\equiv -y \pmod p$, $x \equiv y \pmod q$ using the CRT formula (e.g. see wiki, constructive proof) and $x\equiv y \pmod p$, $x \equiv -y \pmod q$ to get the two extra solutions besides the already known solutions $y$ and $-y \pmod{n} \equiv n-y$.

Henno Brandsma
  • 242,131
  • Thanks for your input, I am aware that I have to use CRT in the end but my issue is how to get rid of the squared. Unfortunately I didn't understand your first part very well and I also think I didn't explain my question well enough as well.

    Basically my equation is similar to the answer in the following link https://math.stackexchange.com/a/335181/628342.

    I am stuck at this part: https://i.imgur.com/D7fENFp.png.

    I have no idea how he got rid of the squared and how the right hand side number became +-3. That's what I'm trying to understand.

    – Mulishia Dec 22 '18 at 13:11
  • @Mulishia The difference is that you are already given a solution, and the quoted question started with no info. You already know that $\pm y \pmod{p}$ are the solutions to $x^2 \equiv r^2 \pmod{p}$ while otherwise you have to solve an equation $x^2 \equiv a \pmod{p}$ from scratch. A solution existence can be checked with Lagrange symbols, a concrete solution from trial and error or knowing a generator for $\mathbb{Z}_p$ etc. – Henno Brandsma Dec 22 '18 at 22:50
  • @Mulishia some general theory on this can be found here e.g. But note that you don't need it, really, as you're given $y$ already. – Henno Brandsma Dec 22 '18 at 22:54
  • @Mulishia You can continue with this answer where I completely solve an analogous example. – Bill Dubuque Dec 25 '18 at 20:15
1

Similar to 'random' comment we have:

$(y-r)(y+r)≡0\mod n$

$n=79061=173\times457$

Following cases can be considered:

a: $y-r=173$$r=y-173=12654-173=12421$

b: $y+r=173$$r=173-12654=-12421$

And we have:

$ 12654^2-(±12421)^2=55\times 79061$

c: $y-r=457$$r=12654+457=13111$

d: $y+r=457$$r=-13111$

And we have:

$12654^2-13111^2=148.93...\times79061$

So $r= ±12421$ is acceptable.

sirous
  • 10,751
0

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$.

random
  • 836
0

$$ 12654^2 - (91542 - 79061 m)^2 = 79061 (-79061 m^2 + 183084 m - 103968) $$ $$ r=91542 - 79061 m $$

S. I.
  • 26