$a$ has a square root modulo $p$ if and only if its discrete logarithm log$_{g}(a)$ modulo $p - 1$ is even

2.3k Views Asked by At

Questions: Let $p$ be an odd prime and let $g$ be a primitive root modulo $p$. Prove that $a$ has a square root modulo $p$ if and only if its discrete logarithm log$_{g}(a)$ modulo $p - 1$ is even.

This is the proof I've come up with. Could you please take a look at it and point out any weaknesses that I would need to correct?

Proof: Let $p$ be an odd prime and let $g$ be a primitive root modulo $p$. Let log$_{g}(a)(mod \ p-1)$ be even and $b^2 = a$. Then, $g^{2k} = a$, for some $k \in Z$. This implies $g^{k} = b$ since $b^2 = a$. Hence, $a$ has a square root modulo $p$ if log$_{g}(a)(mod \ p-1)$ is even. Conversely, let $b^{2} = a(mod \ p)$. Then, $k =$ log$_{g}(b)(mod \ p)$, for $k \in [1, 1-p]$. We have $g^{2k} = b^{2} = a$. Let $2k = n(p-1) + m$, for $n \in K$ and $m \in [1, 1-p]$. Then, $g^{m} = g^{2k - n(p-1)} = g^{2k}/g^{n(p-1)} \rightarrow g^{2k}/1 = g^{2k}$. This implies $g^{2k} \equiv a(mod \ p) \rightarrow$ log$_{g}(a) = m$. Since we have $m = 2k - n(p-1)$, we see that $k$ and $p-1$ are even so this implies that $m$ is even as well. Hence, log$_{g}(a)(mod \ p-1)$ is even if $a$ has a square root modulo $p$. Therefore, $a$ has a square root modulo $p$ if and only if its discrete logarithm log$_{g}(a)$ modulo $p - 1$ is even. QED

1

There are 1 best solutions below

1
On

The second part looks alright; only it should be "we see that $2k$ and $p-1$ are even" and also $[1,1-p]$ should be $[1,p-1]$ or in fact $[0,p-1]$.

For the first, at the start you assume both that there is a square root and that the logarithm is even. This is not correct. Instead assume just that it is even and show the $b$ you want thus exists. You basically do this; it is $g^k$.