<s>
In	O
cryptography	O
,	O
a	O
cipher	B-Algorithm
(	O
or	O
cypher	O
)	O
is	O
an	O
algorithm	O
for	O
performing	O
encryption	O
or	O
decryptiona	O
series	O
of	O
well-defined	O
steps	O
that	O
can	O
be	O
followed	O
as	O
a	O
procedure	O
.	O
</s>
<s>
An	O
alternative	O
,	O
less	O
common	O
term	O
is	O
encipherment	B-Algorithm
.	O
</s>
<s>
To	O
encipher	B-Algorithm
or	O
encode	O
is	O
to	O
convert	O
information	O
into	O
cipher	B-Algorithm
or	O
code	O
.	O
</s>
<s>
In	O
common	O
parlance	O
,	O
"	O
cipher	B-Algorithm
"	O
is	O
synonymous	O
with	O
"	O
code	O
"	O
,	O
as	O
they	O
are	O
both	O
a	O
set	O
of	O
steps	O
that	O
encrypt	O
a	O
message	O
;	O
however	O
,	O
the	O
concepts	O
are	O
distinct	O
in	O
cryptography	O
,	O
especially	O
classical	B-Algorithm
cryptography	I-Algorithm
.	O
</s>
<s>
Codes	O
generally	O
substitute	O
different	O
length	O
strings	O
of	O
characters	O
in	O
the	O
output	O
,	O
while	O
ciphers	B-Algorithm
generally	O
substitute	O
the	O
same	O
number	O
of	O
characters	O
as	O
are	O
input	O
.	O
</s>
<s>
Ciphers	B-Algorithm
are	O
algorithmic	O
.	O
</s>
<s>
The	O
given	O
input	O
must	O
follow	O
the	O
cipher	B-Algorithm
's	O
process	O
to	O
be	O
solved	O
.	O
</s>
<s>
Ciphers	B-Algorithm
are	O
commonly	O
used	O
to	O
encrypt	O
written	O
information	O
.	O
</s>
<s>
Codes	O
operated	O
by	O
substituting	O
according	O
to	O
a	O
large	O
codebook	B-Algorithm
which	O
linked	O
a	O
random	O
string	O
of	O
characters	O
or	O
numbers	O
to	O
a	O
word	O
or	O
phrase	O
.	O
</s>
<s>
When	O
using	O
a	O
cipher	B-Algorithm
the	O
original	O
information	O
is	O
known	O
as	O
plaintext	O
,	O
and	O
the	O
encrypted	O
form	O
as	O
ciphertext	O
.	O
</s>
<s>
The	O
operation	O
of	O
a	O
cipher	B-Algorithm
usually	O
depends	O
on	O
a	O
piece	O
of	O
auxiliary	O
information	O
,	O
called	O
a	O
key	O
(	O
or	O
,	O
in	O
traditional	O
NSA	O
parlance	O
,	O
a	O
cryptovariable	O
)	O
.	O
</s>
<s>
A	O
key	O
must	O
be	O
selected	O
before	O
using	O
a	O
cipher	B-Algorithm
to	O
encrypt	O
a	O
message	O
.	O
</s>
<s>
By	O
whether	O
they	O
work	O
on	O
blocks	O
of	O
symbols	O
usually	O
of	O
a	O
fixed	O
size	O
(	O
block	O
ciphers	B-Algorithm
)	O
,	O
or	O
on	O
a	O
continuous	O
stream	O
of	O
symbols	O
(	O
stream	B-Algorithm
ciphers	I-Algorithm
)	O
.	O
</s>
<s>
By	O
whether	O
the	O
same	O
key	O
is	O
used	O
for	O
both	O
encryption	O
and	O
decryption	O
(	O
symmetric	B-Algorithm
key	I-Algorithm
algorithms	I-Algorithm
)	O
,	O
or	O
if	O
a	O
different	O
key	O
is	O
used	O
for	O
each	O
(	O
asymmetric	B-Application
key	I-Application
algorithms	I-Application
)	O
.	O
</s>
<s>
If	O
the	O
algorithm	O
is	O
an	O
asymmetric	O
one	O
,	O
the	O
enciphering	B-Algorithm
key	O
is	O
different	O
from	O
,	O
but	O
closely	O
related	O
to	O
,	O
the	O
deciphering	O
key	O
.	O
</s>
<s>
If	O
one	O
key	O
cannot	O
be	O
deduced	O
from	O
the	O
other	O
,	O
the	O
asymmetric	B-Application
key	I-Application
algorithm	I-Application
has	O
the	O
public/private	O
key	O
property	O
and	O
one	O
of	O
the	O
keys	O
may	O
be	O
made	O
public	O
without	O
loss	O
of	O
confidentiality	O
.	O
</s>
<s>
Originating	O
from	O
the	O
Arabic	O
word	O
for	O
zero	O
صفر	O
(	O
sifr	O
)	O
,	O
the	O
word	O
“	O
cipher	B-Algorithm
”	O
spread	O
to	O
Europe	O
as	O
part	O
of	O
the	O
Arabic	O
numeral	O
system	O
during	O
the	O
Middle	O
Ages	O
.	O
</s>
<s>
This	O
eventually	O
led	O
to	O
the	O
English	O
word	O
cipher	B-Algorithm
(	O
minority	O
spelling	O
cypher	O
)	O
.	O
</s>
<s>
The	O
term	O
cipher	B-Algorithm
was	O
later	O
also	O
used	O
to	O
refer	O
to	O
any	O
Arabic	O
digit	O
,	O
or	O
to	O
calculation	O
using	O
them	O
,	O
so	O
encoding	O
text	O
in	O
the	O
form	O
of	O
Arabic	O
numerals	O
is	O
literally	O
converting	O
the	O
text	O
to	O
"	O
ciphers	B-Algorithm
"	O
.	O
</s>
<s>
In	O
casual	O
contexts	O
,	O
“	O
code	O
”	O
and	O
“	O
cipher	B-Algorithm
”	O
can	O
typically	O
be	O
used	O
interchangeably	O
,	O
however	O
,	O
the	O
technical	O
usages	O
of	O
the	O
words	O
refer	O
to	O
different	O
concepts	O
.	O
</s>
<s>
An	O
example	O
of	O
this	O
is	O
the	O
commercial	O
telegraph	O
code	O
which	O
was	O
used	O
to	O
shorten	O
long	O
telegraph	O
messages	O
which	O
resulted	O
from	O
entering	O
into	O
commercial	O
contracts	O
using	O
exchanges	O
of	O
telegrams	B-Application
.	O
</s>
<s>
Another	O
example	O
is	O
given	O
by	O
whole	O
word	O
ciphers	B-Algorithm
,	O
which	O
allow	O
the	O
user	O
to	O
replace	O
an	O
entire	O
word	O
with	O
a	O
symbol	O
or	O
character	O
,	O
much	O
like	O
the	O
way	O
Japanese	O
utilize	O
Kanji	O
(	O
meaning	O
Chinese	O
characters	O
in	O
Japanese	O
)	O
characters	O
to	O
supplement	O
their	O
language	O
.	O
</s>
<s>
Ciphers	B-Algorithm
,	O
on	O
the	O
other	O
hand	O
,	O
work	O
at	O
a	O
lower	O
level	O
:	O
the	O
level	O
of	O
individual	O
letters	O
,	O
small	O
groups	O
of	O
letters	O
,	O
or	O
,	O
in	O
modern	O
schemes	O
,	O
individual	O
bits	O
and	O
blocks	O
of	O
bits	O
.	O
</s>
<s>
Some	O
systems	O
used	O
both	O
codes	O
and	O
ciphers	B-Algorithm
in	O
one	O
system	O
,	O
using	O
superencipherment	O
to	O
increase	O
the	O
security	O
.	O
</s>
<s>
In	O
some	O
cases	O
the	O
terms	O
codes	O
and	O
ciphers	B-Algorithm
are	O
also	O
used	O
synonymously	O
to	O
substitution	O
and	O
transposition	B-Algorithm
.	O
</s>
<s>
Historically	O
,	O
cryptography	O
was	O
split	O
into	O
a	O
dichotomy	O
of	O
codes	O
and	O
ciphers	B-Algorithm
;	O
and	O
coding	O
had	O
its	O
own	O
terminology	O
,	O
analogous	O
to	O
that	O
for	O
ciphers	B-Algorithm
:	O
"	O
encoding	O
,	O
codetext	O
,	O
decoding	O
"	O
and	O
so	O
on	O
.	O
</s>
<s>
However	O
,	O
codes	O
have	O
a	O
variety	O
of	O
drawbacks	O
,	O
including	O
susceptibility	O
to	O
cryptanalysis	O
and	O
the	O
difficulty	O
of	O
managing	O
a	O
cumbersome	O
codebook	B-Algorithm
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
codes	O
have	O
fallen	O
into	O
disuse	O
in	O
modern	O
cryptography	O
,	O
and	O
ciphers	B-Algorithm
are	O
the	O
dominant	O
technique	O
.	O
</s>
<s>
Algorithms	O
used	O
earlier	O
in	O
the	O
history	O
of	O
cryptography	O
are	O
substantially	O
different	O
from	O
modern	O
methods	O
,	O
and	O
modern	O
ciphers	B-Algorithm
can	O
be	O
classified	O
according	O
to	O
how	O
they	O
operate	O
and	O
whether	O
they	O
use	O
one	O
or	O
two	O
keys	O
.	O
</s>
<s>
The	O
Caesar	O
Cipher	B-Algorithm
is	O
one	O
of	O
the	O
earliest	O
known	O
cryptographic	O
systems	O
.	O
</s>
<s>
Julius	O
Caesar	O
used	O
a	O
cipher	B-Algorithm
that	O
shifts	O
the	O
letters	O
in	O
the	O
alphabet	O
in	O
place	O
by	O
three	O
and	O
wrapping	O
the	O
remaining	O
letters	O
to	O
the	O
front	O
to	O
write	O
to	O
Marcus	O
Ciero	O
in	O
approximately	O
50	O
BC	O
.	O
</s>
<s>
Historical	O
pen	O
and	O
paper	O
ciphers	B-Algorithm
used	O
in	O
the	O
past	O
are	O
sometimes	O
known	O
as	O
classical	B-Algorithm
ciphers	I-Algorithm
.	O
</s>
<s>
They	O
include	O
simple	O
substitution	O
ciphers	B-Algorithm
(	O
such	O
as	O
ROT13	B-Algorithm
)	O
and	O
transposition	B-Algorithm
ciphers	I-Algorithm
(	O
such	O
as	O
a	O
Rail	B-Algorithm
Fence	I-Algorithm
Cipher	I-Algorithm
)	O
.	O
</s>
<s>
Transposition	B-Algorithm
of	O
the	O
letters	O
"	O
GOOD	O
DOG	O
"	O
can	O
result	O
in	O
"	O
DGOGDOO	O
"	O
.	O
</s>
<s>
These	O
simple	O
ciphers	B-Algorithm
and	O
examples	O
are	O
easy	O
to	O
crack	O
,	O
even	O
without	O
plaintext-ciphertext	O
pairs	O
.	O
</s>
<s>
William	O
Shakespeare	O
often	O
used	O
the	O
concept	O
of	O
ciphers	B-Algorithm
in	O
his	O
writing	O
to	O
symbolize	O
nothingness	O
.	O
</s>
<s>
In	O
another	O
sense	O
,	O
ciphers	B-Algorithm
are	O
important	O
to	O
people	O
who	O
work	O
with	O
numbers	O
,	O
but	O
they	O
do	O
not	O
hold	O
value	O
.	O
</s>
<s>
Simple	O
ciphers	B-Algorithm
were	O
replaced	O
by	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
ciphers	I-Algorithm
(	O
such	O
as	O
the	O
Vigenère	B-Algorithm
)	O
which	O
changed	O
the	O
substitution	O
alphabet	O
for	O
every	O
letter	O
.	O
</s>
<s>
With	O
even	O
a	O
small	O
amount	O
of	O
known	O
or	O
estimated	O
plaintext	O
,	O
simple	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
ciphers	I-Algorithm
and	O
letter	O
transposition	B-Algorithm
ciphers	I-Algorithm
designed	O
for	O
pen	O
and	O
paper	O
encryption	O
are	O
easy	O
to	O
crack	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
create	O
a	O
secure	O
pen	O
and	O
paper	O
cipher	B-Algorithm
based	O
on	O
a	O
one-time	B-Algorithm
pad	I-Algorithm
though	O
,	O
but	O
the	O
usual	O
disadvantages	O
of	O
one-time	B-Algorithm
pads	I-Algorithm
apply	O
.	O
</s>
<s>
During	O
the	O
early	O
twentieth	O
century	O
,	O
electro-mechanical	O
machines	O
were	O
invented	O
to	O
do	O
encryption	O
and	O
decryption	O
using	O
transposition	B-Algorithm
,	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
,	O
and	O
a	O
kind	O
of	O
"	O
additive	O
"	O
substitution	O
.	O
</s>
<s>
In	O
rotor	O
machines	O
,	O
several	O
rotor	O
disks	O
provided	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
,	O
while	O
plug	O
boards	O
provided	O
another	O
substitution	O
.	O
</s>
<s>
Although	O
these	O
encryption	O
methods	O
were	O
more	O
complex	O
than	O
previous	O
schemes	O
and	O
required	O
machines	O
to	O
encrypt	O
and	O
decrypt	O
,	O
other	O
machines	O
such	O
as	O
the	O
British	O
Bombe	B-Device
were	O
invented	O
to	O
crack	O
these	O
encryption	O
methods	O
.	O
</s>
<s>
By	O
type	O
of	O
key	O
used	O
ciphers	B-Algorithm
are	O
divided	O
into	O
:	O
</s>
<s>
asymmetric	B-Application
key	I-Application
algorithms	I-Application
(	O
Public-key	B-Application
cryptography	I-Application
)	O
,	O
where	O
two	O
different	O
keys	O
are	O
used	O
for	O
encryption	O
and	O
decryption	O
.	O
</s>
<s>
In	O
a	O
symmetric	B-Algorithm
key	I-Algorithm
algorithm	I-Algorithm
(	O
e.g.	O
,	O
DES	O
and	O
AES	O
)	O
,	O
the	O
sender	O
and	O
receiver	O
must	O
have	O
a	O
shared	B-Algorithm
key	I-Algorithm
set	O
up	O
in	O
advance	O
and	O
kept	O
secret	O
from	O
all	O
other	O
parties	O
;	O
the	O
sender	O
uses	O
this	O
key	O
for	O
encryption	O
,	O
and	O
the	O
receiver	O
uses	O
the	O
same	O
key	O
for	O
decryption	O
.	O
</s>
<s>
AES	O
’s	O
designer	O
’s	O
claim	O
that	O
the	O
common	O
means	O
of	O
modern	O
cipher	B-Algorithm
cryptanalytic	O
attacks	O
are	O
ineffective	O
against	O
AES	O
due	O
to	O
its	O
design	O
structure	O
.	O
</s>
<s>
Ciphers	B-Algorithm
can	O
be	O
distinguished	O
into	O
two	O
types	O
by	O
the	O
type	O
of	O
input	O
data	O
:	O
</s>
<s>
stream	B-Algorithm
ciphers	I-Algorithm
,	O
which	O
encrypt	O
continuous	O
streams	O
of	O
data	O
.	O
</s>
<s>
In	O
a	O
pure	O
mathematical	O
attack	O
,	O
(	O
i.e.	O
,	O
lacking	O
any	O
other	O
information	O
to	O
help	O
break	O
a	O
cipher	B-Algorithm
)	O
two	O
factors	O
above	O
all	O
count	O
:	O
</s>
<s>
An	O
adversary	O
can	O
use	O
multiple	O
computers	O
at	O
once	O
,	O
for	O
instance	O
,	O
to	O
increase	O
the	O
speed	O
of	O
exhaustive	B-Algorithm
search	I-Algorithm
for	O
a	O
key	O
(	O
i.e.	O
,	O
"	O
brute	O
force	O
"	O
attack	O
)	O
substantially	O
.	O
</s>
<s>
As	O
the	O
key	O
size	O
increases	O
,	O
so	O
does	O
the	O
complexity	O
of	O
exhaustive	B-Algorithm
search	I-Algorithm
to	O
the	O
point	O
where	O
it	O
becomes	O
impractical	O
to	O
crack	O
encryption	O
directly	O
.	O
</s>
<s>
An	O
example	O
of	O
this	O
process	O
can	O
be	O
found	O
at	O
which	O
uses	O
multiple	O
reports	O
to	O
suggest	O
that	O
a	O
symmetrical	O
cipher	B-Algorithm
with	O
128	O
bits	O
,	O
an	O
asymmetric	B-Application
cipher	I-Application
with	O
3072	O
bit	O
keys	O
,	O
and	O
an	O
elliptic	O
curve	O
cipher	B-Algorithm
with	O
256	O
bits	O
,	O
all	O
have	O
similar	O
difficulty	O
at	O
present	O
.	O
</s>
<s>
Claude	O
Shannon	O
proved	O
,	O
using	O
information	O
theory	O
considerations	O
,	O
that	O
any	O
theoretically	O
unbreakable	O
cipher	B-Algorithm
must	O
have	O
keys	O
which	O
are	O
at	O
least	O
as	O
long	O
as	O
the	O
plaintext	O
,	O
and	O
used	O
only	O
once	O
:	O
one-time	B-Algorithm
pad	I-Algorithm
.	O
</s>
