<s>
In	O
cryptography	O
,	O
Madryga	B-Algorithm
is	O
a	O
block	O
cipher	O
published	O
in	O
1984	O
by	O
W	O
.	O
E	O
.	O
Madryga	B-Algorithm
.	O
</s>
<s>
Serious	O
weaknesses	O
have	O
since	O
been	O
found	O
in	O
the	O
algorithm	O
,	O
but	O
it	O
was	O
one	O
of	O
the	O
first	O
encryption	O
algorithms	O
to	O
make	O
use	O
of	O
data-dependent	O
rotations	O
,	O
later	O
used	O
in	O
other	O
ciphers	O
,	O
such	O
as	O
RC5	B-Algorithm
and	O
RC6	B-Algorithm
.	O
</s>
<s>
In	O
his	O
proposal	O
,	O
Madryga	B-Algorithm
set	O
forth	O
twelve	O
design	O
objectives	O
that	O
are	O
generally	O
considered	O
to	O
be	O
good	O
goals	O
in	O
the	O
design	O
of	O
a	O
block	O
cipher	O
.	O
</s>
<s>
DES	B-Algorithm
had	O
already	O
fulfilled	O
nine	O
of	O
them	O
.	O
</s>
<s>
The	O
three	O
that	O
DES	B-Algorithm
did	O
not	O
fulfill	O
were	O
:	O
</s>
<s>
(	O
Meaning	O
no	O
weak	O
keys	O
,	O
which	O
DES	B-Algorithm
has	O
.	O
)	O
</s>
<s>
The	O
algorithm	O
should	O
be	O
efficiently	O
implementable	O
in	O
software	O
on	O
large	O
mainframes	B-Architecture
,	O
minicomputers	B-Architecture
,	O
and	O
microcomputers	B-Architecture
,	O
and	O
in	O
discrete	O
logic	O
.	O
</s>
<s>
(	O
DES	B-Algorithm
has	O
a	O
large	O
amount	O
of	O
bitwise	O
permutations	O
,	O
which	O
are	O
inefficient	O
in	O
software	O
implementations	O
.	O
)	O
</s>
<s>
Madryga	B-Algorithm
met	O
the	O
objective	O
of	O
being	O
efficient	O
in	O
software	O
:	O
the	O
only	O
operations	O
it	O
uses	O
are	O
XOR	B-Application
and	O
rotations	O
,	O
both	O
operating	O
only	O
on	O
whole	O
bytes	O
.	O
</s>
<s>
Madryga	B-Algorithm
has	O
a	O
variable-length	O
key	O
,	O
with	O
no	O
upper	O
limit	O
on	O
its	O
length	O
.	O
</s>
<s>
Madryga	B-Algorithm
is	O
specified	O
with	O
eight	O
rounds	O
,	O
but	O
this	O
can	O
be	O
increased	O
to	O
provide	O
more	O
security	O
if	O
need	O
be	O
.	O
</s>
<s>
The	O
algorithm	O
looks	O
at	O
three	O
bytes	O
at	O
a	O
time	O
,	O
so	O
Madryga	B-Algorithm
is	O
a	O
24-bit	O
block	O
cipher	O
.	O
</s>
<s>
It	O
XORs	B-Application
a	O
key	O
byte	O
with	O
the	O
rightmost	O
byte	O
,	O
and	O
rotates	O
the	O
other	O
two	O
as	O
one	O
block	O
.	O
</s>
<s>
The	O
rotation	O
varies	O
with	O
the	O
output	O
of	O
the	O
XOR	B-Application
.	O
</s>
<s>
It	O
is	O
rotated	O
again	O
after	O
each	O
iteration	O
of	O
rotation	O
and	O
XOR	B-Application
.	O
</s>
<s>
The	O
rightmost	O
byte	O
of	O
it	O
is	O
used	O
in	O
each	O
iteration	O
to	O
XOR	B-Application
with	O
the	O
rightmost	O
byte	O
of	O
the	O
data	O
block	O
.	O
</s>
<s>
Due	O
to	O
the	O
nature	O
of	O
the	O
XOR	B-Application
operation	O
,	O
it	O
is	O
reversible	O
.	O
</s>
<s>
At	O
a	O
glance	O
,	O
Madryga	B-Algorithm
seems	O
less	O
secure	O
than	O
,	O
for	O
example	O
,	O
DES	B-Algorithm
.	O
</s>
<s>
All	O
of	O
Madryga	B-Algorithm
's	O
operations	O
are	O
linear	O
.	O
</s>
<s>
DES	B-Algorithm
's	O
S-boxes	B-Algorithm
are	O
its	O
only	O
non-linear	O
component	O
,	O
and	O
flaws	O
in	O
them	O
are	O
what	O
both	O
differential	O
cryptanalysis	O
and	O
linear	O
cryptanalysis	O
seek	O
to	O
exploit	O
.	O
</s>
<s>
While	O
Madryga	B-Algorithm
's	O
rotations	O
are	O
data-dependent	O
to	O
a	O
small	O
degree	O
,	O
they	O
are	O
still	O
linear	O
.	O
</s>
<s>
Perhaps	O
Madryga	B-Algorithm
's	O
fatal	O
flaw	O
is	O
that	O
it	O
does	O
not	O
exhibit	O
the	O
avalanche	O
effect	O
.	O
</s>
<s>
Here	O
,	O
parity	O
refers	O
to	O
the	O
XOR	B-Application
sum	O
of	O
all	O
the	O
bits	O
.	O
</s>
<s>
In	O
1995	O
,	O
Ken	O
Shirriff	O
found	O
a	O
differential	O
attack	O
on	O
Madryga	B-Algorithm
that	O
requires	O
5,000	O
chosen	O
plaintexts	O
.	O
</s>
<s>
Biryukov	O
and	O
Kushilevitz	O
(	O
1998	O
)	O
published	O
an	O
improved	O
differential	O
attack	O
requiring	O
only	O
16	O
chosen-plaintext	O
pairs	O
,	O
and	O
then	O
demonstrated	O
that	O
it	O
could	O
be	O
converted	O
to	O
a	O
ciphertext-only	O
attack	O
using	O
212	O
ciphertexts	O
,	O
under	O
reasonable	O
assumptions	O
about	O
the	O
redundancy	O
of	O
the	O
plaintext	O
(	O
for	O
example	O
,	O
ASCII-encoded	O
English	O
language	O
)	O
.	O
</s>
