<s>
Blowfish	B-Algorithm
is	O
a	O
symmetric-key	B-Algorithm
block	O
cipher	O
,	O
designed	O
in	O
1993	O
by	O
Bruce	O
Schneier	O
and	O
included	O
in	O
many	O
cipher	O
suites	O
and	O
encryption	O
products	O
.	O
</s>
<s>
Blowfish	B-Algorithm
provides	O
a	O
good	O
encryption	O
rate	O
in	O
software	O
,	O
and	O
no	O
effective	O
cryptanalysis	O
of	O
it	O
has	O
been	O
found	O
to	O
date	O
.	O
</s>
<s>
However	O
,	O
the	O
Advanced	B-Algorithm
Encryption	I-Algorithm
Standard	I-Algorithm
(	O
AES	B-Algorithm
)	O
now	O
receives	O
more	O
attention	O
,	O
and	O
Schneier	O
recommends	O
Twofish	B-Algorithm
for	O
modern	O
applications	O
.	O
</s>
<s>
Schneier	O
designed	O
Blowfish	B-Algorithm
as	O
a	O
general-purpose	O
algorithm	O
,	O
intended	O
as	O
an	O
alternative	O
to	O
the	O
aging	O
DES	B-Algorithm
and	O
free	O
of	O
the	O
problems	O
and	O
constraints	O
associated	O
with	O
other	O
algorithms	O
.	O
</s>
<s>
At	O
the	O
time	O
Blowfish	B-Algorithm
was	O
released	O
,	O
many	O
other	O
designs	O
were	O
proprietary	O
,	O
encumbered	O
by	O
patents	O
,	O
or	O
were	O
commercial	O
or	O
government	O
secrets	O
.	O
</s>
<s>
Schneier	O
has	O
stated	O
that	O
"	O
Blowfish	B-Algorithm
is	O
unpatented	O
,	O
and	O
will	O
remain	O
so	O
in	O
all	O
countries	O
.	O
</s>
<s>
Notable	O
features	O
of	O
the	O
design	O
include	O
key-dependent	O
S-boxes	B-Algorithm
and	O
a	O
highly	O
complex	O
key	B-Algorithm
schedule	I-Algorithm
.	O
</s>
<s>
Blowfish	B-Algorithm
has	O
a	O
64-bit	O
block	O
size	O
and	O
a	O
variable	O
key	O
length	O
from	O
32	O
bits	O
up	O
to	O
448	O
bits	O
.	O
</s>
<s>
It	O
is	O
a	O
16-round	O
Feistel	B-Algorithm
cipher	I-Algorithm
and	O
uses	O
large	O
key-dependent	O
S-boxes	B-Algorithm
.	O
</s>
<s>
In	O
structure	O
it	O
resembles	O
CAST-128	B-Algorithm
,	O
which	O
uses	O
fixed	O
S-boxes	B-Algorithm
.	O
</s>
<s>
The	O
adjacent	O
diagram	O
shows	O
Blowfish	B-Algorithm
's	O
encryption	O
routine	O
.	O
</s>
<s>
There	O
are	O
five	O
subkey-arrays	O
:	O
one	O
18-entry	O
P-array	O
(	O
denoted	O
as	O
K	O
in	O
the	O
diagram	O
,	O
to	O
avoid	O
confusion	O
with	O
the	O
Plaintext	O
)	O
and	O
four	O
256-entry	O
S-boxes	B-Algorithm
(	O
S0	O
,	O
S1	O
,	O
S2	O
and	O
S3	O
)	O
.	O
</s>
<s>
The	O
F-function	B-Algorithm
splits	O
the	O
32-bit	O
input	O
into	O
four	O
8-bit	O
quarters	O
and	O
uses	O
the	O
quarters	O
as	O
input	O
to	O
the	O
S-boxes	B-Algorithm
.	O
</s>
<s>
The	O
S-boxes	B-Algorithm
accept	O
8-bit	O
input	O
and	O
produce	O
32-bit	O
output	O
.	O
</s>
<s>
Blowfish	B-Algorithm
's	O
key	B-Algorithm
schedule	I-Algorithm
starts	O
by	O
initializing	O
the	O
P-array	O
and	O
S-boxes	B-Algorithm
with	O
values	O
derived	O
from	O
the	O
hexadecimal	O
digits	O
of	O
pi	O
,	O
which	O
contain	O
no	O
obvious	O
pattern	O
(	O
see	O
nothing	O
up	O
my	O
sleeve	O
number	O
)	O
.	O
</s>
<s>
This	O
continues	O
,	O
replacing	O
the	O
entire	O
P-array	O
and	O
all	O
the	O
S-box	B-Algorithm
entries	O
.	O
</s>
<s>
In	O
all	O
,	O
the	O
Blowfish	B-Algorithm
encryption	I-Algorithm
algorithm	I-Algorithm
will	O
run	O
521	O
times	O
to	O
generate	O
all	O
the	O
subkeys	O
about	O
4KB	O
of	O
data	O
is	O
processed	O
.	O
</s>
<s>
The	O
reason	O
for	O
that	O
is	O
a	O
discrepancy	O
between	O
the	O
original	O
Blowfish	B-Algorithm
description	O
,	O
which	O
uses	O
448-bit	O
keys	O
,	O
and	O
its	O
reference	O
implementation	O
,	O
which	O
uses	O
576-bit	O
keys	O
.	O
</s>
<s>
When	O
asked	O
which	O
Blowfish	B-Algorithm
version	O
is	O
the	O
correct	O
one	O
,	O
Bruce	O
Schneier	O
answered	O
:	O
"	O
The	O
test	O
vectors	O
should	O
be	O
used	O
to	O
determine	O
the	O
one	O
true	O
Blowfish	B-Algorithm
"	O
.	O
</s>
<s>
Blowfish	B-Algorithm
is	O
a	O
fast	O
block	O
cipher	O
,	O
except	O
when	O
changing	O
keys	O
.	O
</s>
<s>
In	O
one	O
application	O
Blowfish	B-Algorithm
's	O
slow	O
key	O
changing	O
is	O
actually	O
a	O
benefit	O
:	O
the	O
password-hashing	O
method	O
(	O
crypt	O
$2	O
,	O
i.e.	O
</s>
<s>
bcrypt	B-Algorithm
)	O
used	O
in	O
OpenBSD	B-Operating_System
uses	O
an	O
algorithm	O
derived	O
from	O
Blowfish	B-Algorithm
that	O
makes	O
use	O
of	O
the	O
slow	O
key	B-Algorithm
schedule	I-Algorithm
;	O
the	O
idea	O
is	O
that	O
the	O
extra	O
computational	O
effort	O
required	O
gives	O
protection	O
against	O
dictionary	O
attacks	O
.	O
</s>
<s>
Blowfish	B-Algorithm
has	O
a	O
memory	O
footprint	O
of	O
just	O
over	O
4	O
kilobytes	O
of	O
RAM	B-Architecture
.	O
</s>
<s>
This	O
constraint	O
is	O
not	O
a	O
problem	O
even	O
for	O
older	O
desktop	O
and	O
laptop	B-Device
computers	I-Device
,	O
though	O
it	O
does	O
prevent	O
use	O
in	O
the	O
smallest	O
embedded	B-Architecture
systems	I-Architecture
such	O
as	O
early	O
smartcards	O
.	O
</s>
<s>
Blowfish	B-Algorithm
was	O
one	O
of	O
the	O
first	O
secure	O
block	O
ciphers	O
not	O
subject	O
to	O
any	O
patents	O
and	O
therefore	O
freely	O
available	O
for	O
anyone	O
to	O
use	O
.	O
</s>
<s>
bcrypt	B-Algorithm
is	O
a	O
password	O
hashing	O
function	O
which	O
,	O
combined	O
with	O
a	O
variable	O
number	O
of	O
iterations	O
(	O
work	O
"	O
cost	O
"	O
)	O
,	O
exploits	O
the	O
expensive	O
key	O
setup	O
phase	O
of	O
Blowfish	B-Algorithm
to	O
increase	O
the	O
workload	O
and	O
duration	O
of	O
hash	O
calculations	O
,	O
further	O
reducing	O
threats	O
from	O
brute	O
force	O
attacks	O
.	O
</s>
<s>
bcrypt	B-Algorithm
is	O
also	O
the	O
name	O
of	O
a	O
cross-platform	O
file	O
encryption	O
utility	O
developed	O
in	O
2002	O
that	O
implements	O
Blowfish	B-Algorithm
.	O
</s>
<s>
Blowfish	B-Algorithm
's	O
use	O
of	O
a	O
64-bit	O
block	O
size	O
(	O
as	O
opposed	O
to	O
e.g.	O
</s>
<s>
AES	B-Algorithm
's	O
128-bit	O
block	O
size	O
)	O
makes	O
it	O
vulnerable	O
to	O
birthday	O
attacks	O
,	O
particularly	O
in	O
contexts	O
like	O
HTTPS	B-Protocol
.	O
</s>
<s>
The	O
GnuPG	B-Application
project	O
recommends	O
that	O
Blowfish	B-Algorithm
not	O
be	O
used	O
to	O
encrypt	O
files	O
larger	O
than	O
4	O
GB	O
due	O
to	O
its	O
small	O
block	O
size	O
.	O
</s>
<s>
A	O
reduced-round	O
variant	O
of	O
Blowfish	B-Algorithm
is	O
known	O
to	O
be	O
susceptible	O
to	O
known-plaintext	O
attacks	O
on	O
reflectively	O
weak	O
keys	O
.	O
</s>
<s>
Blowfish	B-Algorithm
implementations	O
use	O
16	O
rounds	O
of	O
encryption	O
,	O
and	O
are	O
not	O
susceptible	O
to	O
this	O
attack	O
.	O
</s>
<s>
Bruce	O
Schneier	O
has	O
recommended	O
migrating	O
to	O
his	O
Blowfish	B-Algorithm
successor	O
,	O
Twofish	B-Algorithm
.	O
</s>
