{
  "id": "2007/208",
  "url": "https://opencryptology.org/2007/208",
  "original_url": "https://eprint.iacr.org/2007/208",
  "title": "RC4 State Information at Any Stage Reveals the Secret Key",
  "authors": [
    "Goutam Paul",
    "Subhamoy Maitra"
  ],
  "affiliations": null,
  "abstract": "A theoretical analysis of the RC4 Key Scheduling Algorithm (KSA) is presented in this paper, where the nonlinear operation is swapping among the permutation bytes. Explicit formulae are provided for the probabilities with which the permutation bytes at any stage of the KSA are biased to the secret key. Theoretical proofs of these formulae have been left open since Roos' work (1995). Next, a generalization of the RC4 KSA is analyzed corresponding to a class of update functions of the indices involved in the swaps. This reveals an inherent weakness of shuffle-exchange kind of key scheduling. We additionally show that each byte of $S_N$ actually reveals secret key information. Looking at all the elements of the final permutation $S_N$ and its inverse $S^{-1}_N$, the value of the hidden index $j$ in each round of\nthe KSA can be estimated from a ``pair of values\" in $0, \\ldots, N-1$ with a constant probability of success\n$\\pi = \\frac{N-2}{N}\\cdot(\\frac{N-1}{N})^{N-1} + \\frac{2}{N}$\n(we get $\\pi \\approx 0.37$, for $N = 256$), which is significantly higher than the random association. Using the values of two\nconsecutive $j$'s, we estimate the $y$-th key byte from at most a ``quadruple of values\" in $0, \\ldots, N-1$ with a probability $> 0.12$. As a secret key of $l$ bytes is repeated at least $\\lfloor \\frac{N}{l}\\rfloor$ times in RC4, these many quadruples can be accumulated to get each byte of the secret key with very high probability (e.g., 0.8 to close to 1) from a small set of values.\nBased on our analysis of the key scheduling, we show that the secret key of RC4 can be recovered from the state information in a time much less than the exhaustive search with good probability.",
  "category": "Secret-key cryptography",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“RC4 State Information at Any Stage Reveals the Secret Key” by Goutam Paul, Subhamoy Maitra, Cryptology ePrint Archive, Paper 2007/208, https://eprint.iacr.org/2007/208. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": true,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2007-06-05T06:41:56Z",
    "updated": "2009-01-09T07:18:27Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2007/208.pdf",
    "sha256": "9b0381bb5e218ca8b927f1d49997c7bc66b3c4fbee0f4a6e679382821d24830f",
    "size": 309518,
    "source": "github-mirror",
    "source_date": "2019-02-25T16:13:43Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2007/208/versions/20190225T161343Z.pdf",
      "captured_at": "2019-02-25T16:13:43Z",
      "label": "copy captured 2019-02-25",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2007/208.pdf",
      "size": 309518,
      "sha256": "9b0381bb5e218ca8b927f1d49997c7bc66b3c4fbee0f4a6e679382821d24830f",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2007/208/versions/20070824T053451Z.pdf",
      "captured_at": "2007-08-24T05:34:51Z",
      "label": "copy captured 2007-08-24",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20070824053451id_/http://eprint.iacr.org/2007/208.pdf",
      "size": 233129,
      "sha256": "25045dd5aa91716cec96528bb757aa393fa5c8e81e743daeaed3fad437cc4dec",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260408210638id_/https://eprint.iacr.org/2007/208.pdf",
      "captured_at": "2026-04-08T21:06:38Z",
      "size": 280608
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2007/208.pdf",
      "captured_at": "2019-02-25T16:13:43Z",
      "size": 309518
    }
  ],
  "bibtex": "@misc{cryptoeprint:2007/208,\n      author = {Goutam Paul and Subhamoy Maitra},\n      title = {RC4 State Information at Any Stage Reveals the Secret Key},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2007/208},\n      year = {2007},\n      url = {https://eprint.iacr.org/2007/208}\n}"
}
