<s>
In	O
cryptography	O
,	O
a	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
(	O
KDF	O
)	O
is	O
a	O
cryptographic	O
algorithm	O
that	O
derives	O
one	O
or	O
more	O
secret	O
keys	O
from	O
a	O
secret	O
value	O
such	O
as	O
a	O
master	O
key	O
,	O
a	O
password	O
,	O
or	O
a	O
passphrase	O
using	O
a	O
pseudorandom	O
function	O
(	O
which	O
typically	O
uses	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
or	O
block	O
cipher	O
)	O
.	O
</s>
<s>
KDFs	O
can	O
be	O
used	O
to	O
stretch	O
keys	O
into	O
longer	O
keys	O
or	O
to	O
obtain	O
keys	O
of	O
a	O
required	O
format	O
,	O
such	O
as	O
converting	O
a	O
group	O
element	O
that	O
is	O
the	O
result	O
of	O
a	O
Diffie	B-Protocol
–	I-Protocol
Hellman	I-Protocol
key	I-Protocol
exchange	I-Protocol
into	O
a	O
symmetric	O
key	O
for	O
use	O
with	O
AES	B-Algorithm
.	O
</s>
<s>
Keyed	B-Algorithm
cryptographic	I-Algorithm
hash	I-Algorithm
functions	I-Algorithm
are	O
popular	O
examples	O
of	O
pseudorandom	O
functions	O
used	O
for	O
key	O
derivation	O
.	O
</s>
<s>
The	O
first	O
deliberately	O
slow	O
(	O
key	O
stretching	O
)	O
password-based	B-Algorithm
key	I-Algorithm
derivation	I-Algorithm
function	I-Algorithm
was	O
called	O
"	O
crypt	B-Algorithm
"	O
(	O
or	O
"	O
crypt(3 )	O
"	O
after	O
its	O
man	B-Protocol
page	I-Protocol
)	O
,	O
and	O
was	O
invented	O
by	O
Robert	O
Morris	O
in	O
1978	O
.	O
</s>
<s>
It	O
would	O
encrypt	O
a	O
constant	O
(	O
zero	O
)	O
,	O
using	O
the	O
first	O
8	O
characters	O
of	O
the	O
user	O
's	O
password	O
as	O
the	O
key	O
,	O
by	O
performing	O
25	O
iterations	B-Algorithm
of	O
a	O
modified	O
DES	B-Algorithm
encryption	O
algorithm	O
(	O
in	O
which	O
a	O
12-bit	O
number	O
read	O
from	O
the	O
real-time	O
computer	O
clock	O
is	O
used	O
to	O
perturb	O
the	O
calculations	O
)	O
.	O
</s>
<s>
The	O
resulting	O
64-bit	O
number	O
is	O
encoded	O
as	O
11	O
printable	O
characters	O
and	O
then	O
stored	O
in	O
the	O
Unix	B-Application
password	O
file	O
.	O
</s>
<s>
While	O
it	O
was	O
a	O
great	O
advance	O
at	O
the	O
time	O
,	O
increases	O
in	O
processor	O
speeds	O
since	O
the	O
PDP-11	B-Device
era	O
have	O
made	O
brute-force	O
attacks	O
against	O
crypt	B-Algorithm
feasible	O
,	O
and	O
advances	O
in	O
storage	O
have	O
rendered	O
the	O
12-bit	O
salt	O
inadequate	O
.	O
</s>
<s>
The	O
crypt	B-Algorithm
function	O
's	O
design	O
also	O
limits	O
the	O
user	O
password	O
to	O
8	O
characters	O
,	O
which	O
limits	O
the	O
keyspace	O
and	O
makes	O
strong	O
passphrases	O
impossible	O
.	O
</s>
<s>
Although	O
high	O
throughput	O
is	O
a	O
desirable	O
property	O
in	O
general-purpose	O
hash	B-Algorithm
functions	I-Algorithm
,	O
the	O
opposite	O
is	O
true	O
in	O
password	O
security	O
applications	O
in	O
which	O
defending	O
against	O
brute-force	O
cracking	O
is	O
a	O
primary	O
concern	O
.	O
</s>
<s>
Various	O
algorithms	O
have	O
been	O
designed	O
specifically	O
for	O
this	O
purpose	O
,	O
including	O
bcrypt	B-Algorithm
,	O
scrypt	B-Algorithm
and	O
,	O
more	O
recently	O
,	O
Lyra2	B-Algorithm
and	O
Argon2	B-Algorithm
(	O
the	O
latter	O
being	O
the	O
winner	O
of	O
the	O
Password	O
Hashing	O
Competition	O
)	O
.	O
</s>
<s>
The	O
large-scale	O
Ashley	O
Madison	O
data	O
breach	O
in	O
which	O
roughly	O
36	O
million	O
passwords	O
hashes	B-Algorithm
were	O
stolen	O
by	O
attackers	O
illustrated	O
the	O
importance	O
of	O
algorithm	O
selection	O
in	O
securing	O
passwords	O
.	O
</s>
<s>
Although	O
bcrypt	B-Algorithm
was	O
employed	O
to	O
protect	O
the	O
hashes	B-Algorithm
(	O
making	O
large	O
scale	O
brute-force	O
cracking	O
expensive	O
and	O
time-consuming	O
)	O
,	O
a	O
significant	O
portion	O
of	O
the	O
accounts	O
in	O
the	O
compromised	O
data	O
also	O
contained	O
a	O
password	B-Algorithm
hash	I-Algorithm
based	O
on	O
the	O
fast	O
general-purpose	O
MD5	B-Algorithm
algorithm	O
,	O
which	O
made	O
it	O
possible	O
for	O
over	O
11	O
million	O
of	O
the	O
passwords	O
to	O
be	O
cracked	O
in	O
a	O
matter	O
of	O
weeks	O
.	O
</s>
<s>
Memorized	O
secrets	O
SHALL	O
be	O
salted	O
and	O
hashed	O
using	O
a	O
suitable	O
one-way	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
.	O
</s>
<s>
Key	B-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
take	O
a	O
password	O
,	O
a	O
salt	O
,	O
and	O
a	O
cost	O
factor	O
as	O
inputs	O
then	O
generate	O
a	O
password	B-Algorithm
hash	I-Algorithm
.	O
</s>
<s>
Their	O
purpose	O
is	O
to	O
make	O
each	O
password	O
guessing	O
trial	O
by	O
an	O
attacker	O
who	O
has	O
obtained	O
a	O
password	B-Algorithm
hash	I-Algorithm
file	O
expensive	O
and	O
therefore	O
the	O
cost	O
of	O
a	O
guessing	O
attack	O
high	O
or	O
prohibitive.	O
"	O
</s>
<s>
Modern	O
password-based	B-Algorithm
key	I-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
,	O
such	O
as	O
PBKDF2	O
(	O
specified	O
in	O
RFC	O
2898	O
)	O
,	O
are	O
based	O
on	O
a	O
recognized	O
cryptographic	B-Algorithm
hash	I-Algorithm
,	O
such	O
as	O
SHA-2	B-Algorithm
,	O
use	O
more	O
salt	O
(	O
at	O
least	O
64	O
bits	O
and	O
chosen	O
randomly	O
)	O
and	O
a	O
high	O
iteration	B-Algorithm
count	O
.	O
</s>
<s>
NIST	O
recommends	O
a	O
minimum	O
iteration	B-Algorithm
count	O
of	O
10,000	O
.	O
</s>
<s>
As	O
components	O
of	O
multiparty	O
key-agreement	B-Protocol
protocols	I-Protocol
.	O
</s>
<s>
Examples	O
of	O
such	O
key	B-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
include	O
KDF1	O
,	O
defined	O
in	O
IEEE	O
Std	O
1363-2000	O
,	O
and	O
similar	O
functions	O
in	O
ANSI	O
X9.42	O
.	O
</s>
<s>
To	O
derive	O
keys	O
of	O
different	O
length	O
from	O
the	O
ones	O
provided	O
:	O
one	O
example	O
of	O
KDFs	O
designed	O
for	O
this	O
purpose	O
is	O
HKDF	B-Algorithm
.	O
</s>
<s>
Key	B-Algorithm
derivation	I-Algorithm
functions	I-Algorithm
are	O
also	O
used	O
in	O
applications	O
to	O
derive	O
keys	O
from	O
secret	O
passwords	O
or	O
passphrases	O
,	O
which	O
typically	O
do	O
not	O
have	O
the	O
desired	O
properties	O
to	O
be	O
used	O
directly	O
as	O
cryptographic	O
keys	O
.	O
</s>
<s>
In	O
such	O
applications	O
,	O
it	O
is	O
generally	O
recommended	O
that	O
the	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
be	O
made	O
deliberately	O
slow	O
so	O
as	O
to	O
frustrate	O
brute-force	O
attack	O
or	O
dictionary	O
attack	O
on	O
the	O
password	O
or	O
passphrase	O
input	O
value	O
.	O
</s>
<s>
Such	O
use	O
may	O
be	O
expressed	O
as	O
,	O
where	O
is	O
the	O
derived	O
key	O
,	O
is	O
the	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
,	O
is	O
the	O
original	O
key	O
or	O
password	O
,	O
is	O
a	O
random	O
number	O
which	O
acts	O
as	O
cryptographic	O
salt	O
,	O
and	O
refers	O
to	O
the	O
number	O
of	O
iterations	B-Algorithm
of	O
a	O
sub-function	O
.	O
</s>
<s>
The	O
values	O
of	O
the	O
salt	O
and	O
the	O
number	O
of	O
iterations	B-Algorithm
(	O
if	O
it	O
is	O
not	O
fixed	O
)	O
are	O
stored	O
with	O
the	O
hashed	O
password	O
or	O
sent	O
as	O
cleartext	O
(	O
unencrypted	O
)	O
with	O
an	O
encrypted	O
message	O
.	O
</s>
<s>
The	O
difficulty	O
of	O
a	O
brute	O
force	O
attack	O
is	O
increased	O
with	O
the	O
number	O
of	O
iterations	B-Algorithm
.	O
</s>
<s>
A	O
practical	O
limit	O
on	O
the	O
iteration	B-Algorithm
count	O
is	O
the	O
unwillingness	O
of	O
users	O
to	O
tolerate	O
a	O
perceptible	O
delay	O
in	O
logging	O
into	O
a	O
computer	O
or	O
seeing	O
a	O
decrypted	O
message	O
.	O
</s>
<s>
Despite	O
their	O
original	O
use	O
for	O
key	O
derivation	O
,	O
KDFs	O
are	O
possibly	O
better	O
known	O
for	O
their	O
use	O
in	O
password	O
hashing	O
(	O
password	O
verification	O
by	O
hash	B-Algorithm
comparison	O
)	O
,	O
as	O
used	O
by	O
the	O
passwd	B-Protocol
file	O
or	O
shadow	O
password	O
file	O
.	O
</s>
<s>
Password	B-Algorithm
hash	I-Algorithm
functions	O
should	O
be	O
relatively	O
expensive	O
to	O
calculate	O
in	O
case	O
of	O
brute-force	O
attacks	O
,	O
and	O
the	O
key	O
stretching	O
of	O
KDFs	O
happen	O
to	O
provide	O
this	O
characteristic	O
.	O
</s>
<s>
On	O
20	O
July	O
2015	O
the	O
competition	O
ended	O
and	O
Argon2	B-Algorithm
was	O
announced	O
as	O
the	O
final	O
winner	O
.	O
</s>
<s>
Four	O
other	O
algorithms	O
received	O
special	O
recognition	O
:	O
Catena	O
,	O
Lyra2	B-Algorithm
,	O
Makwa	O
and	O
yescrypt	O
.	O
</s>
