<s>
A	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
(	O
CHF	O
)	O
is	O
a	O
hash	B-Error_Name
algorithm	I-Error_Name
(	O
a	O
map	B-Algorithm
of	O
an	O
arbitrary	O
binary	O
string	O
to	O
a	O
binary	O
string	O
with	O
fixed	O
size	O
of	O
bits	O
)	O
that	O
has	O
special	O
properties	O
desirable	O
for	O
a	O
cryptographic	O
application	O
:	O
</s>
<s>
the	O
probability	O
of	O
a	O
particular	O
-bit	O
output	O
result	O
(	O
hash	B-Error_Name
value	I-Error_Name
)	O
for	O
a	O
random	O
input	O
string	O
(	O
"	O
message	O
"	O
)	O
is	O
(	O
like	O
for	O
any	O
good	O
hash	B-Error_Name
)	O
,	O
so	O
the	O
hash	B-Error_Name
value	I-Error_Name
can	O
be	O
used	O
as	O
a	O
representative	O
of	O
the	O
message	O
;	O
</s>
<s>
finding	O
an	O
input	O
string	O
that	O
matches	O
a	O
given	O
hash	B-Error_Name
value	I-Error_Name
(	O
a	O
pre-image	O
)	O
is	O
unfeasible	O
,	O
unless	O
the	O
value	O
is	O
selected	O
from	O
a	O
known	O
pre-calculated	O
dictionary	O
(	O
"	O
rainbow	B-Algorithm
table	I-Algorithm
"	O
)	O
.	O
</s>
<s>
The	O
resistance	O
to	O
such	O
search	O
is	O
quantified	O
as	O
security	O
strength	O
,	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
with	O
bits	O
of	O
hash	B-Error_Name
value	I-Error_Name
is	O
expected	O
to	O
have	O
a	O
preimage	O
resistance	O
strength	O
of	O
bits	O
.	O
</s>
<s>
A	O
second	O
preimage	O
resistance	O
strength	O
,	O
with	O
the	O
same	O
expectations	O
,	O
refers	O
to	O
a	O
similar	O
problem	O
of	O
finding	O
a	O
second	O
message	O
that	O
matches	O
the	O
given	O
hash	B-Error_Name
value	I-Error_Name
when	O
one	O
message	O
is	O
already	O
known	O
;	O
</s>
<s>
finding	O
any	O
pair	O
of	O
different	O
messages	O
that	O
yield	O
the	O
same	O
hash	B-Error_Name
value	I-Error_Name
(	O
a	O
collision	O
)	O
is	O
also	O
unfeasible	O
,	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
is	O
expected	O
to	O
have	O
a	O
collision	O
resistance	O
strength	O
of	O
bits	O
(	O
lower	O
due	O
to	O
the	O
birthday	O
paradox	O
)	O
.	O
</s>
<s>
Cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
have	O
many	O
information-security	O
applications	O
,	O
notably	O
in	O
digital	O
signatures	O
,	O
message	B-Algorithm
authentication	I-Algorithm
codes	I-Algorithm
(	O
MACs	O
)	O
,	O
and	O
other	O
forms	O
of	O
authentication	O
.	O
</s>
<s>
They	O
can	O
also	O
be	O
used	O
as	O
ordinary	O
hash	B-Error_Name
functions	I-Error_Name
,	O
to	O
index	O
data	O
in	O
hash	B-Algorithm
tables	I-Algorithm
,	O
for	O
fingerprinting	B-Algorithm
,	O
to	O
detect	O
duplicate	O
data	O
or	O
uniquely	O
identify	O
files	O
,	O
and	O
as	O
checksums	B-Algorithm
to	O
detect	O
accidental	O
data	O
corruption	O
.	O
</s>
<s>
Indeed	O
,	O
in	O
information-security	O
contexts	O
,	O
cryptographic	B-Algorithm
hash	I-Algorithm
values	I-Algorithm
are	O
sometimes	O
called	O
(	O
digital	O
)	O
fingerprints	B-Algorithm
,	O
checksums	B-Algorithm
,	O
or	O
just	O
hash	B-Error_Name
values	I-Error_Name
,	O
even	O
though	O
all	O
these	O
terms	O
stand	O
for	O
more	O
general	O
functions	O
with	O
rather	O
different	O
properties	O
and	O
purposes	O
.	O
</s>
<s>
Most	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
are	O
designed	O
to	O
take	O
a	O
string	O
of	O
any	O
length	O
as	O
input	O
and	O
produce	O
a	O
fixed-length	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
A	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
must	O
be	O
able	O
to	O
withstand	O
all	O
known	O
types	O
of	O
cryptanalytic	O
attack	O
.	O
</s>
<s>
In	O
theoretical	O
cryptography	O
,	O
the	O
security	O
level	O
of	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
has	O
been	O
defined	O
using	O
the	O
following	O
properties	O
:	O
</s>
<s>
Pre-image	O
resistance	O
Given	O
a	O
hash	B-Error_Name
value	I-Error_Name
,	O
it	O
should	O
be	O
difficult	O
to	O
find	O
any	O
message	O
such	O
that	O
.	O
</s>
<s>
Such	O
a	O
pair	O
is	O
called	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
collision	I-Algorithm
.	O
</s>
<s>
It	O
requires	O
a	O
hash	B-Error_Name
value	I-Error_Name
at	O
least	O
twice	O
as	O
long	O
as	O
that	O
required	O
for	O
pre-image	O
resistance	O
;	O
otherwise	O
collisions	O
may	O
be	O
found	O
by	O
a	O
birthday	O
attack	O
.	O
</s>
<s>
The	O
weaker	O
assumption	O
is	O
always	O
preferred	O
in	O
theoretical	O
cryptography	O
,	O
but	O
in	O
practice	O
,	O
a	O
hash-function	O
which	O
is	O
only	O
second	O
pre-image	O
resistant	O
is	O
considered	O
insecure	O
and	O
is	O
therefore	O
not	O
recommended	O
for	O
real	O
applications	O
.	O
</s>
<s>
Informally	O
,	O
these	O
properties	O
mean	O
that	O
a	O
malicious	B-General_Concept
adversary	I-General_Concept
cannot	O
replace	O
or	O
modify	O
the	O
input	O
data	O
without	O
changing	O
its	O
digest	O
.	O
</s>
<s>
Second	O
pre-image	O
resistance	O
prevents	O
an	O
attacker	O
from	O
crafting	O
a	O
document	O
with	O
the	O
same	O
hash	B-Error_Name
as	O
a	O
document	O
the	O
attacker	O
cannot	O
control	O
.	O
</s>
<s>
Collision	O
resistance	O
prevents	O
an	O
attacker	O
from	O
creating	O
two	O
distinct	O
documents	O
with	O
the	O
same	O
hash	B-Error_Name
.	O
</s>
<s>
Currently	O
,	O
popular	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
are	O
vulnerable	O
to	O
length-extension	O
attacks	O
:	O
given	O
and	O
but	O
not	O
,	O
by	O
choosing	O
a	O
suitable	O
an	O
attacker	O
can	O
calculate	O
,	O
where	O
∥	O
denotes	O
concatenation	O
.	O
</s>
<s>
This	O
property	O
can	O
be	O
used	O
to	O
break	O
naive	O
authentication	O
schemes	O
based	O
on	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
The	O
HMAC	B-Algorithm
construction	O
works	O
around	O
these	O
problems	O
.	O
</s>
<s>
In	O
addition	O
to	O
collision	O
resistance	O
,	O
it	O
should	O
be	O
impossible	O
for	O
an	O
adversary	B-General_Concept
to	O
find	O
two	O
messages	O
with	O
substantially	O
similar	O
digests	O
;	O
or	O
to	O
infer	O
any	O
useful	O
information	O
about	O
the	O
data	O
,	O
given	O
only	O
its	O
digest	O
.	O
</s>
<s>
In	O
particular	O
,	O
a	O
hash	B-Error_Name
function	I-Error_Name
should	O
behave	O
as	O
much	O
as	O
possible	O
like	O
a	O
random	O
function	O
(	O
often	O
called	O
a	O
random	B-Application
oracle	I-Application
in	O
proofs	O
of	O
security	O
)	O
while	O
still	O
being	O
deterministic	O
and	O
efficiently	O
computable	O
.	O
</s>
<s>
This	O
rules	O
out	O
functions	O
like	O
the	O
SWIFFT	B-Algorithm
function	O
,	O
which	O
can	O
be	O
rigorously	O
proven	O
to	O
be	O
collision-resistant	O
assuming	O
that	O
certain	O
problems	O
on	O
ideal	O
lattices	O
are	O
computationally	O
difficult	O
,	O
but	O
,	O
as	O
a	O
linear	O
function	O
,	O
does	O
not	O
satisfy	O
these	O
additional	O
properties	O
.	O
</s>
<s>
Checksum	B-Algorithm
algorithms	I-Algorithm
,	O
such	O
as	O
CRC32	O
and	O
other	O
cyclic	O
redundancy	O
checks	O
,	O
are	O
designed	O
to	O
meet	O
much	O
weaker	O
requirements	O
and	O
are	O
generally	O
unsuitable	O
as	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
a	O
CRC	O
was	O
used	O
for	O
message	O
integrity	O
in	O
the	O
WEP	B-Protocol
encryption	O
standard	O
,	O
but	O
an	O
attack	O
was	O
readily	O
discovered	O
,	O
which	O
exploited	O
the	O
linearity	O
of	O
the	O
checksum	B-Algorithm
.	O
</s>
<s>
In	O
cryptographic	O
practice	O
,	O
"	O
difficult	O
"	O
generally	O
means	O
"	O
almost	O
certainly	O
beyond	O
the	O
reach	O
of	O
any	O
adversary	B-General_Concept
who	O
must	O
be	O
prevented	O
from	O
breaking	O
the	O
system	O
for	O
as	O
long	O
as	O
the	O
security	O
of	O
the	O
system	O
is	O
deemed	O
important	O
"	O
.	O
</s>
<s>
For	O
messages	O
selected	O
from	O
a	O
limited	O
set	O
of	O
messages	O
,	O
for	O
example	O
passwords	O
or	O
other	O
short	O
messages	O
,	O
it	O
can	O
be	O
feasible	O
to	O
invert	O
a	O
hash	B-Error_Name
by	O
trying	O
all	O
possible	O
messages	O
in	O
the	O
set	O
.	O
</s>
<s>
Because	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
are	O
typically	O
designed	O
to	O
be	O
computed	O
quickly	O
,	O
special	O
key	B-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
that	O
require	O
greater	O
computing	O
resources	O
have	O
been	O
developed	O
that	O
make	O
such	O
brute-force	O
attacks	O
more	O
difficult	O
.	O
</s>
<s>
Such	O
interpretations	O
of	O
difficulty	O
are	O
important	O
in	O
the	O
study	O
of	O
provably	O
secure	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
but	O
do	O
not	O
usually	O
have	O
a	O
strong	O
connection	O
to	O
practical	O
security	O
.	O
</s>
<s>
Rather	O
than	O
storing	O
the	O
password	O
in	O
plain	O
text	O
,	O
which	O
would	O
make	O
it	O
vulnerable	O
to	O
theft	O
in	O
the	O
event	O
of	O
a	O
data	O
breach	O
,	O
the	O
website	O
will	O
typically	O
use	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
to	O
generate	O
a	O
unique	O
hash	B-Error_Name
of	O
the	O
password	O
.	O
</s>
<s>
An	O
illustration	O
of	O
the	O
potential	O
use	O
of	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
is	O
as	O
follows	O
:	O
Alice	O
poses	O
a	O
tough	O
math	O
problem	O
to	O
Bob	O
and	O
claims	O
that	O
she	O
has	O
solved	O
it	O
.	O
</s>
<s>
Therefore	O
,	O
Alice	O
writes	O
down	O
her	O
solution	O
,	O
computes	O
its	O
hash	B-Error_Name
,	O
and	O
tells	O
Bob	O
the	O
hash	B-Error_Name
value	I-Error_Name
(	O
whilst	O
keeping	O
the	O
solution	O
secret	O
)	O
.	O
</s>
<s>
Then	O
,	O
when	O
Bob	O
comes	O
up	O
with	O
the	O
solution	O
himself	O
a	O
few	O
days	O
later	O
,	O
Alice	O
can	O
prove	O
that	O
she	O
had	O
the	O
solution	O
earlier	O
by	O
revealing	O
it	O
and	O
having	O
Bob	O
hash	B-Error_Name
it	O
and	O
check	O
that	O
it	O
matches	O
the	O
hash	B-Error_Name
value	I-Error_Name
given	O
to	O
him	O
before	O
.	O
</s>
<s>
An	O
important	O
application	O
of	O
secure	O
hashes	B-Error_Name
is	O
the	O
verification	O
of	O
message	O
integrity	O
.	O
</s>
<s>
Comparing	O
message	B-Algorithm
digests	I-Algorithm
(	O
hash	B-Error_Name
digests	O
over	O
the	O
message	O
)	O
calculated	O
before	O
,	O
and	O
after	O
,	O
transmission	O
can	O
determine	O
whether	O
any	O
changes	O
have	O
been	O
made	O
to	O
the	O
message	O
or	O
file	B-Operating_System
.	O
</s>
<s>
MD5	B-Algorithm
,	O
SHA-1	B-Algorithm
,	O
or	O
SHA-2	B-Algorithm
hash	B-Error_Name
digests	O
are	O
sometimes	O
published	O
on	O
websites	O
or	O
forums	O
to	O
allow	O
verification	O
of	O
integrity	O
for	O
downloaded	O
files	O
,	O
including	O
files	O
retrieved	O
using	O
file	B-Operating_System
sharing	O
such	O
as	O
mirroring	O
.	O
</s>
<s>
This	O
practice	O
establishes	O
a	O
chain	O
of	O
trust	O
as	O
long	O
as	O
the	O
hashes	B-Error_Name
are	O
posted	O
on	O
a	O
trusted	O
site	O
–	O
usually	O
the	O
originating	O
site	O
–	O
authenticated	O
by	O
HTTPS	B-Protocol
.	O
</s>
<s>
Using	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
and	O
a	O
chain	O
of	O
trust	O
detects	O
malicious	O
changes	O
to	O
the	O
file	B-Operating_System
.	O
</s>
<s>
Non-cryptographic	O
error-detecting	B-Error_Name
codes	I-Error_Name
such	O
as	O
cyclic	O
redundancy	O
checks	O
only	O
prevent	O
against	O
non-malicious	O
alterations	O
of	O
the	O
file	B-Operating_System
,	O
since	O
an	O
intentional	O
spoof	O
can	O
readily	O
be	O
crafted	O
to	O
have	O
the	O
colliding	B-Algorithm
code	I-Algorithm
value	O
.	O
</s>
<s>
Almost	O
all	O
digital	O
signature	O
schemes	O
require	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
to	O
be	O
calculated	O
over	O
the	O
message	O
.	O
</s>
<s>
This	O
allows	O
the	O
signature	O
calculation	O
to	O
be	O
performed	O
on	O
the	O
relatively	O
small	O
,	O
statically	O
sized	O
hash	B-Error_Name
digest	O
.	O
</s>
<s>
The	O
message	O
is	O
considered	O
authentic	O
if	O
the	O
signature	O
verification	O
succeeds	O
given	O
the	O
signature	O
and	O
recalculated	O
hash	B-Error_Name
digest	O
over	O
the	O
message	O
.	O
</s>
<s>
So	O
the	O
message	O
integrity	O
property	O
of	O
the	O
cryptographic	B-Algorithm
hash	I-Algorithm
is	O
used	O
to	O
create	O
secure	O
and	O
efficient	O
digital	O
signature	O
schemes	O
.	O
</s>
<s>
Password	O
verification	O
commonly	O
relies	O
on	O
cryptographic	B-Algorithm
hashes	I-Algorithm
.	O
</s>
<s>
Storing	O
all	O
user	O
passwords	O
as	O
cleartext	O
can	O
result	O
in	O
a	O
massive	O
security	O
breach	O
if	O
the	O
password	O
file	B-Operating_System
is	O
compromised	O
.	O
</s>
<s>
One	O
way	O
to	O
reduce	O
this	O
danger	O
is	O
to	O
only	O
store	O
the	O
hash	B-Error_Name
digest	O
of	O
each	O
password	O
.	O
</s>
<s>
To	O
authenticate	O
a	O
user	O
,	O
the	O
password	O
presented	O
by	O
the	O
user	O
is	O
hashed	O
and	O
compared	O
with	O
the	O
stored	O
hash	B-Error_Name
.	O
</s>
<s>
A	O
password	O
reset	O
method	O
is	O
required	O
when	O
password	O
hashing	O
is	O
performed	O
;	O
original	O
passwords	O
cannot	O
be	O
recalculated	O
from	O
the	O
stored	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
Standard	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
are	O
designed	O
to	O
be	O
computed	O
quickly	O
,	O
and	O
,	O
as	O
a	O
result	O
,	O
it	O
is	O
possible	O
to	O
try	O
guessed	O
passwords	O
at	O
high	O
rates	O
.	O
</s>
<s>
Common	O
graphics	B-Architecture
processing	I-Architecture
units	I-Architecture
can	O
try	O
billions	O
of	O
possible	O
passwords	O
each	O
second	O
.	O
</s>
<s>
Password	B-Algorithm
hash	I-Algorithm
functions	O
that	O
perform	O
key	O
stretching	O
–	O
such	O
as	O
PBKDF2	O
,	O
scrypt	B-Algorithm
or	O
Argon2	B-Algorithm
–	O
commonly	O
use	O
repeated	O
invocations	O
of	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
to	O
increase	O
the	O
time	O
(	O
and	O
in	O
some	O
cases	O
computer	O
memory	O
)	O
required	O
to	O
perform	O
brute-force	O
attacks	O
on	O
stored	O
password	B-Algorithm
hash	I-Algorithm
digests	O
.	O
</s>
<s>
A	O
password	B-Algorithm
hash	I-Algorithm
requires	O
the	O
use	O
of	O
a	O
large	O
random	O
,	O
non-secret	O
salt	O
value	O
which	O
can	O
be	O
stored	O
with	O
the	O
password	B-Algorithm
hash	I-Algorithm
.	O
</s>
<s>
The	O
salt	O
randomizes	O
the	O
output	O
of	O
the	O
password	B-Algorithm
hash	I-Algorithm
,	O
making	O
it	O
impossible	O
for	O
an	O
adversary	B-General_Concept
to	O
store	O
tables	O
of	O
passwords	O
and	O
precomputed	O
hash	B-Error_Name
values	I-Error_Name
to	O
which	O
the	O
password	B-Algorithm
hash	I-Algorithm
digest	O
can	O
be	O
compared	O
.	O
</s>
<s>
One	O
popular	O
system	O
–	O
used	O
in	O
Bitcoin	O
mining	O
and	O
Hashcash	O
–	O
uses	O
partial	O
hash	B-Error_Name
inversions	O
to	O
prove	O
that	O
work	O
was	O
done	O
,	O
to	O
unlock	O
a	O
mining	O
reward	O
in	O
Bitcoin	O
,	O
and	O
as	O
a	O
good-will	O
token	O
to	O
send	O
an	O
e-mail	O
in	O
Hashcash	O
.	O
</s>
<s>
The	O
sender	O
is	O
required	O
to	O
find	O
a	O
message	O
whose	O
hash	B-Error_Name
value	I-Error_Name
begins	O
with	O
a	O
number	O
of	O
zero	O
bits	O
.	O
</s>
<s>
The	O
average	O
work	O
that	O
the	O
sender	O
needs	O
to	O
perform	O
in	O
order	O
to	O
find	O
a	O
valid	O
message	O
is	O
exponential	O
in	O
the	O
number	O
of	O
zero	O
bits	O
required	O
in	O
the	O
hash	B-Error_Name
value	I-Error_Name
,	O
while	O
the	O
recipient	O
can	O
verify	O
the	O
validity	O
of	O
the	O
message	O
by	O
executing	O
a	O
single	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
Hashcash	O
,	O
a	O
sender	O
is	O
asked	O
to	O
generate	O
a	O
header	O
whose	O
160-bit	O
SHA-1	B-Algorithm
hash	I-Algorithm
value	O
has	O
the	O
first	O
20	O
bits	O
as	O
zeros	O
.	O
</s>
<s>
A	O
message	B-Algorithm
digest	I-Algorithm
can	O
also	O
serve	O
as	O
a	O
means	O
of	O
reliably	O
identifying	O
a	O
file	B-Operating_System
;	O
several	O
source	B-Architecture
code	I-Architecture
management	I-Architecture
systems	O
,	O
including	O
Git	B-Application
,	O
Mercurial	B-Protocol
and	O
Monotone	B-Application
,	O
use	O
the	O
sha1sum	O
of	O
various	O
types	O
of	O
content	O
(	O
file	B-Operating_System
content	O
,	O
directory	O
trees	O
,	O
ancestry	O
information	O
,	O
etc	O
.	O
)	O
</s>
<s>
Hashes	B-Error_Name
are	O
used	O
to	O
identify	O
files	O
on	O
peer-to-peer	O
filesharing	O
networks	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
an	O
ed2k	B-Protocol
link	I-Protocol
,	O
an	O
MD4-variant	O
hash	B-Error_Name
is	O
combined	O
with	O
the	O
file	B-Operating_System
size	O
,	O
providing	O
sufficient	O
information	O
for	O
locating	O
file	B-Operating_System
sources	O
,	O
downloading	O
the	O
file	B-Operating_System
,	O
and	O
verifying	O
its	O
contents	O
.	O
</s>
<s>
Magnet	B-Protocol
links	I-Protocol
are	O
another	O
example	O
.	O
</s>
<s>
Such	O
file	B-Operating_System
hashes	B-Error_Name
are	O
often	O
the	O
top	O
hash	B-Error_Name
of	O
a	O
hash	B-Algorithm
list	I-Algorithm
or	O
a	O
hash	B-Algorithm
tree	I-Algorithm
which	O
allows	O
for	O
additional	O
benefits	O
.	O
</s>
<s>
One	O
of	O
the	O
main	O
applications	O
of	O
a	O
hash	B-Error_Name
function	I-Error_Name
is	O
to	O
allow	O
the	O
fast	O
look-up	O
of	O
data	O
in	O
a	O
hash	B-Algorithm
table	I-Algorithm
.	O
</s>
<s>
Being	O
hash	B-Error_Name
functions	I-Error_Name
of	O
a	O
particular	O
kind	O
,	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
lend	O
themselves	O
well	O
to	O
this	O
application	O
too	O
.	O
</s>
<s>
However	O
,	O
compared	O
with	O
standard	O
hash	B-Error_Name
functions	I-Error_Name
,	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
tend	O
to	O
be	O
much	O
more	O
expensive	O
computationally	O
.	O
</s>
<s>
There	O
are	O
several	O
methods	O
to	O
use	O
a	O
block	O
cipher	O
to	O
build	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
,	O
specifically	O
a	O
one-way	B-Algorithm
compression	I-Algorithm
function	I-Algorithm
.	O
</s>
<s>
The	O
methods	O
resemble	O
the	O
block	B-Algorithm
cipher	I-Algorithm
modes	I-Algorithm
of	I-Algorithm
operation	I-Algorithm
usually	O
used	O
for	O
encryption	O
.	O
</s>
<s>
Many	O
well-known	O
hash	B-Error_Name
functions	I-Error_Name
,	O
including	O
MD4	B-Algorithm
,	O
MD5	B-Algorithm
,	O
SHA-1	B-Algorithm
and	O
SHA-2	B-Algorithm
,	O
are	O
built	O
from	O
block-cipher-like	O
components	O
designed	O
for	O
the	O
purpose	O
,	O
with	O
feedback	O
to	O
ensure	O
that	O
the	O
resulting	O
function	O
is	O
not	O
invertible	O
.	O
</s>
<s>
SHA-3	B-Algorithm
finalists	O
included	O
functions	O
with	O
block-cipher-like	O
components	O
(	O
e.g.	O
,	O
Skein	B-Algorithm
,	O
BLAKE	B-Algorithm
)	O
though	O
the	O
function	O
finally	O
selected	O
,	O
Keccak	B-Algorithm
,	O
was	O
built	O
on	O
a	O
cryptographic	B-Algorithm
sponge	I-Algorithm
instead	O
.	O
</s>
<s>
A	O
standard	O
block	O
cipher	O
such	O
as	O
AES	B-Algorithm
can	O
be	O
used	O
in	O
place	O
of	O
these	O
custom	O
block	O
ciphers	O
;	O
that	O
might	O
be	O
useful	O
when	O
an	O
embedded	B-Architecture
system	I-Architecture
needs	O
to	O
implement	O
both	O
encryption	O
and	O
hashing	O
with	O
minimal	O
code	O
size	O
or	O
hardware	O
area	O
.	O
</s>
<s>
The	O
ciphers	O
in	O
hash	B-Error_Name
functions	I-Error_Name
are	O
built	O
for	O
hashing	O
:	O
they	O
use	O
large	O
keys	O
and	O
blocks	O
,	O
can	O
efficiently	O
change	O
keys	O
every	O
block	O
,	O
and	O
have	O
been	O
designed	O
and	O
vetted	O
for	O
resistance	O
to	O
related-key	O
attacks	O
.	O
</s>
<s>
In	O
particular	O
,	O
AES	B-Algorithm
has	O
key	O
and	O
block	O
sizes	O
that	O
make	O
it	O
nontrivial	O
to	O
use	O
to	O
generate	O
long	O
hash	B-Error_Name
values	I-Error_Name
;	O
AES	B-Algorithm
encryption	I-Algorithm
becomes	O
less	O
efficient	O
when	O
the	O
key	O
changes	O
each	O
block	O
;	O
and	O
related-key	O
attacks	O
make	O
it	O
potentially	O
less	O
secure	O
for	O
use	O
in	O
a	O
hash	B-Error_Name
function	I-Error_Name
than	O
for	O
encryption	O
.	O
</s>
<s>
A	O
hash	B-Error_Name
function	I-Error_Name
must	O
be	O
able	O
to	O
process	O
an	O
arbitrary-length	O
message	O
into	O
a	O
fixed-length	O
output	O
.	O
</s>
<s>
This	O
can	O
be	O
achieved	O
by	O
breaking	O
the	O
input	O
up	O
into	O
a	O
series	O
of	O
equally	O
sized	O
blocks	O
,	O
and	O
operating	O
on	O
them	O
in	O
sequence	O
using	O
a	O
one-way	B-Algorithm
compression	I-Algorithm
function	I-Algorithm
.	O
</s>
<s>
A	O
hash	B-Error_Name
function	I-Error_Name
built	O
with	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
is	O
as	O
resistant	O
to	O
collisions	O
as	O
is	O
its	O
compression	O
function	O
;	O
any	O
collision	O
for	O
the	O
full	O
hash	B-Error_Name
function	I-Error_Name
can	O
be	O
traced	O
back	O
to	O
a	O
collision	O
in	O
the	O
compression	O
function	O
.	O
</s>
<s>
The	O
last	O
block	O
processed	O
should	O
also	O
be	O
unambiguously	O
length	B-Algorithm
padded	I-Algorithm
;	O
this	O
is	O
crucial	O
to	O
the	O
security	O
of	O
this	O
construction	O
.	O
</s>
<s>
This	O
construction	O
is	O
called	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
.	O
</s>
<s>
Most	O
common	O
classical	O
hash	B-Error_Name
functions	I-Error_Name
,	O
including	O
SHA-1	B-Algorithm
and	O
MD5	B-Algorithm
,	O
take	O
this	O
form	O
.	O
</s>
<s>
A	O
straightforward	O
application	O
of	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
,	O
where	O
the	O
size	O
of	O
hash	B-Error_Name
output	O
is	O
equal	O
to	O
the	O
internal	O
state	O
size	O
(	O
between	O
each	O
compression	O
step	O
)	O
,	O
results	O
in	O
a	O
narrow-pipe	O
hash	B-Error_Name
design	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
modern	O
hash	B-Error_Name
functions	I-Error_Name
are	O
built	O
on	O
wide-pipe	O
constructions	O
that	O
have	O
a	O
larger	O
internal	O
state	O
size	O
–	O
which	O
range	O
from	O
tweaks	O
of	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
to	O
new	O
constructions	O
such	O
as	O
the	O
sponge	B-Algorithm
construction	I-Algorithm
and	O
HAIFA	B-Algorithm
construction	I-Algorithm
.	O
</s>
<s>
None	O
of	O
the	O
entrants	O
in	O
the	O
NIST	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
competition	I-Algorithm
use	O
a	O
classical	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
.	O
</s>
<s>
Meanwhile	O
,	O
truncating	O
the	O
output	O
of	O
a	O
longer	O
hash	B-Error_Name
,	O
such	O
as	O
used	O
in	O
SHA-512/256	B-Algorithm
,	O
also	O
defeats	O
many	O
of	O
these	O
attacks	O
.	O
</s>
<s>
Hash	B-Error_Name
functions	I-Error_Name
can	O
be	O
used	O
to	O
build	O
other	O
cryptographic	O
primitives	O
.	O
</s>
<s>
Message	B-Algorithm
authentication	I-Algorithm
codes	I-Algorithm
(	O
MACs	O
)	O
(	O
also	O
called	O
keyed	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
)	O
are	O
often	O
built	O
from	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
HMAC	B-Algorithm
is	O
such	O
a	O
MAC	O
.	O
</s>
<s>
Just	O
as	O
block	O
ciphers	O
can	O
be	O
used	O
to	O
build	O
hash	B-Error_Name
functions	I-Error_Name
,	O
hash	B-Error_Name
functions	I-Error_Name
can	O
be	O
used	O
to	O
build	O
block	O
ciphers	O
.	O
</s>
<s>
Luby-Rackoff	B-Algorithm
constructions	I-Algorithm
using	O
hash	B-Error_Name
functions	I-Error_Name
can	O
be	O
provably	O
secure	O
if	O
the	O
underlying	O
hash	B-Error_Name
function	I-Error_Name
is	O
secure	O
.	O
</s>
<s>
Also	O
,	O
many	O
hash	B-Error_Name
functions	I-Error_Name
(	O
including	O
SHA-1	B-Algorithm
and	O
SHA-2	B-Algorithm
)	O
are	O
built	O
by	O
using	O
a	O
special-purpose	O
block	O
cipher	O
in	O
a	O
Davies	O
–	O
Meyer	O
or	O
other	O
construction	O
.	O
</s>
<s>
That	O
cipher	O
can	O
also	O
be	O
used	O
in	O
a	O
conventional	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
,	O
without	O
the	O
same	O
security	O
guarantees	O
;	O
for	O
example	O
,	O
SHACAL	B-Algorithm
,	O
BEAR	B-Algorithm
and	O
LION	B-Algorithm
.	O
</s>
<s>
Pseudorandom	B-Algorithm
number	I-Algorithm
generators	I-Algorithm
(	O
PRNGs	O
)	O
can	O
be	O
built	O
using	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
Some	O
hash	B-Error_Name
functions	I-Error_Name
,	O
such	O
as	O
Skein	B-Algorithm
,	O
Keccak	B-Algorithm
,	O
and	O
RadioGatún	B-Algorithm
,	O
output	O
an	O
arbitrarily	O
long	O
stream	O
and	O
can	O
be	O
used	O
as	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
,	O
and	O
stream	B-Algorithm
ciphers	I-Algorithm
can	O
also	O
be	O
built	O
from	O
fixed-length	O
digest	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
Often	O
this	O
is	O
done	O
by	O
first	O
building	O
a	O
cryptographically	B-Algorithm
secure	I-Algorithm
pseudorandom	I-Algorithm
number	I-Algorithm
generator	I-Algorithm
and	O
then	O
using	O
its	O
stream	O
of	O
random	O
bytes	O
as	O
keystream	B-Algorithm
.	O
</s>
<s>
SEAL	B-Algorithm
is	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
that	O
uses	O
SHA-1	B-Algorithm
to	O
generate	O
internal	O
tables	O
,	O
which	O
are	O
then	O
used	O
in	O
a	O
keystream	B-Algorithm
generator	O
more	O
or	O
less	O
unrelated	O
to	O
the	O
hash	B-Error_Name
algorithm	I-Error_Name
.	O
</s>
<s>
SEAL	B-Algorithm
is	O
not	O
guaranteed	O
to	O
be	O
as	O
strong	O
(	O
or	O
weak	O
)	O
as	O
SHA-1	B-Algorithm
.	O
</s>
<s>
Similarly	O
,	O
the	O
key	O
expansion	O
of	O
the	O
HC-128	B-Algorithm
and	I-Algorithm
HC-256	I-Algorithm
stream	B-Algorithm
ciphers	I-Algorithm
makes	O
heavy	O
use	O
of	O
the	O
SHA-256	B-Algorithm
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
Concatenating	O
outputs	O
from	O
multiple	O
hash	B-Error_Name
functions	I-Error_Name
provide	O
collision	O
resistance	O
as	O
good	O
as	O
the	O
strongest	O
of	O
the	O
algorithms	O
included	O
in	O
the	O
concatenated	O
result	O
.	O
</s>
<s>
For	O
example	O
,	O
older	O
versions	O
of	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS	O
)	O
and	O
Secure	B-Protocol
Sockets	I-Protocol
Layer	I-Protocol
(	O
SSL	O
)	O
used	O
concatenated	O
MD5	B-Algorithm
and	O
SHA-1	B-Algorithm
sums	O
.	O
</s>
<s>
This	O
ensures	O
that	O
a	O
method	O
to	O
find	O
collisions	O
in	O
one	O
of	O
the	O
hash	B-Error_Name
functions	I-Error_Name
does	O
not	O
defeat	O
data	O
protected	O
by	O
both	O
hash	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
For	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
hash	B-Error_Name
functions	I-Error_Name
,	O
the	O
concatenated	O
function	O
is	O
as	O
collision-resistant	O
as	O
its	O
strongest	O
component	O
,	O
but	O
not	O
more	O
collision-resistant	O
.	O
</s>
<s>
Antoine	O
Joux	O
observed	O
that	O
2-collisions	O
lead	O
to	O
-collisions	O
:	O
if	O
it	O
is	O
feasible	O
for	O
an	O
attacker	O
to	O
find	O
two	O
messages	O
with	O
the	O
same	O
MD5	B-Algorithm
hash	I-Algorithm
,	O
then	O
they	O
can	O
find	O
as	O
many	O
additional	O
messages	O
with	O
that	O
same	O
MD5	B-Algorithm
hash	I-Algorithm
as	O
they	O
desire	O
,	O
with	O
no	O
greater	O
difficulty	O
.	O
</s>
<s>
Among	O
those	O
messages	O
with	O
the	O
same	O
MD5	B-Algorithm
hash	I-Algorithm
,	O
there	O
is	O
likely	O
to	O
be	O
a	O
collision	O
in	O
SHA-1	B-Algorithm
.	O
</s>
<s>
The	O
additional	O
work	O
needed	O
to	O
find	O
the	O
SHA-1	B-Algorithm
collision	O
(	O
beyond	O
the	O
exponential	O
birthday	O
search	O
)	O
requires	O
only	O
polynomial	O
time	O
.	O
</s>
<s>
There	O
are	O
many	O
cryptographic	B-Algorithm
hash	I-Algorithm
algorithms	O
;	O
this	O
section	O
lists	O
a	O
few	O
algorithms	O
that	O
are	O
referenced	O
relatively	O
often	O
.	O
</s>
<s>
A	O
more	O
extensive	O
list	O
can	O
be	O
found	O
on	O
the	O
page	O
containing	O
a	O
comparison	B-Algorithm
of	I-Algorithm
cryptographic	I-Algorithm
hash	I-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
MD5	B-Algorithm
was	O
designed	O
by	O
Ronald	O
Rivest	O
in	O
1991	O
to	O
replace	O
an	O
earlier	O
hash	B-Error_Name
function	I-Error_Name
,	O
MD4	B-Algorithm
,	O
and	O
was	O
specified	O
in	O
1992	O
as	O
RFC	O
1321	O
.	O
</s>
<s>
Collisions	O
against	O
MD5	B-Algorithm
can	O
be	O
calculated	O
within	O
seconds	O
which	O
makes	O
the	O
algorithm	O
unsuitable	O
for	O
most	O
use	O
cases	O
where	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
is	O
required	O
.	O
</s>
<s>
MD5	B-Algorithm
produces	O
a	O
digest	O
of	O
128	O
bits	O
(	O
16	O
bytes	O
)	O
.	O
</s>
<s>
SHA-1	B-Algorithm
was	O
developed	O
as	O
part	O
of	O
the	O
U.S.	O
Government	O
's	O
Capstone	O
project	O
.	O
</s>
<s>
The	O
original	O
specification	O
–	O
now	O
commonly	O
called	O
SHA-0	B-Algorithm
–	O
of	O
the	O
algorithm	O
was	O
published	O
in	O
1993	O
under	O
the	O
title	O
Secure	O
Hash	B-Error_Name
Standard	O
,	O
FIPS	O
PUB	O
180	O
,	O
by	O
U.S.	O
government	O
standards	O
agency	O
NIST	O
(	O
National	O
Institute	O
of	O
Standards	O
and	O
Technology	O
)	O
.	O
</s>
<s>
It	O
was	O
withdrawn	O
by	O
the	O
NSA	O
shortly	O
after	O
publication	O
and	O
was	O
superseded	O
by	O
the	O
revised	O
version	O
,	O
published	O
in	O
1995	O
in	O
FIPS	O
PUB180-1	O
and	O
commonly	O
designated	O
SHA-1	B-Algorithm
.	O
</s>
<s>
Collisions	O
against	O
the	O
full	O
SHA-1	B-Algorithm
algorithm	O
can	O
be	O
produced	O
using	O
the	O
shattered	O
attack	O
and	O
the	O
hash	B-Error_Name
function	I-Error_Name
should	O
be	O
considered	O
broken	O
.	O
</s>
<s>
SHA-1	B-Algorithm
produces	O
a	O
hash	B-Error_Name
digest	O
of	O
160	O
bits	O
(	O
20	O
bytes	O
)	O
.	O
</s>
<s>
Documents	O
may	O
refer	O
to	O
SHA-1	B-Algorithm
as	O
just	O
"	O
SHA	O
"	O
,	O
even	O
though	O
this	O
may	O
conflict	O
with	O
the	O
other	O
Secure	O
Hash	B-Error_Name
Algorithms	I-Error_Name
such	O
as	O
SHA-0	B-Algorithm
,	O
SHA-2	B-Algorithm
,	O
and	O
SHA-3	B-Algorithm
.	O
</s>
<s>
RIPEMD	O
(	O
RACE	O
Integrity	O
Primitives	O
Evaluation	O
Message	B-Algorithm
Digest	I-Algorithm
)	O
is	O
a	O
family	O
of	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
developed	O
in	O
Leuven	O
,	O
Belgium	O
,	O
by	O
Hans	O
Dobbertin	O
,	O
Antoon	O
Bosselaers	O
,	O
and	O
Bart	O
Preneel	O
at	O
the	O
COSIC	O
research	O
group	O
at	O
the	O
Katholieke	O
Universiteit	O
Leuven	O
,	O
and	O
first	O
published	O
in	O
1996	O
.	O
</s>
<s>
RIPEMD	O
was	O
based	O
upon	O
the	O
design	O
principles	O
used	O
in	O
MD4	B-Algorithm
and	O
is	O
similar	O
in	O
performance	O
to	O
the	O
more	O
popular	O
SHA-1	B-Algorithm
.	O
</s>
<s>
As	O
the	O
name	O
implies	O
,	O
RIPEMD-160	O
produces	O
a	O
hash	B-Error_Name
digest	O
of	O
160	O
bits	O
(	O
20	O
bytes	O
)	O
.	O
</s>
<s>
Whirlpool	O
is	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
designed	O
by	O
Vincent	O
Rijmen	O
and	O
Paulo	O
S	O
.	O
L	O
.	O
M	O
.	O
Barreto	O
,	O
who	O
first	O
described	O
it	O
in	O
2000	O
.	O
</s>
<s>
Whirlpool	O
is	O
based	O
on	O
a	O
substantially	O
modified	O
version	O
of	O
the	O
Advanced	B-Algorithm
Encryption	I-Algorithm
Standard	I-Algorithm
(	O
AES	B-Algorithm
)	O
.	O
</s>
<s>
Whirlpool	O
produces	O
a	O
hash	B-Error_Name
digest	O
of	O
512	O
bits	O
(	O
64	O
bytes	O
)	O
.	O
</s>
<s>
SHA-2	B-Algorithm
(	O
Secure	O
Hash	B-Error_Name
Algorithm	I-Error_Name
2	O
)	O
is	O
a	O
set	O
of	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
designed	O
by	O
the	O
United	O
States	O
National	O
Security	O
Agency	O
(	O
NSA	O
)	O
,	O
first	O
published	O
in	O
2001	O
.	O
</s>
<s>
They	O
are	O
built	O
using	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
structure	I-Algorithm
,	O
from	O
a	O
one-way	B-Algorithm
compression	I-Algorithm
function	I-Algorithm
itself	O
built	O
using	O
the	O
Davies	O
–	O
Meyer	O
structure	O
from	O
a	O
(	O
classified	O
)	O
specialized	O
block	O
cipher	O
.	O
</s>
<s>
SHA-2	B-Algorithm
basically	O
consists	O
of	O
two	O
hash	B-Error_Name
algorithms	I-Error_Name
:	O
SHA-256	B-Algorithm
and	O
SHA-512	B-Algorithm
.	O
</s>
<s>
SHA-224	B-Algorithm
is	O
a	O
variant	O
of	O
SHA-256	B-Algorithm
with	O
different	O
starting	O
values	O
and	O
truncated	O
output	O
.	O
</s>
<s>
SHA-384	B-Algorithm
and	O
the	O
lesser-known	O
SHA-512/224	B-Algorithm
and	O
SHA-512/256	B-Algorithm
are	O
all	O
variants	O
of	O
SHA-512	B-Algorithm
.	O
</s>
<s>
SHA-512	B-Algorithm
is	O
more	O
secure	O
than	O
SHA-256	B-Algorithm
and	O
is	O
commonly	O
faster	O
than	O
SHA-256	B-Algorithm
on	O
64-bit	O
machines	O
such	O
as	O
AMD64	B-Device
.	O
</s>
<s>
The	O
output	O
size	O
in	O
bits	O
is	O
given	O
by	O
the	O
extension	O
to	O
the	O
"	O
SHA	O
"	O
name	O
,	O
so	O
SHA-224	B-Algorithm
has	O
an	O
output	O
size	O
of	O
224	O
bits	O
(	O
28	O
bytes	O
)	O
;	O
SHA-256	B-Algorithm
,	O
32	O
bytes	O
;	O
SHA-384	B-Algorithm
,	O
48	O
bytes	O
;	O
and	O
SHA-512	B-Algorithm
,	O
64	O
bytes	O
.	O
</s>
<s>
SHA-3	B-Algorithm
(	O
Secure	O
Hash	B-Error_Name
Algorithm	I-Error_Name
3	O
)	O
was	O
released	O
by	O
NIST	O
on	O
August	O
5	O
,	O
2015	O
.	O
</s>
<s>
SHA-3	B-Algorithm
is	O
a	O
subset	O
of	O
the	O
broader	O
cryptographic	O
primitive	O
family	O
Keccak	B-Algorithm
.	O
</s>
<s>
The	O
Keccak	B-Algorithm
algorithm	O
is	O
the	O
work	O
of	O
Guido	O
Bertoni	O
,	O
Joan	O
Daemen	O
,	O
Michael	O
Peeters	O
,	O
and	O
Gilles	O
Van	O
Assche	O
.	O
</s>
<s>
Keccak	B-Algorithm
is	O
based	O
on	O
a	O
sponge	B-Algorithm
construction	I-Algorithm
which	O
can	O
also	O
be	O
used	O
to	O
build	O
other	O
cryptographic	O
primitives	O
such	O
as	O
a	O
stream	B-Algorithm
cipher	I-Algorithm
.	O
</s>
<s>
SHA-3	B-Algorithm
provides	O
the	O
same	O
output	O
sizes	O
as	O
SHA-2	B-Algorithm
:	O
224	O
,	O
256	O
,	O
384	O
,	O
and	O
512	O
bits	O
.	O
</s>
<s>
BLAKE2	O
,	O
an	O
improved	O
version	O
of	O
BLAKE	B-Algorithm
,	O
was	O
announced	O
on	O
December	O
21	O
,	O
2012	O
.	O
</s>
<s>
It	O
was	O
created	O
by	O
Jean-Philippe	O
Aumasson	O
,	O
Samuel	O
Neves	O
,	O
Zooko	O
Wilcox-O	O
'	O
Hearn	O
,	O
and	O
Christian	O
Winnerlein	O
with	O
the	O
goal	O
of	O
replacing	O
the	O
widely	O
used	O
but	O
broken	O
MD5	B-Algorithm
and	O
SHA-1	B-Algorithm
algorithms	O
.	O
</s>
<s>
When	O
run	O
on	O
64-bit	O
x64	B-Device
and	O
ARM	O
architectures	O
,	O
BLAKE2b	B-Algorithm
is	O
faster	O
than	O
SHA-3	B-Algorithm
,	O
SHA-2	B-Algorithm
,	O
SHA-1	B-Algorithm
,	O
and	O
MD5	B-Algorithm
.	O
</s>
<s>
Although	O
BLAKE	B-Algorithm
and	O
BLAKE2	O
have	O
not	O
been	O
standardized	O
as	O
SHA-3	B-Algorithm
has	O
,	O
BLAKE2	O
has	O
been	O
used	O
in	O
many	O
protocols	O
including	O
the	O
Argon2	B-Algorithm
password	B-Algorithm
hash	I-Algorithm
,	O
for	O
the	O
high	O
efficiency	O
that	O
it	O
offers	O
on	O
modern	O
CPUs	O
.	O
</s>
<s>
As	O
BLAKE	B-Algorithm
was	O
a	O
candidate	O
for	O
SHA-3	B-Algorithm
,	O
BLAKE	B-Algorithm
and	O
BLAKE2	O
both	O
offer	O
the	O
same	O
output	O
sizes	O
as	O
SHA-3	B-Algorithm
–	O
including	O
a	O
configurable	O
output	O
size	O
.	O
</s>
<s>
BLAKE3	O
is	O
a	O
single	O
algorithm	O
,	O
in	O
contrast	O
to	O
BLAKE	B-Algorithm
and	O
BLAKE2	O
,	O
which	O
are	O
algorithm	O
families	O
with	O
multiple	O
variants	O
.	O
</s>
<s>
Internally	O
,	O
BLAKE3	O
is	O
a	O
Merkle	B-Algorithm
tree	I-Algorithm
,	O
and	O
it	O
supports	O
higher	O
degrees	O
of	O
parallelism	O
than	O
BLAKE2	O
.	O
</s>
<s>
There	O
is	O
a	O
long	O
list	O
of	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
but	O
many	O
have	O
been	O
found	O
to	O
be	O
vulnerable	O
and	O
should	O
not	O
be	O
used	O
.	O
</s>
<s>
For	O
instance	O
,	O
NIST	O
selected	O
51	O
hash	B-Error_Name
functions	I-Error_Name
as	O
candidates	O
for	O
round	O
1	O
of	O
the	O
SHA-3	B-Algorithm
hash	B-Error_Name
competition	O
,	O
of	O
which	O
10	O
were	O
considered	O
broken	O
and	O
16	O
showed	O
significant	O
weaknesses	O
and	O
therefore	O
did	O
not	O
make	O
it	O
to	O
the	O
next	O
round	O
;	O
more	O
information	O
can	O
be	O
found	O
on	O
the	O
main	O
article	O
about	O
the	O
NIST	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
competitions	I-Algorithm
.	O
</s>
<s>
Even	O
if	O
a	O
hash	B-Error_Name
function	I-Error_Name
has	O
never	O
been	O
broken	O
,	O
a	O
successful	O
attack	O
against	O
a	O
weakened	O
variant	O
may	O
undermine	O
the	O
experts	O
 '	O
confidence	O
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
August	O
2004	O
collisions	O
were	O
found	O
in	O
several	O
then-popular	O
hash	B-Error_Name
functions	I-Error_Name
,	O
including	O
MD5	B-Algorithm
.	O
</s>
<s>
These	O
weaknesses	O
called	O
into	O
question	O
the	O
security	O
of	O
stronger	O
algorithms	O
derived	O
from	O
the	O
weak	O
hash	B-Error_Name
functions	I-Error_Name
–	O
in	O
particular	O
,	O
SHA-1	B-Algorithm
(	O
a	O
strengthened	O
version	O
of	O
SHA-0	B-Algorithm
)	O
,	O
RIPEMD-128	O
,	O
and	O
RIPEMD-160	O
(	O
both	O
strengthened	O
versions	O
of	O
RIPEMD	O
)	O
.	O
</s>
<s>
On	O
August	O
12	O
,	O
2004	O
,	O
Joux	O
,	O
Carribault	O
,	O
Lemuel	O
,	O
and	O
Jalby	O
announced	O
a	O
collision	O
for	O
the	O
full	O
SHA-0	B-Algorithm
algorithm	O
.	O
</s>
<s>
They	O
found	O
that	O
the	O
collision	O
had	O
complexity	O
and	O
took	O
about	O
80,000	O
CPU	O
hours	O
on	O
a	O
supercomputer	B-Architecture
with	O
256	O
Itanium	O
2	O
processors	O
–	O
equivalent	O
to	O
13	O
days	O
of	O
full-time	O
use	O
of	O
the	O
supercomputer	B-Architecture
.	O
</s>
<s>
In	O
February	O
2005	O
,	O
an	O
attack	O
on	O
SHA-1	B-Algorithm
was	O
reported	O
that	O
would	O
find	O
collision	O
in	O
about	O
269	O
hashing	O
operations	O
,	O
rather	O
than	O
the	O
280	O
expected	O
for	O
a	O
160-bit	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
In	O
August	O
2005	O
,	O
another	O
attack	O
on	O
SHA-1	B-Algorithm
was	O
reported	O
that	O
would	O
find	O
collisions	O
in	O
263	O
operations	O
.	O
</s>
<s>
Other	O
theoretical	O
weaknesses	O
of	O
SHA-1	B-Algorithm
have	O
been	O
known	O
:	O
and	O
in	O
February	O
2017	O
Google	O
announced	O
a	O
collision	O
in	O
SHA-1	B-Algorithm
.	O
</s>
<s>
Security	O
researchers	O
recommend	O
that	O
new	O
applications	O
can	O
avoid	O
these	O
problems	O
by	O
using	O
later	O
members	O
of	O
the	O
SHA	O
family	O
,	O
such	O
as	O
SHA-2	B-Algorithm
,	O
or	O
using	O
techniques	O
such	O
as	O
randomized	O
hashing	O
that	O
do	O
not	O
require	O
collision	O
resistance	O
.	O
</s>
<s>
A	O
successful	O
,	O
practical	O
attack	O
broke	O
MD5	B-Algorithm
used	O
within	O
certificates	O
for	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
in	O
2008	O
.	O
</s>
<s>
Many	O
cryptographic	B-Algorithm
hashes	I-Algorithm
are	O
based	O
on	O
the	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
.	O
</s>
<s>
All	O
cryptographic	B-Algorithm
hashes	I-Algorithm
that	O
directly	O
use	O
the	O
full	O
output	O
of	O
a	O
Merkle	B-Algorithm
–	I-Algorithm
Damgård	I-Algorithm
construction	I-Algorithm
are	O
vulnerable	O
to	O
length	O
extension	O
attacks	O
.	O
</s>
<s>
This	O
makes	O
the	O
MD5	B-Algorithm
,	O
SHA-1	B-Algorithm
,	O
RIPEMD-160	O
,	O
Whirlpool	O
,	O
and	O
the	O
SHA-256	B-Algorithm
/	O
SHA-512	B-Algorithm
hash	B-Error_Name
algorithms	I-Error_Name
all	O
vulnerable	O
to	O
this	O
specific	O
attack	O
.	O
</s>
<s>
SHA-3	B-Algorithm
,	O
BLAKE2	O
,	O
BLAKE3	O
,	O
and	O
the	O
truncated	O
SHA-2	B-Algorithm
variants	O
are	O
not	O
vulnerable	O
to	O
this	O
type	O
of	O
attack	O
.	O
</s>
<s>
A	O
common	O
use	O
of	O
hashes	B-Error_Name
is	O
to	O
store	O
password	O
authentication	O
data	O
.	O
</s>
<s>
Rather	O
than	O
store	O
the	O
plaintext	O
of	O
user	O
passwords	O
,	O
a	O
controlled	O
access	O
system	O
stores	O
the	O
hash	B-Error_Name
of	O
each	O
user	O
's	O
password	O
in	O
a	O
file	B-Operating_System
or	O
database	O
.	O
</s>
<s>
If	O
the	O
database	O
is	O
stolen	O
(	O
an	O
all	O
too	O
frequent	O
occurrence	O
)	O
,	O
the	O
thief	O
will	O
only	O
have	O
the	O
hash	B-Error_Name
values	I-Error_Name
,	O
not	O
the	O
passwords	O
.	O
</s>
<s>
Lists	O
of	O
common	O
passwords	O
are	O
widely	O
circulated	O
and	O
many	O
passwords	O
are	O
short	O
enough	O
that	O
all	O
possible	O
combinations	O
can	O
be	O
tested	O
if	O
fast	O
hashes	B-Error_Name
are	O
used	O
.	O
</s>
<s>
The	O
use	O
of	O
cryptographic	O
salt	O
prevents	O
some	O
attacks	O
,	O
such	O
as	O
building	O
files	O
of	O
precomputing	O
hash	B-Error_Name
values	I-Error_Name
,	O
e.g.	O
</s>
<s>
rainbow	B-Algorithm
tables	I-Algorithm
.	O
</s>
<s>
But	O
searches	O
on	O
the	O
order	O
of	O
100	O
billion	O
tests	O
per	O
second	O
are	O
possible	O
with	O
high-end	O
graphics	B-Architecture
processors	I-Architecture
,	O
making	O
direct	O
attacks	O
possible	O
even	O
with	O
salt	O
.	O
</s>
<s>
The	O
United	O
States	O
National	O
Institute	O
of	O
Standards	O
and	O
Technology	O
recommends	O
storing	O
passwords	O
using	O
special	O
hashes	B-Error_Name
called	O
key	B-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
(	O
KDFs	O
)	O
that	O
have	O
been	O
created	O
to	O
slow	O
brute	O
force	O
searches	O
.	O
</s>
<s>
Slow	O
hashes	B-Error_Name
include	O
pbkdf2	O
,	O
bcrypt	B-Algorithm
,	O
scrypt	B-Algorithm
,	O
argon2	B-Algorithm
,	O
Balloon	B-Algorithm
and	O
some	O
recent	O
modes	O
of	O
Unix	B-Algorithm
crypt	I-Algorithm
.	O
</s>
<s>
For	O
KSFs	O
that	O
perform	O
multiple	O
hashes	B-Error_Name
to	O
slow	O
execution	O
,	O
NIST	O
recommends	O
an	O
iteration	O
count	O
of	O
10,000	O
or	O
more	O
.	O
</s>
