Score:0

Higher least significant bits with larger multiple of 2 order

ru flag

If order of the cyclic group on which discrete logarithm is done is $2q$ where $q$ is a prime such that $2q+1$ is a prime, then using square root identification we can get the lsb.

How about if the order is $2^rq$ where $r\in\mathbb Z_{\geq1}$, can we extract the least significant $r$ bits in polynomial time? If so, then what is the procedure?

Score:1
my flag

If order of the cyclic group on which discrete logarithm is done is $2q$ where $q$ is a prime such that $2q+1$ is a prime, then using square root identification we can get the lsb.

Two things:

  • That's true only if the 'base' your compute the discrete log on is a quadratic nonresidue (for example, a generator). If your case is, say, 4 (which is obviously not a quadratic nonresidue to any base), then computing whether $4^x$ is a quadratic residue will reveal nothing about $x$.

  • This remains true no matter if $q$ is prime or not.

How about if the order is $2^rq$ where $r\in\mathbb Z_{\geq1}$, can we extract the least significant $r$ bits in polynomial time?

You sure can! (assuming, of course, the base cooperates; for now, I'll assume that value $g$ is a generator of the entire group).

The most straight-forward way to proceed is to use the general property that if $s | p-1$, then a value $x$ is within the subgroup of size $s$ iff $x^{s} = 1$

So, if we are given $x = g^y$ (for some unknown $y$), and we want to determine whether $y \equiv k \pmod {2^r}$, then we just compute

$$(x \cdot g^{-k}) ^ {q}$$

That is 1 iff $y \equiv k \pmod {2^r}$

And, if $r$ is so huge to make going through the possibilities prohibitive, it is easy to break up the problem into smaller chunks (and I'll leave how to do that as an exercise for the reader).

Here's how it works, the value $y-k \equiv 0 \pmod {2^r}$ iff the lower $r$ bits of $y$ are precisely $k$. In addition, the value $g^{y-k}$ is a member of the subgroup of size $q$ iff $y-k \equiv 0 \pmod {2^r}$, and by the general property, that can be tested by checking $(g^{y-k})^q$.

(Actually, this can be converted into a way to extract one bit at a time; that would be more efficient - I found this approach the easiest way to explain it)

This extends in the obvious way if $p-1$ has small odd factors...

Turbo avatar
ru flag
I am interested in extracting one bit at a time. Could you explain that too?
poncho avatar
my flag
@Turbo: here's the general procedure: compute $x^{(p-1)/2} \bmod p$, that will be either 1 or $p-1$ (that gives you the lsbit of $y$, either 0 or 1. If it is $p-1$, replace $x$ with $x \cdot g^{-1}$ (effectively subtracting 1 from $y$), and then replace $x$ with $\sqrt{x} \bmod p$ (which will always exist); this effectively divides $y$ by 2. Then, test the lsbit of the current $y$ (which is the second bit of the original). You can repeat this $r$ times to read out all $r$ lsbits. That said, unless $r$ is large, the above procedure (which doesn't involve squareroot computations) is easier
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.