{
  "aliases": [
    "index"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "01TKKESHSB"
    }
  ],
  "body": "\n## Definition\n\nLet $G$ be a finite cyclic [[group|G5S1M9]] of order $N$, with a generator $g$.\nFor each $h \\in G$, the discrete logarithm of $h$ to the base $g$ is the unique integer $k$ with $0 \\le k \u003c N$ such that $g^k = h$.\nThe notation is $k = \\log_g h$.\n\n## Remarks\n\nIn elementary number theory, $G = (\\mathbb{Z}/n\\mathbb{Z})^\\times$ and $g$ is a [[primitive root|0KM2CJ80G7]] modulo $n$. Then $\\log_g a$ is also called the index of $a$, and $N = \\varphi(n)$.\nThe rule $\\log_g (h_1 h_2) \\equiv \\log_g h_1 + \\log_g h_2 \\pmod N$ holds, as for ordinary logarithms.\nFor example, $3$ is a primitive root modulo $7$, and $3^4 = 81 \\equiv 4 \\pmod 7$. So $\\log_3 4 = 4$ modulo $7$.\nNo efficient general algorithm to compute discrete logarithms is known. The [[Diffie–Hellman key exchange|01TKKESHSB]] uses this fact.\n\n## Explanations\n\n### L1 human\n\n[[Modular exponentiation|04DR5PM25N]] computes $g^k \\bmod p$ from $k$. The discrete logarithm goes back from the result to $k$.\nFor small numbers, a table of powers is enough. For numbers with hundreds of digits, the problem seems very hard.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "index"
    ],
    "defines": "0HJHYMGN3C",
    "kind": "definition",
    "msc": [
      "11A07"
    ],
    "name": "Discrete logarithm",
    "sources": [
      {
        "locator": "Definition",
        "url": "https://en.wikipedia.org/wiki/Discrete_logarithm"
      }
    ],
    "tag": "09B4X51J09",
    "uses": [
      "0KM2CJ80G7"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/09B4X51J09/",
  "links": [
    {
      "field": "defines",
      "target": "0HJHYMGN3C"
    },
    {
      "field": "uses",
      "target": "0KM2CJ80G7"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/09B4X51J09.md",
  "msc": [
    "11A07"
  ],
  "name": "Discrete logarithm",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/09B/09B4X51J09.md",
  "status": null,
  "tag": "09B4X51J09",
  "uri": "m2://09B4X51J09",
  "url": "https://math2.tamnd.com/wiki/discrete-logarithm-definition/",
  "writing": {
    "tag": "09B4X51J09",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
