kb/data/en.wikipedia.org/wiki/Discrete_logarithm-0.md

12 KiB
Raw Blame History

title chunk source category tags date_saved instance
Discrete logarithm 1/3 https://en.wikipedia.org/wiki/Discrete_logarithm reference science, encyclopedia 2026-05-05T11:02:07.615506+00:00 kb-cron

In mathematics, for given real numbers

    a
  

{\displaystyle a}

and

    b
  

{\displaystyle b}

, the logarithm

      log
      
        b
      
    
    
    (
    a
    )
  

{\displaystyle \log _{b}(a)}

is a number

    x
  

{\displaystyle x}

such that

      b
      
        x
      
    
    =
    a
  

{\displaystyle b^{x}=a}

. The discrete logarithm generalizes this concept to a cyclic group. A simple example is the group of integers modulo a prime number (such as 5) under modular multiplication of nonzero elements. For instance, take

    b
    =
    2
  

{\displaystyle b=2}

in the multiplicative group modulo 5, whose elements are

      1
      ,
      2
      ,
      3
      ,
      4
    
  

{\displaystyle {1,2,3,4}}

. Then:

      2
      
        1
      
    
    =
    2
    ,
    
    
      2
      
        2
      
    
    =
    4
    ,
    
    
      2
      
        3
      
    
    =
    8
    ≡
    3
    
      
      (
      mod
      
      5
      )
    
    ,
    
    
      2
      
        4
      
    
    =
    16
    ≡
    1
    
      
      (
      mod
      
      5
      )
    
    .
  

{\displaystyle 2^{1}=2,\quad 2^{2}=4,\quad 2^{3}=8\equiv 3{\pmod {5}},\quad 2^{4}=16\equiv 1{\pmod {5}}.}

The powers of 2 modulo 5 cycle through all nonzero elements, so discrete logarithms exist and are given by:

      log
      
        2
      
    
    
    1
    =
    4
    ,
    
    
      log
      
        2
      
    
    
    2
    =
    1
    ,
    
    
      log
      
        2
      
    
    
    3
    =
    3
    ,
    
    
      log
      
        2
      
    
    
    4
    =
    2.
  

{\displaystyle \log _{2}1=4,\quad \log _{2}2=1,\quad \log _{2}3=3,\quad \log _{2}4=2.}

More generally, in any group

    G
  

{\displaystyle G}

, powers

      b
      
        k
      
    
  

{\displaystyle b^{k}}

can be defined for all integers

    k
  

{\displaystyle k}

, and the discrete logarithm

      log
      
        b
      
    
    
    (
    a
    )
  

{\displaystyle \log _{b}(a)}

is an integer

    k
  

{\displaystyle k}

such that

      b
      
        k
      
    
    =
    a
  

{\displaystyle b^{k}=a}

. In arithmetic modulo an integer

    m
  

{\displaystyle m}

, the more commonly used term is index: One can write

    k
    =
    
      
        i
        n
        d
      
      
        b
      
    
    a
    
      
      (
      mod
      
      m
      )
    
  

{\displaystyle k=\mathbb {ind} _{b}a{\pmod {m}}}

(read "the index of

    a
  

{\displaystyle a}

to the base

    b
  

{\displaystyle b}

modulo

    m
  

{\displaystyle m}

") for

      b
      
        k
      
    
    ≡
    a
    
      
      (
      mod
      
      m
      )
    
  

{\displaystyle b^{k}\equiv a{\pmod {m}}}

if

    b
  

{\displaystyle b}

is a primitive root of

    m
  

{\displaystyle m}

and

    gcd
    (
    a
    ,
    m
    )
    =
    1
  

{\displaystyle \gcd(a,m)=1}

. Discrete logarithms are quickly computable in a few special cases. However, no efficient method is known for computing them in general. In cryptography, the computational complexity of the discrete logarithm problem, along with its application, was first proposed in the DiffieHellman problem. Several important algorithms in public-key cryptography, such as ElGamal, base their security on the hardness assumption that the discrete logarithm problem (DLP) over carefully chosen groups has no efficient solution, and in a general black box group lacks a subexponential solution at all.

== Definition == Let

    G
  

{\displaystyle G}

be any group. Denote its group operation by multiplication and its identity element by

    1
  

{\displaystyle 1}

. Let

    b
  

{\displaystyle b}

be any element of

    G
  

{\displaystyle G}

. For any positive integer

    k
  

{\displaystyle k}

, the expression

      b
      
        k
      
    
  

{\displaystyle b^{k}}

denotes the product of

    b
  

{\displaystyle b}

with itself

    k
  

{\displaystyle k}

times:

      b
      
        k
      
    
    =
    
      
        
          
            b
            ⋅
            b
            ⋅
            …
            ⋅
            b
          
          ⏟
        
      
      
        k
        
        
          factors
        
      
    
    .
  

{\displaystyle b^{k}=\underbrace {b\cdot b\cdot \ldots \cdot b} _{k\;{\text{factors}}}.}

Similarly, let

      b
      
        
        k
      
    
  

{\displaystyle b^{-k}}

denote the product of

      b
      
        
        1
      
    
  

{\displaystyle b^{-1}}

with itself

    k
  

{\displaystyle k}

times. For

    k
    =
    0
  

{\displaystyle k=0}

, the

    k
  

{\displaystyle k}

th power is the identity:

      b
      
        0
      
    
    =
    1
  

{\displaystyle b^{0}=1}

. Let

    a
  

{\displaystyle a}

also be an element of

    G
  

{\displaystyle G}

. An integer

    k
  

{\displaystyle k}

that solves the equation

      b
      
        k
      
    
    =
    a
  

{\displaystyle b^{k}=a}

is termed a discrete logarithm (or simply logarithm, in this context) of

    a
  

{\displaystyle a}

to the base

    b
  

{\displaystyle b}

. One writes

    k
    =
    
      log
      
        b
      
    
    
    a
  

{\displaystyle k=\log _{b}a}

.

== Examples ==

=== Powers of 10 === The powers of 10 are

    …
    ,
    0.001
    ,
    0.01
    ,
    0.1
    ,
    1
    ,
    10
    ,
    100
    ,
    1000
    ,
    …
    .
  

{\displaystyle \ldots ,0.001,0.01,0.1,1,10,100,1000,\ldots .}

For any number

    a
  

{\displaystyle a}

in this list, one can compute

      log
      
        10
      
    
    
    a
  

{\displaystyle \log _{10}a}

. For example,

      log
      
        10
      
    
    
    
      10000
    
    =
    4
  

{\displaystyle \log _{10}{10000}=4}

, and

      log
      
        10
      
    
    
    
      0.001
    
    =
    
    3
  

{\displaystyle \log _{10}{0.001}=-3}

. These are instances of the discrete logarithm problem. Other base-10 logarithms in the real numbers are not instances of the discrete logarithm problem, because they involve non-integer exponents. For example, the equation

      log
      
        10
      
    
    
    
      53
    
    =
    1.724276
    …
  

{\displaystyle \log _{10}{53}=1.724276\ldots }

means that

      10
      
        1.724276
        …
      
    
  

{\displaystyle 10^{1.724276\ldots }}

. While integer exponents can be defined in any group using products and inverses, arbitrary real exponents, such as this 1.724276…, require other concepts such as the exponential function. In group-theoretic terms, the powers of 10 form a cyclic group

    G
  

{\displaystyle G}

under multiplication, and 10 is a generator for this group. The discrete logarithm

      log
      
        10
      
    
    
    a
  

{\displaystyle \log _{10}a}

is defined for any

    a
  

{\displaystyle a}

in

    G
  

{\displaystyle G}

.

=== Powers of a fixed real number === A similar example holds for any non-zero real number

    b
  

{\displaystyle b}

. The powers form a multiplicative subgroup

    G
    =
    {
    …
    ,
    
      b
      
        
        2
      
    
    ,
    
      b
      
        
        1
      
    
    ,
    1
    ,
    
      b
      
        1
      
    
    ,
    
      b
      
        2
      
    
    ,
    …
    }
  

{\displaystyle G=\{\ldots ,b^{-2},b^{-1},1,b^{1},b^{2},\ldots \}}

of the non-zero real numbers. For any element

    a
  

{\displaystyle a}

of

    G
  

{\displaystyle G}

, one can compute

      log
      
        b
      
    
    
    a
  

{\displaystyle \log _{b}a}

.