15 minutes read

We know that most public cryptosystems are based on hard computational problems. One of them is the discrete logarithm problem. Let's find out about it.

The general statement

Suppose we have some finite cyclic group GG, written multiplicatively. Let's recall that a cyclic group means that there is an element gg called a generator, such that every element hh of the group is some power of gg: h=gxh = g^{x}. So, a cyclic group of order nn (containing nn elements) looks like

G={g,g2,g3,,gn1,gn=e}G = \{g, g^{2}, g^{3}, \ldots, g^{n-1}, g^{n} =e\}When we work with real numbers, the power to which we have to raise a real number bb to produce a real number tt, is called the logarithm of tt to base bb and denoted as logbt\log_{b}t. We can also refer to it as a discrete logarithm of hh (to base gg) and write this as x=logghx = \log_{g}h.

You can notice that, if gx=hg^{x} = h in GG, then also gx+n=gxgn=hg^{x + n} =g^{x} \cdot g^{n} = h. So, if we want the discrete logarithm of hh (to base gg) to be unique, we should refine the definition a bit:

Definition. Let GG be a cyclic group with a generator gg. The discrete logarithm of hGh \in G to base gg is the least non-negative integer xx such that

h=gxh = g^{x}The question is: can we efficiently find this discrete logarithm xx, knowing gg and hh?

The word "efficiently" is crucial here. No doubt we can begin to patiently check all possible powers, computing gzg^{z} for z=0,1,2,3z = 0, 1, 2, 3 \ldots and comparing the result to xx. Sooner or later, we'll encounter our xx (remember that gg is a generator). But it can be later rather than sooner. For a huge group GG and an unlucky choice of hh, thousands of years may pass before we'll find xx through this trial-and-error process.

Do we know an efficient algorithm for the problem of finding the discrete logarithm (which is called the discrete logarithm problem, or simply DLP)? It depends on the group GG.

When DLP is easy

The first example of a finite cyclic group is (Zm,+)(\mathbb{Z}_{m}, +) integers modulo mm with respect to addition. We can write its elements as 0,1,,m1\overline{0}, \overline{1}, \ldots, \overline{m - 1} or as 0modm,1modm,,(m1)modm0 \bmod m, 1 \bmod m, \ldots, (m-1) \bmod mSince in this topic we will often switch between different values of mm, we will prefer the second form of notation, although it may seem cumbersome.

For every mm, g=1modmg = 1 \bmod m is a generator in Zm\mathbb{Z}_{m} every other element hmodmh \bmod m of this group can be presented as a sum of hh instances of gg.

For example, if m=100m = 100 and h=19h = 19, we immediately notice that h=19g=g+g++g19 timesh = 19g = \underbrace{g + g + \ldots + g}_{19 \text{ times}} and can conclude that loggh=19\log_{g}h = 19.

Of course, finding a logarithm in Z100\mathbb{Z}_{100} is especially easy with g=1mod100g = 1 \bmod 100. But even if we chose another generator for (Z100,+)(\mathbb{Z}_{100}, +), say, g=3mod100g = 3 \bmod 100 or g=69mod100g = 69 \bmod 100, the discrete logarithm problem wouldn't become much harder. In fact, for any m,g,hm, g, h, finding loggh\log_{g}h in (Zm,+)(\mathbb{Z}_{m}, +) requires just solving a congruence

hxg(modm)h \equiv xg \pmod mIt can can be done efficiently using extended Euclid's algorithm.

When DLP is hard

We considered (Z100,+)(\mathbb{Z}_{100}, +) as an example above. Now let's look at another cyclic group of the same order:

(Z101,)(\mathbb{Z}^{*}_{101}, \cdot)It is the group of non-zero integers modulo 101 with respect to multiplication, and it's also cyclic. The last claim is certainly not obvious and follows from the theory of finite fields. In fact, for any prime number pp (Zp,)(\mathbb{Z}^{*}_{p}, \cdot)is a cyclic group of order p1p-1, that is, all its p1p-1 elements are powers of some gg. For p=101p = 101 you can take, for instance, g=3mod101g = 3 \bmod 101 as a generator (but there are other elements that can play this role).

Now, what is log3hlog_{3}h for some hZ101h \in \mathbb{Z}^{*}_{101} say, h=19h = 19? It's an integer xx such that

193x(mod101)19 \equiv 3^{x} \pmod {101}For Z101\mathbb{Z}^{*}_{101}, you can just check all possible xx's using your computer (you have to try only xx's from 1 to 100). But what about finding a discrete logarithm in Zp\mathbb{Z}^{*}_{p} if pp is really huge? It turns out there is no efficient (that is, requiring a reasonable amount of time) algorithm to solve such congruences. To be more precise, nobody has invented this algorithm, as well as nobody has proved it doesn't exist. But nonetheless, the lack of known efficient algorithms for DLP in Zp\mathbb{Z}^{*}_{p} gives an opportunity to build some cryptographic protocols.

To be more concrete about inefficiency of the currently known algorithms, we can say that for now, discrete logarithm computation in Zp\mathbb{Z}^{*}_{p} for 795-bit pp (not so long a number, in fact roughly 240 decimal digits) is considered a record.

There are other groups where the discrete logarithm problem is hard, and some cryptographic protocols initially developed for Zp\mathbb{Z}^{*}_{p} can be modified to work with such groups. An especially interesting example or, rather, a range of examples is provided by so-called elliptic curves (google these words if you're not afraid to see how abstract algebra meets geometry!)

An important point is that in a group GG with known generator gg, we can quickly find h=gxh = g^{x} if we know xx. But the recovery of xx from known gg and hh becomes in a suitable GG a hard problem. The cases when a problem has an efficient algorithm, but the inverse problem has none, are loved by cryptographers. An honest user of a cryptosystem has to solve an easy problem, while the adversary has to crack the hard inverse.

Conclusion

  • The discrete logarithm problem (DLP) in a finite group with the generator gg consists in finding the least non-negative integer xx, such that gxg^{x} is equal to a given hh.

  • There are some groups, for which we can solve DLP efficiently.

  • But in the general case, and, in particular, in Zp\mathbb{Z}^{*}_{p} for a prime pp, DLP is considered a hard problem, for which no one knows an effective algorithm.

  • It is not proven yet that the effective algorithm can't exist. But all efforts to find such an algorithm haven't been fruitful so far.

  • It's easy to raise an element of a cyclic group to some known power, but it's hard to find the discrete logarithm. This allows to build some cryptographic protocols.

4 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo