<s>
In	O
cryptography	O
,	O
RC4	B-Algorithm
(	O
Rivest	O
Cipher	O
4	O
,	O
also	O
known	O
as	O
ARC4	B-Algorithm
or	O
ARCFOUR	B-Algorithm
,	O
meaning	O
Alleged	O
RC4	B-Algorithm
,	O
see	O
below	O
)	O
is	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
.	O
</s>
<s>
While	O
it	O
is	O
remarkable	O
for	O
its	O
simplicity	O
and	O
speed	O
in	O
software	O
,	O
multiple	O
vulnerabilities	O
have	O
been	O
discovered	O
in	O
RC4	B-Algorithm
,	O
rendering	O
it	O
insecure	O
.	O
</s>
<s>
It	O
is	O
especially	O
vulnerable	O
when	O
the	O
beginning	O
of	O
the	O
output	O
keystream	B-Algorithm
is	O
not	O
discarded	O
,	O
or	O
when	O
nonrandom	O
or	O
related	O
keys	O
are	O
used	O
.	O
</s>
<s>
Particularly	O
problematic	O
uses	O
of	O
RC4	B-Algorithm
have	O
led	O
to	O
very	O
insecure	O
protocols	O
such	O
as	O
WEP	B-Protocol
.	O
</s>
<s>
,	O
there	O
is	O
speculation	O
that	O
some	O
state	O
cryptologic	O
agencies	O
may	O
possess	O
the	O
capability	O
to	O
break	O
RC4	B-Algorithm
when	O
used	O
in	O
the	O
TLS	B-Protocol
protocol	I-Protocol
.	O
</s>
<s>
IETF	O
has	O
published	O
RFC	O
7465	O
to	O
prohibit	O
the	O
use	O
of	O
RC4	B-Algorithm
in	O
TLS	B-Protocol
;	O
Mozilla	B-Operating_System
and	O
Microsoft	O
have	O
issued	O
similar	O
recommendations	O
.	O
</s>
<s>
A	O
number	O
of	O
attempts	O
have	O
been	O
made	O
to	O
strengthen	O
RC4	B-Algorithm
,	O
notably	O
Spritz	O
,	O
RC4A	O
,	O
VMPC	B-Algorithm
,	O
and	O
RC4+	O
.	O
</s>
<s>
RC4	B-Algorithm
was	O
designed	O
by	O
Ron	O
Rivest	O
of	O
RSA	O
Security	O
in	O
1987	O
.	O
</s>
<s>
While	O
it	O
is	O
officially	O
termed	O
"	O
Rivest	O
Cipher	O
4	O
"	O
,	O
the	O
RC	O
acronym	O
is	O
alternatively	O
understood	O
to	O
stand	O
for	O
"	O
Ron	O
's	O
Code	O
"	O
(	O
see	O
also	O
RC2	B-Algorithm
,	O
RC5	B-Algorithm
and	O
RC6	B-Algorithm
)	O
.	O
</s>
<s>
RC4	B-Algorithm
was	O
initially	O
a	O
trade	O
secret	O
,	O
but	O
in	O
September	O
1994	O
,	O
a	O
description	O
of	O
it	O
was	O
anonymously	O
posted	O
to	O
the	O
Cypherpunks	O
mailing	O
list	O
.	O
</s>
<s>
It	O
was	O
soon	O
posted	O
on	O
the	O
sci.crypt	B-General_Concept
newsgroup	B-Application
,	O
where	O
it	O
was	O
broken	O
within	O
days	O
by	O
Bob	O
Jenkins	O
.	O
</s>
<s>
The	O
leaked	O
code	O
was	O
confirmed	O
to	O
be	O
genuine	O
,	O
as	O
its	O
output	O
was	O
found	O
to	O
match	O
that	O
of	O
proprietary	O
software	O
using	O
licensed	O
RC4	B-Algorithm
.	O
</s>
<s>
The	O
name	O
RC4	B-Algorithm
is	O
trademarked	O
,	O
so	O
RC4	B-Algorithm
is	O
often	O
referred	O
to	O
as	O
ARCFOUR	B-Algorithm
or	O
ARC4	B-Algorithm
(	O
meaning	O
alleged	O
RC4	B-Algorithm
)	O
to	O
avoid	O
trademark	O
problems	O
.	O
</s>
<s>
RSA	O
Security	O
has	O
never	O
officially	O
released	O
the	O
algorithm	O
;	O
Rivest	O
has	O
,	O
however	O
,	O
linked	O
to	O
the	O
English	O
Wikipedia	O
article	O
on	O
RC4	B-Algorithm
in	O
his	O
own	O
course	O
notes	O
in	O
2008	O
and	O
confirmed	O
the	O
history	O
of	O
RC4	B-Algorithm
and	O
its	O
code	O
in	O
a	O
2014	O
paper	O
by	O
him	O
.	O
</s>
<s>
RC4	B-Algorithm
became	O
part	O
of	O
some	O
commonly	O
used	O
encryption	B-Protocol
protocols	I-Protocol
and	O
standards	O
,	O
such	O
as	O
WEP	B-Protocol
in	O
1997	O
and	O
WPA	O
in	O
2003/2004	O
for	O
wireless	O
cards	O
;	O
and	O
SSL	B-Protocol
in	O
1995	O
and	O
its	O
successor	O
TLS	B-Protocol
in	O
1999	O
,	O
until	O
it	O
was	O
prohibited	O
for	O
all	O
versions	O
of	O
TLS	B-Protocol
by	O
RFC	O
7465	O
in	O
2015	O
,	O
due	O
to	O
the	O
RC4	B-Algorithm
attacks	O
weakening	O
or	O
breaking	O
RC4	B-Algorithm
used	O
in	O
SSL/TLS	B-Protocol
.	O
</s>
<s>
The	O
main	O
factors	O
in	O
RC4	B-Algorithm
's	O
success	O
over	O
such	O
a	O
wide	O
range	O
of	O
applications	O
have	O
been	O
its	O
speed	O
and	O
simplicity	O
:	O
efficient	O
implementations	O
in	O
both	O
software	O
and	O
hardware	O
were	O
very	O
easy	O
to	O
develop	O
.	O
</s>
<s>
RC4	B-Algorithm
generates	O
a	O
pseudorandom	B-Algorithm
stream	I-Algorithm
of	I-Algorithm
bits	I-Algorithm
(	O
a	O
keystream	B-Algorithm
)	O
.	O
</s>
<s>
As	O
with	O
any	O
stream	B-Algorithm
cipher	I-Algorithm
,	O
these	O
can	O
be	O
used	O
for	O
encryption	O
by	O
combining	O
it	O
with	O
the	O
plaintext	O
using	O
bitwise	O
exclusive	O
or	O
;	O
decryption	O
is	O
performed	O
the	O
same	O
way	O
(	O
since	O
exclusive	O
or	O
with	O
given	O
data	O
is	O
an	O
involution	B-Algorithm
)	O
.	O
</s>
<s>
This	O
is	O
similar	O
to	O
the	O
one-time	B-Algorithm
pad	I-Algorithm
,	O
except	O
that	O
generated	O
pseudorandom	O
bits	O
,	O
rather	O
than	O
a	O
prepared	O
stream	O
,	O
are	O
used	O
.	O
</s>
<s>
To	O
generate	O
the	O
keystream	B-Algorithm
,	O
the	O
cipher	O
makes	O
use	O
of	O
a	O
secret	O
internal	O
state	O
which	O
consists	O
of	O
two	O
parts	O
:	O
</s>
<s>
A	O
permutation	B-Algorithm
of	O
all	O
256	O
possible	O
bytes	B-Application
(	O
denoted	O
"	O
S	O
"	O
below	O
)	O
.	O
</s>
<s>
The	O
permutation	B-Algorithm
is	O
initialized	O
with	O
a	O
variable-length	O
key	O
,	O
typically	O
between	O
40	O
and	O
2048bits	O
,	O
using	O
the	O
key-scheduling	B-Algorithm
algorithm	O
(	O
KSA	O
)	O
.	O
</s>
<s>
The	O
key-scheduling	B-Algorithm
algorithm	O
is	O
used	O
to	O
initialize	O
the	O
permutation	B-Algorithm
in	O
the	O
array	O
"	O
S	O
"	O
.	O
</s>
<s>
"	O
keylength	O
"	O
is	O
defined	O
as	O
the	O
number	O
of	O
bytes	B-Application
in	O
the	O
key	O
and	O
can	O
be	O
in	O
the	O
range	O
1	O
≤	O
keylength	O
≤	O
256	O
,	O
typically	O
between	O
5	O
and	O
16	O
,	O
corresponding	O
to	O
a	O
key	O
length	O
of	O
40	O
–	O
128bits	O
.	O
</s>
<s>
First	O
,	O
the	O
array	O
"	O
S	O
"	O
is	O
initialized	O
to	O
the	O
identity	O
permutation	B-Algorithm
.	O
</s>
<s>
S	O
is	O
then	O
processed	O
for	O
256	O
iterations	O
in	O
a	O
similar	O
way	O
to	O
the	O
main	O
PRGA	O
,	O
but	O
also	O
mixes	O
in	O
bytes	B-Application
of	O
the	O
key	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
For	O
as	O
many	O
iterations	O
as	O
are	O
needed	O
,	O
the	O
PRGA	O
modifies	O
the	O
state	O
and	O
outputs	O
a	O
byte	B-Application
of	O
the	O
keystream	B-Algorithm
.	O
</s>
<s>
exchanges	O
the	O
values	O
of	O
and	O
,	O
then	O
uses	O
the	O
sum	O
as	O
an	O
index	O
to	O
fetch	O
a	O
third	O
element	O
of	O
(	O
the	O
keystream	B-Algorithm
value	O
below	O
)	O
;	O
</s>
<s>
then	O
bitwise	O
exclusive	O
ORed	O
(	O
XORed	O
)	O
with	O
the	O
next	O
byte	B-Application
of	O
the	O
message	O
to	O
produce	O
the	O
next	O
byte	B-Application
of	O
either	O
ciphertext	O
or	O
plaintext	O
.	O
</s>
<s>
Several	O
operating	B-General_Concept
systems	I-General_Concept
include	O
,	O
an	O
API	O
originating	O
in	O
OpenBSD	B-Application
providing	O
access	O
to	O
a	O
random	O
number	O
generator	O
originally	O
based	O
on	O
RC4	B-Algorithm
.	O
</s>
<s>
In	O
OpenBSD	B-Application
5.5	O
,	O
released	O
in	O
May	O
2014	O
,	O
was	O
modified	O
to	O
use	O
ChaCha20	O
.	O
</s>
<s>
The	O
implementations	O
of	O
arc4random	O
in	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
and	O
Linux	B-Application
's	O
libbsd	O
also	O
use	O
ChaCha20	O
.	O
</s>
<s>
According	O
to	O
manual	B-Protocol
pages	I-Protocol
shipped	O
with	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
in	O
the	O
2017	O
release	O
of	O
macOS	B-Application
and	O
iOS	B-Application
operating	B-General_Concept
systems	I-General_Concept
,	O
Apple	O
replaced	O
RC4	B-Algorithm
with	O
AES	B-Algorithm
in	O
its	O
implementation	O
of	O
arc4random	O
.	O
</s>
<s>
Man	B-Protocol
pages	I-Protocol
for	O
the	O
new	O
arc4random	O
include	O
the	O
backronym	O
"	O
A	O
Replacement	O
Call	O
for	O
Random	O
"	O
for	O
ARC4	B-Algorithm
as	O
a	O
mnemonic	O
,	O
as	O
it	O
provides	O
better	O
random	O
data	O
than	O
rand( )	O
does	O
.	O
</s>
<s>
Proposed	O
new	O
random	O
number	O
generators	O
are	O
often	O
compared	O
to	O
the	O
RC4	B-Algorithm
random	O
number	O
generator	O
.	O
</s>
<s>
Several	O
attacks	O
on	O
RC4	B-Algorithm
are	O
able	O
to	O
distinguish	O
its	O
output	O
from	O
a	O
random	O
sequence	O
.	O
</s>
<s>
Many	O
stream	B-Algorithm
ciphers	I-Algorithm
are	O
based	O
on	O
linear-feedback	B-Architecture
shift	I-Architecture
registers	I-Architecture
(	O
LFSRs	B-Architecture
)	O
,	O
which	O
,	O
while	O
efficient	O
in	O
hardware	O
,	O
are	O
less	O
so	O
in	O
software	O
.	O
</s>
<s>
The	O
design	O
of	O
RC4	B-Algorithm
avoids	O
the	O
use	O
of	O
LFSRs	B-Architecture
and	O
is	O
ideal	O
for	O
software	O
implementation	O
,	O
as	O
it	O
requires	O
only	O
byte	B-Application
manipulations	O
.	O
</s>
<s>
It	O
uses	O
256	O
bytes	B-Application
of	O
memory	O
for	O
the	O
state	O
array	O
,	O
S[0]	O
through	O
S[255],	O
k	O
bytes	B-Application
of	O
memory	O
for	O
the	O
key	O
,	O
key[0]	O
through	O
key[k−1],	O
and	O
integer	O
variables	O
,	O
i	O
,	O
j	O
,	O
and	O
K	O
.	O
Performing	O
a	O
modular	O
reduction	O
of	O
some	O
value	O
modulo	O
256	O
can	O
be	O
done	O
with	O
a	O
bitwise	O
AND	O
with	O
255	O
(	O
which	O
is	O
equivalent	O
to	O
taking	O
the	O
low-order	O
byte	B-Application
of	O
the	O
value	O
in	O
question	O
)	O
.	O
</s>
<s>
These	O
test	O
vectors	O
are	O
not	O
official	O
,	O
but	O
convenient	O
for	O
anyone	O
testing	O
their	O
own	O
RC4	B-Algorithm
program	O
.	O
</s>
<s>
The	O
keys	O
and	O
plaintext	O
are	O
ASCII	B-Protocol
,	O
the	O
keystream	B-Algorithm
and	O
ciphertext	O
are	O
in	O
hexadecimal	O
.	O
</s>
<s>
Key	O
Keystream	B-Algorithm
Plaintext	O
Ciphertext	O
…	O
…	O
…	O
</s>
<s>
Unlike	O
a	O
modern	O
stream	B-Algorithm
cipher	I-Algorithm
(	O
such	O
as	O
those	O
in	O
eSTREAM	O
)	O
,	O
RC4	B-Algorithm
does	O
not	O
take	O
a	O
separate	O
nonce	O
alongside	O
the	O
key	O
.	O
</s>
<s>
This	O
means	O
that	O
if	O
a	O
single	O
long-term	O
key	O
is	O
to	O
be	O
used	O
to	O
securely	O
encrypt	O
multiple	O
streams	O
,	O
the	O
protocol	B-Protocol
must	O
specify	O
how	O
to	O
combine	O
the	O
nonce	O
and	O
the	O
long-term	O
key	O
to	O
generate	O
the	O
stream	O
key	O
for	O
RC4	B-Algorithm
.	O
</s>
<s>
One	O
approach	O
to	O
addressing	O
this	O
is	O
to	O
generate	O
a	O
"	O
fresh	O
"	O
RC4	B-Algorithm
key	O
by	O
hashing	B-Algorithm
a	O
long-term	O
key	O
with	O
a	O
nonce	O
.	O
</s>
<s>
However	O
,	O
many	O
applications	O
that	O
use	O
RC4	B-Algorithm
simply	O
concatenate	O
key	O
and	O
nonce	O
;	O
RC4	B-Algorithm
's	O
weak	O
key	B-Algorithm
schedule	I-Algorithm
then	O
gives	O
rise	O
to	O
related-key	O
attacks	O
,	O
like	O
the	O
Fluhrer	O
,	O
Mantin	O
and	O
Shamir	O
attack	O
(	O
which	O
is	O
famous	O
for	O
breaking	O
the	O
WEP	B-Protocol
standard	O
)	O
.	O
</s>
<s>
Because	O
RC4	B-Algorithm
is	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
,	O
it	O
is	O
more	O
malleable	O
than	O
common	O
block	O
ciphers	O
.	O
</s>
<s>
If	O
not	O
used	O
together	O
with	O
a	O
strong	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
MAC	O
)	O
,	O
then	O
encryption	O
is	O
vulnerable	O
to	O
a	O
bit-flipping	O
attack	O
.	O
</s>
<s>
The	O
cipher	O
is	O
also	O
vulnerable	O
to	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
attack	O
if	O
not	O
implemented	O
correctly	O
.	O
</s>
<s>
It	O
is	O
noteworthy	O
,	O
however	O
,	O
that	O
RC4	B-Algorithm
,	O
being	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
,	O
was	O
for	O
a	O
period	O
of	O
time	O
the	O
only	O
common	O
cipher	O
that	O
was	O
immune	O
to	O
the	O
2011	O
BEAST	O
attack	O
on	O
TLS	B-Protocol
1.0	O
.	O
</s>
<s>
In	O
March	O
2013	O
,	O
there	O
were	O
new	O
attack	O
scenarios	O
proposed	O
by	O
Isobe	O
,	O
Ohigashi	O
,	O
Watanabe	O
and	O
Morii	O
,	O
as	O
well	O
as	O
AlFardan	O
,	O
Bernstein	O
,	O
Paterson	O
,	O
Poettering	O
and	O
Schuldt	O
that	O
use	O
new	O
statistical	O
biases	O
in	O
RC4	B-Algorithm
key	O
table	O
to	O
recover	O
plaintext	O
with	O
large	O
number	O
of	O
TLS	B-Protocol
encryptions	I-Protocol
.	O
</s>
<s>
The	O
use	O
of	O
RC4	B-Algorithm
in	O
TLS	B-Protocol
is	O
prohibited	O
by	O
RFC	O
7465	O
published	O
in	O
February	O
2015	O
.	O
</s>
<s>
In	O
1995	O
,	O
Andrew	O
Roos	O
experimentally	O
observed	O
that	O
the	O
first	O
byte	B-Application
of	O
the	O
keystream	B-Algorithm
is	O
correlated	O
with	O
the	O
first	O
three	O
bytes	B-Application
of	O
the	O
key	O
,	O
and	O
the	O
first	O
few	O
bytes	B-Application
of	O
the	O
permutation	B-Algorithm
after	O
the	O
KSA	O
are	O
correlated	O
with	O
some	O
linear	O
combination	O
of	O
the	O
key	O
bytes	B-Application
.	O
</s>
<s>
These	O
biases	O
remained	O
unexplained	O
until	O
2007	O
,	O
when	O
Goutam	O
Paul	O
,	O
Siddheshwar	O
Rathi	O
and	O
Subhamoy	O
Maitra	O
proved	O
the	O
keystream	B-Algorithm
–	O
key	O
correlation	O
and	O
,	O
in	O
another	O
work	O
,	O
Goutam	O
Paul	O
and	O
Subhamoy	O
Maitra	O
proved	O
the	O
permutation	B-Algorithm
–	O
key	O
correlations	O
.	O
</s>
<s>
The	O
latter	O
work	O
also	O
used	O
the	O
permutation	B-Algorithm
–	O
key	O
correlations	O
to	O
design	O
the	O
first	O
algorithm	O
for	O
complete	O
key	O
reconstruction	O
from	O
the	O
final	O
permutation	B-Algorithm
after	O
the	O
KSA	O
,	O
without	O
any	O
assumption	O
on	O
the	O
key	O
or	O
initialization	B-Algorithm
vector	I-Algorithm
.	O
</s>
<s>
Subsequently	O
,	O
many	O
other	O
works	O
have	O
been	O
performed	O
on	O
key	O
reconstruction	O
from	O
RC4	B-Algorithm
internal	O
states	O
.	O
</s>
<s>
Subhamoy	O
Maitra	O
and	O
Goutam	O
Paul	O
also	O
showed	O
that	O
the	O
Roos-type	O
biases	O
still	O
persist	O
even	O
when	O
one	O
considers	O
nested	O
permutation	B-Algorithm
indices	O
,	O
like	O
or	O
.	O
</s>
<s>
The	O
keystream	B-Algorithm
generated	O
by	O
the	O
RC4	B-Algorithm
is	O
biased	O
to	O
varying	O
degrees	O
towards	O
certain	O
sequences	O
,	O
making	O
it	O
vulnerable	O
to	O
distinguishing	O
attacks	O
.	O
</s>
<s>
The	O
best	O
such	O
attack	O
is	O
due	O
to	O
Itsik	O
Mantin	O
and	O
Adi	O
Shamir	O
,	O
who	O
showed	O
that	O
the	O
second	O
output	O
byte	B-Application
of	O
the	O
cipher	O
was	O
biased	O
toward	O
zero	O
with	O
probability	O
1/128	O
(	O
instead	O
of	O
1/256	O
)	O
.	O
</s>
<s>
This	O
is	O
due	O
to	O
the	O
fact	O
that	O
if	O
the	O
third	O
byte	B-Application
of	O
the	O
original	O
state	O
is	O
zero	O
,	O
and	O
the	O
second	O
byte	B-Application
is	O
not	O
equal	O
to	O
2	O
,	O
then	O
the	O
second	O
output	O
byte	B-Application
is	O
always	O
zero	O
.	O
</s>
<s>
Souradyuti	O
Paul	O
and	O
Bart	O
Preneel	O
of	O
COSIC	B-General_Concept
showed	O
that	O
the	O
first	O
and	O
the	O
second	O
bytes	B-Application
of	O
the	O
RC4	B-Algorithm
were	O
also	O
biased	O
.	O
</s>
<s>
Scott	O
Fluhrer	O
and	O
David	O
McGrew	O
also	O
showed	O
attacks	O
that	O
distinguished	O
the	O
keystream	B-Algorithm
of	O
the	O
RC4	B-Algorithm
from	O
a	O
random	O
stream	O
given	O
a	O
gigabyte	O
of	O
output	O
.	O
</s>
<s>
The	O
complete	O
characterization	O
of	O
a	O
single	O
step	O
of	O
RC4	B-Algorithm
PRGA	O
was	O
performed	O
by	O
Riddhipratim	O
Basu	O
,	O
Shirshendu	O
Ganguly	O
,	O
Subhamoy	O
Maitra	O
,	O
and	O
Goutam	O
Paul	O
.	O
</s>
<s>
Considering	O
all	O
the	O
permutations	B-Algorithm
,	O
they	O
proved	O
that	O
the	O
distribution	O
of	O
the	O
output	O
is	O
not	O
uniform	O
given	O
i	O
and	O
j	O
,	O
and	O
as	O
a	O
consequence	O
,	O
information	O
about	O
j	O
is	O
always	O
leaked	O
into	O
the	O
output	O
.	O
</s>
<s>
In	O
2001	O
,	O
a	O
new	O
and	O
surprising	O
discovery	O
was	O
made	O
by	O
Fluhrer	O
,	O
Mantin	O
and	O
Shamir	O
:	O
over	O
all	O
the	O
possible	O
RC4	B-Algorithm
keys	O
,	O
the	O
statistics	O
for	O
the	O
first	O
few	O
bytes	B-Application
of	O
output	O
keystream	B-Algorithm
are	O
strongly	O
non-random	O
,	O
leaking	O
information	O
about	O
the	O
key	O
.	O
</s>
<s>
If	O
the	O
nonce	O
and	O
long-term	O
key	O
are	O
simply	O
concatenated	O
to	O
generate	O
the	O
RC4	B-Algorithm
key	O
,	O
this	O
long-term	O
key	O
can	O
be	O
discovered	O
by	O
analysing	O
a	O
large	O
number	O
of	O
messages	O
encrypted	O
with	O
this	O
key	O
.	O
</s>
<s>
This	O
and	O
related	O
effects	O
were	O
then	O
used	O
to	O
break	O
the	O
WEP	B-Protocol
(	O
"	O
wired	B-Protocol
equivalent	I-Protocol
privacy	I-Protocol
"	O
)	O
encryption	O
used	O
with	O
802.11	O
wireless	B-General_Concept
networks	I-General_Concept
.	O
</s>
<s>
This	O
caused	O
a	O
scramble	O
for	O
a	O
standards-based	O
replacement	O
for	O
WEP	B-Protocol
in	O
the	O
802.11	O
market	O
and	O
led	O
to	O
the	O
IEEE	O
802.11i	O
effort	O
and	O
WPA	O
.	O
</s>
<s>
Protocols	O
can	O
defend	O
against	O
this	O
attack	O
by	O
discarding	O
the	O
initial	O
portion	O
of	O
the	O
keystream	B-Algorithm
.	O
</s>
<s>
Such	O
a	O
modified	O
algorithm	O
is	O
traditionally	O
called	O
"RC4-drop[]",	O
where	O
is	O
the	O
number	O
of	O
initial	O
keystream	B-Algorithm
bytes	B-Application
that	O
are	O
dropped	O
.	O
</s>
<s>
The	O
Fluhrer	O
,	O
Mantin	O
and	O
Shamir	O
attack	O
does	O
not	O
apply	O
to	O
RC4-based	O
SSL	B-Protocol
,	O
since	O
SSL	B-Protocol
generates	O
the	O
encryption	O
keys	O
it	O
uses	O
for	O
RC4	B-Algorithm
by	O
hashing	B-Algorithm
,	O
meaning	O
that	O
different	O
SSL	B-Protocol
sessions	O
have	O
unrelated	O
keys	O
.	O
</s>
<s>
In	O
2005	O
,	O
Andreas	O
Klein	O
presented	O
an	O
analysis	O
of	O
the	O
RC4	B-Algorithm
stream	B-Algorithm
cipher	I-Algorithm
,	O
showing	O
more	O
correlations	O
between	O
the	O
RC4	B-Algorithm
keystream	B-Algorithm
and	O
the	O
key	O
.	O
</s>
<s>
Erik	O
Tews	O
,	O
Ralf-Philipp	O
Weinmann	O
,	O
and	O
Andrei	O
Pychkine	O
used	O
this	O
analysis	O
to	O
create	O
aircrack-ptw	O
,	O
a	O
tool	O
that	O
cracks	O
104-bit	O
RC4	B-Algorithm
used	O
in	O
128-bit	O
WEP	B-Protocol
in	O
under	O
a	O
minute	O
.	O
</s>
<s>
A	O
combinatorial	O
problem	O
related	O
to	O
the	O
number	O
of	O
inputs	O
and	O
outputs	O
of	O
the	O
RC4	B-Algorithm
cipher	I-Algorithm
was	O
first	O
posed	O
by	O
Itsik	O
Mantin	O
and	O
Adi	O
Shamir	O
in	O
2001	O
,	O
whereby	O
,	O
of	O
the	O
total	O
256	O
elements	O
in	O
the	O
typical	O
state	O
of	O
RC4	B-Algorithm
,	O
if	O
x	O
number	O
of	O
elements	O
(	O
x	O
≤	O
256	O
)	O
are	O
only	O
known	O
(	O
all	O
other	O
elements	O
can	O
be	O
assumed	O
empty	O
)	O
,	O
then	O
the	O
maximum	O
number	O
of	O
elements	O
that	O
can	O
be	O
produced	O
deterministically	O
is	O
also	O
in	O
the	O
next	O
256	O
rounds	O
.	O
</s>
<s>
While	O
yet	O
not	O
a	O
practical	O
attack	O
for	O
most	O
purposes	O
,	O
this	O
result	O
is	O
sufficiently	O
close	O
to	O
one	O
that	O
it	O
has	O
led	O
to	O
speculation	O
that	O
it	O
is	O
plausible	O
that	O
some	O
state	O
cryptologic	O
agencies	O
may	O
already	O
have	O
better	O
attacks	O
that	O
render	O
RC4	B-Algorithm
insecure	O
.	O
</s>
<s>
Given	O
that	O
,	O
,	O
a	O
large	O
amount	O
of	O
TLS	B-Protocol
traffic	O
uses	O
RC4	B-Algorithm
to	O
avoid	O
attacks	O
on	O
block	O
ciphers	O
that	O
use	O
cipher	O
block	O
chaining	O
,	O
if	O
these	O
hypothetical	O
better	O
attacks	O
exist	O
,	O
then	O
this	O
would	O
make	O
the	O
TLS-with-RC4	O
combination	O
insecure	O
against	O
such	O
attackers	O
in	O
a	O
large	O
number	O
of	O
practical	O
scenarios	O
.	O
</s>
<s>
In	O
March	O
2015	O
,	O
researcher	O
to	O
Royal	O
Holloway	O
announced	O
improvements	O
to	O
their	O
attack	O
,	O
providing	O
a	O
226	O
attack	O
against	O
passwords	O
encrypted	O
with	O
RC4	B-Algorithm
,	O
as	O
used	O
in	O
TLS	B-Protocol
.	O
</s>
<s>
At	O
the	O
Black	O
Hat	O
Asia	O
2015	O
Conference	O
,	O
Itsik	O
Mantin	O
presented	O
another	O
attack	O
against	O
SSL	B-Protocol
using	O
RC4	B-Algorithm
cipher	I-Algorithm
.	O
</s>
<s>
In	O
2015	O
,	O
security	O
researchers	O
from	O
KU	O
Leuven	O
presented	O
new	O
attacks	O
against	O
RC4	B-Algorithm
in	O
both	O
TLS	B-Protocol
and	O
WPA-TKIP	B-Protocol
.	O
</s>
<s>
Their	O
attack	O
against	O
TLS	B-Protocol
can	O
decrypt	O
a	O
secure	O
HTTP	B-Application
cookie	I-Application
within	O
75hours	O
.	O
</s>
<s>
The	O
attack	O
against	O
WPA-TKIP	B-Protocol
can	O
be	O
completed	O
within	O
an	O
hour	O
and	O
allows	O
an	O
attacker	O
to	O
decrypt	O
and	O
inject	O
arbitrary	O
packets	O
.	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
the	O
most	O
important	O
weakness	O
of	O
RC4	B-Algorithm
comes	O
from	O
the	O
insufficient	O
key	B-Algorithm
schedule	I-Algorithm
;	O
the	O
first	O
bytes	B-Application
of	O
output	O
reveal	O
information	O
about	O
the	O
key	O
.	O
</s>
<s>
This	O
is	O
known	O
as	O
RC4-dropN	O
,	O
where	O
N	O
is	O
typically	O
a	O
multiple	O
of	O
256	O
,	O
such	O
as	O
768	O
or	O
1024	O
.	O
</s>
<s>
A	O
number	O
of	O
attempts	O
have	O
been	O
made	O
to	O
strengthen	O
RC4	B-Algorithm
,	O
notably	O
Spritz	O
,	O
RC4A	O
,	O
VMPC	B-Algorithm
,	O
and	O
RC4+	O
.	O
</s>
<s>
Souradyuti	O
Paul	O
and	O
Bart	O
Preneel	O
have	O
proposed	O
an	O
RC4	B-Algorithm
variant	O
,	O
which	O
they	O
call	O
RC4A	O
.	O
</s>
<s>
Each	O
time	O
is	O
incremented	O
,	O
two	O
bytes	B-Application
are	O
generated	O
:	O
</s>
<s>
First	O
,	O
the	O
basic	O
RC4	B-Algorithm
algorithm	O
is	O
performed	O
using	O
and	O
,	O
but	O
in	O
the	O
last	O
step	O
,	O
is	O
looked	O
up	O
in	O
.	O
</s>
<s>
Although	O
the	O
algorithm	O
required	O
the	O
same	O
number	O
of	O
operations	O
per	O
output	O
byte	B-Application
,	O
there	O
is	O
greater	O
parallelism	O
than	O
RC4	B-Algorithm
,	O
providing	O
a	O
possible	O
speed	O
improvement	O
.	O
</s>
<s>
Although	O
stronger	O
than	O
RC4	B-Algorithm
,	O
this	O
algorithm	O
has	O
also	O
been	O
attacked	O
,	O
with	O
Alexander	O
Maximov	O
and	O
a	O
team	O
from	O
NEC	O
developing	O
ways	O
to	O
distinguish	O
its	O
output	O
from	O
a	O
truly	O
random	O
sequence	O
.	O
</s>
<s>
Variably	B-Algorithm
Modified	I-Algorithm
Permutation	I-Algorithm
Composition	I-Algorithm
(	O
VMPC	B-Algorithm
)	O
is	O
another	O
RC4	B-Algorithm
variant	O
.	O
</s>
<s>
This	O
was	O
attacked	O
in	O
the	O
same	O
papers	O
as	O
RC4A	O
,	O
and	O
can	O
be	O
distinguished	O
within	O
238	O
output	O
bytes	B-Application
.	O
</s>
<s>
RC4+	O
is	O
a	O
modified	O
version	O
of	O
RC4	B-Algorithm
with	O
a	O
more	O
complex	O
three-phase	O
key	B-Algorithm
schedule	I-Algorithm
(	O
taking	O
about	O
three	O
times	O
as	O
long	O
as	O
RC4	B-Algorithm
,	O
or	O
the	O
same	O
as	O
RC4-drop512	O
)	O
,	O
and	O
a	O
more	O
complex	O
output	O
function	O
which	O
performs	O
four	O
additional	O
lookups	O
in	O
the	O
S	O
array	O
for	O
each	O
byte	B-Application
output	O
,	O
taking	O
approximately	O
1.7	O
times	O
as	O
long	O
as	O
basic	O
RC4	B-Algorithm
.	O
</s>
<s>
A	O
hardware	O
accelerator	O
of	O
Spritz	O
was	O
published	O
in	O
Secrypt	O
,	O
2016	O
and	O
shows	O
that	O
due	O
to	O
multiple	O
nested	O
calls	O
required	O
to	O
produce	O
output	O
bytes	B-Application
,	O
Spritz	O
performs	O
rather	O
slowly	O
compared	O
to	O
other	O
hash	B-Algorithm
functions	I-Algorithm
such	O
as	O
SHA-3	O
and	O
the	O
best	O
known	O
hardware	O
implementation	O
of	O
RC4	B-Algorithm
.	O
</s>
<s>
So	O
after	O
256	O
iterations	O
of	O
this	O
inner	O
loop	O
,	O
the	O
value	O
(	O
incremented	O
by	O
every	O
iteration	O
)	O
has	O
taken	O
on	O
all	O
possible	O
values	O
0	O
...	O
255	O
,	O
and	O
every	O
byte	B-Application
in	O
the	O
S	O
array	O
has	O
been	O
swapped	O
at	O
least	O
once	O
.	O
</s>
<s>
Like	O
other	O
sponge	B-Algorithm
functions	I-Algorithm
,	O
Spritz	O
can	O
be	O
used	O
to	O
build	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
,	O
a	O
deterministic	O
random	O
bit	O
generator	O
(	O
DRBG	B-Algorithm
)	O
,	O
an	O
encryption	O
algorithm	O
that	O
supports	O
authenticated	B-Algorithm
encryption	I-Algorithm
with	O
associated	O
data	O
(	O
AEAD	O
)	O
,	O
etc	O
.	O
</s>
<s>
Where	O
a	O
protocol	B-Protocol
is	O
marked	O
with	O
"	O
(	O
optionally	O
)	O
"	O
,	O
RC4	B-Algorithm
is	O
one	O
of	O
multiple	O
ciphers	O
the	O
system	O
can	O
be	O
configured	O
to	O
use	O
.	O
</s>
