9 $j = ($j + $s[$i] + ord (substr ($key, $i % length ($key), 1))) & 0xff;
10 @s[$i, $j] = @s[$j, $i];
16 my ($arc4, $buf) = @_;
17 my ($i, $j, @s) = @$arc4;
19 for my $c (split (//, $buf)) {
21 $j = ($j + $s[$i]) & 0xff;
22 @s[$i, $j] = @s[$j, $i];
23 $out .= chr (ord ($c) ^ $s[($s[$i] + $s[$j]) & 0xff]);
25 @$arc4 = ($i, $j, @s);