{
  "id": "2021/645",
  "url": "https://opencryptology.org/2021/645",
  "original_url": "https://eprint.iacr.org/2021/645",
  "title": "Legendre PRF (Multiple) Key Attacks and the Power of Preprocessing",
  "authors": [
    "Alexander May",
    "Floyd Zweydinger"
  ],
  "affiliations": null,
  "abstract": "Due to its amazing speed and multiplicative properties the Legendre PRF recently finds widespread applications e.g. in Ethereum 2.0, multiparty computation and in the quantum-secure signature proposal LegRoast. However, its security is not yet extensively studied.\n\nThe Legendre PRF computes for a key $k$ on input $x$ the Legendre symbol $L_k(x) = \\left( \\frac {x+k} {p} \\right)$ in some finite field $\\F_p$. As standard notion, PRF security is analysed by giving an attacker oracle access to $L_k(\\cdot)$. Khovratovich's collision-based algorithm recovers $k$ using $L_k(\\cdot)$ in time $\\sqrt{p}$ with constant memory. It is a major open problem whether this birthday-bound complexity can be beaten.\n\nWe show a somewhat surprising wide-ranging analogy between the discrete logarithm problem and Legendre symbol computations. This analogy allows us to adapt various algorithmic ideas from the discrete logarithm setting.\n\nMore precisely, we present a small memory multiple-key attack on $m$ Legendre keys $k_1, \\ldots, k_m$ in time $\\sqrt{mp}$, i.e. with amortized cost $\\sqrt{p/m}$ per key. This multiple-key attack might be of interest in the Ethereum context, since recovering many keys simultaneously maximizes an attacker's profit.\n\nMoreover, we show that the Legendre PRF admits precomputation attacks, where the precomputation depends on the public $p$ only -- and not on a key $k$. Namely, an attacker may compute e.g. in precomputation time $p^{\\frac 2 3}$ a hint of size $p^{\\frac 1 3}$. On receiving access to $L_k(\\cdot)$ in an online phase, the attacker then uses the hint to recover the desired key $k$ in time only $p^{\\frac 1 3}$. Thus, the attacker's online complexity again beats the birthday-bound.\n\nIn addition, our precomputation attack can also be combined with our multiple-key attack. We explicitly give various tradeoffs between precomputation and online phase. E.g. for attacking $m$ keys one may spend time $mp^{\\frac 2 3}$  in the precomputation phase for constructing a hint of size $m^2 p^{\\frac 1 3}$. In an online phase, one then  finds {\\em all $m$ keys in total time} only $p^{\\frac 1 3}$.\n\nPrecomputation attacks might again be interesting in the Ethereum 2.0 context, where keys are frequently changed such that a heavy key-independent precomputation pays off.",
  "category": "Public-key cryptography",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Legendre PRF (Multiple) Key Attacks and the Power of Preprocessing” by Alexander May, Floyd Zweydinger, Cryptology ePrint Archive, Paper 2021/645, https://eprint.iacr.org/2021/645. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": true,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2021-05-20T20:24:53Z",
    "updated": "2021-09-17T13:44:56Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2021/645.pdf",
    "sha256": "1326a738a1606d3f6e45de77899b6a2d609e94d161528a8578f24bf8f468ef5b",
    "size": 654081,
    "source": "github-mirror",
    "source_date": "2024-01-14T06:13:28Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2021/645/versions/20240114T061328Z.pdf",
      "captured_at": "2024-01-14T06:13:28Z",
      "label": "copy captured 2024-01-14",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2021/645.pdf",
      "size": 654081,
      "sha256": "1326a738a1606d3f6e45de77899b6a2d609e94d161528a8578f24bf8f468ef5b",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2021/645/versions/20210705T030731Z.pdf",
      "captured_at": "2021-07-05T03:07:31Z",
      "label": "copy captured 2021-07-05",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20210705030731id_/https://eprint.iacr.org/2021/645.pdf",
      "size": 654343,
      "sha256": "6f3b78bf326ed7bc3a87195cf648974b0ace3a75787d6f6a49df3fd0922ddba4",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260226071003id_/https://eprint.iacr.org/2021/645.pdf",
      "captured_at": "2026-02-26T07:10:03Z",
      "size": 655014
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2021/645.pdf",
      "captured_at": "2024-01-14T06:13:28Z",
      "size": 654081
    }
  ],
  "bibtex": "@misc{cryptoeprint:2021/645,\n      author = {Alexander May and Floyd Zweydinger},\n      title = {Legendre PRF (Multiple) Key Attacks and the Power of Preprocessing},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2021/645},\n      year = {2021},\n      url = {https://eprint.iacr.org/2021/645}\n}"
}
