1Crypt::Stream::RC4(3) User Contributed Perl DocumentationCrypt::Stream::RC4(3)
2
3
4

NAME

6       Crypt::Stream::RC4 - Stream cipher RC4
7

SYNOPSIS

9          use Crypt::Stream::RC4;
10
11          # encrypt
12          $key = "1234567890123456";
13          $stream = Crypt::Stream::RC4->new($key);
14          $ct = $stream->crypt("plain message");
15
16          # decrypt
17          $key = "1234567890123456";
18          $stream = Crypt::Stream::RC4->new($key);
19          $pt = $stream->crypt($ct);
20

DESCRIPTION

22       Provides an interface to the RC4 stream cipher.
23

METHODS

25   new
26        $stream = Crypt::Stream::RC4->new($key);
27        # $key .. length 5-256 bytes (40 - 2048 bits)
28
29   crypt
30        $ciphertext = $stream->crypt($plaintext);
31        #or
32        $plaintext = $stream->crypt($ciphertext);
33
34   keystream
35        $random_key = $stream->keystream($length);
36
37   clone
38        $stream->clone();
39

SEE ALSO

41       •   Crypt::Stream::ChaCha, Crypt::Stream::Sober128,
42           Crypt::Stream::Salsa20, Crypt::Stream::Sosemanuk
43
44       •   <https://en.wikipedia.org/wiki/RC4_cipher>
45
46
47
48perl v5.34.0                      2022-02-14             Crypt::Stream::RC4(3)
Impressum