{
    "mode": "perldoc",
    "parameter": "Crypt::Stream::RC4",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3AStream%3A%3ARC4/json",
    "generated": "2026-07-05T23:24:29Z",
    "synopsis": "use Crypt::Stream::RC4;\n# encrypt\n$key = \"1234567890123456\";\n$stream = Crypt::Stream::RC4->new($key);\n$ct = $stream->crypt(\"plain message\");\n# decrypt\n$key = \"1234567890123456\";\n$stream = Crypt::Stream::RC4->new($key);\n$pt = $stream->crypt($ct);",
    "sections": {
        "NAME": {
            "content": "Crypt::Stream::RC4 - Stream cipher RC4\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Crypt::Stream::RC4;\n\n# encrypt\n$key = \"1234567890123456\";\n$stream = Crypt::Stream::RC4->new($key);\n$ct = $stream->crypt(\"plain message\");\n\n# decrypt\n$key = \"1234567890123456\";\n$stream = Crypt::Stream::RC4->new($key);\n$pt = $stream->crypt($ct);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Provides an interface to the RC4 stream cipher.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\n$stream = Crypt::Stream::RC4->new($key);\n# $key .. length 5-256 bytes (40 - 2048 bits)\n\ncrypt\n$ciphertext = $stream->crypt($plaintext);\n#or\n$plaintext = $stream->crypt($ciphertext);\n\nkeystream\n$randomkey = $stream->keystream($length);\n\nclone\n$stream->clone();\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "*   Crypt::Stream::ChaCha, Crypt::Stream::Sober128, Crypt::Stream::Salsa20,\nCrypt::Stream::Sosemanuk\n\n*   <https://en.wikipedia.org/wiki/RC4cipher>\n",
            "subsections": []
        }
    },
    "summary": "Crypt::Stream::RC4 - Stream cipher RC4",
    "flags": [],
    "examples": [],
    "see_also": []
}