Skip to content

Incorrect RC4 generation #69

@GoogleCodeExporter

Description

@GoogleCodeExporter
Looking at the current source, there's a slight issue in RC4's code. In the 
next() method:

    ...
    t = S[i];
    S[i] = S[j];
    S[j] = t;
    return S[(t+S[i])&255];

Since t is still S[i], that means the result is S[(S[i]+S[i])] - it should be 
S[(S[j]+S[i])].

Alternatively using the cached value that's:

    return S[(t+S[j])&255];

Original issue reported on code.google.com by virap...@gmail.com on 27 Nov 2011 at 6:55

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions