<s>
A	O
rainbow	B-Algorithm
table	I-Algorithm
is	O
a	O
precomputed	O
table	B-Data_Structure
for	O
caching	O
the	O
outputs	O
of	O
a	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
,	O
usually	O
for	O
cracking	O
password	B-Algorithm
hashes	I-Algorithm
.	O
</s>
<s>
Passwords	O
are	O
typically	O
stored	O
not	O
in	O
plain	O
text	O
form	O
,	O
but	O
as	O
hash	B-Algorithm
values	O
.	O
</s>
<s>
If	O
such	O
a	O
database	O
of	O
hashed	O
passwords	O
falls	O
into	O
the	O
hands	O
of	O
an	O
attacker	O
,	O
they	O
can	O
use	O
a	O
precomputed	O
rainbow	B-Algorithm
table	I-Algorithm
to	O
recover	O
the	O
plaintext	O
passwords	O
.	O
</s>
<s>
A	O
common	O
defense	O
against	O
this	O
attack	O
is	O
to	O
compute	O
the	O
hashes	B-Algorithm
using	O
a	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
that	O
adds	O
a	O
"	O
salt	O
"	O
to	O
each	O
password	O
before	O
hashing	O
it	O
,	O
with	O
different	O
passwords	O
receiving	O
different	O
salts	O
,	O
which	O
are	O
stored	O
in	O
plain	O
text	O
along	O
with	O
the	O
hash	B-Algorithm
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
are	O
a	O
practical	O
example	O
of	O
a	O
space	O
–	O
time	O
tradeoff	O
:	O
they	O
use	O
less	O
computer	O
processing	O
time	O
and	O
more	O
storage	O
than	O
a	O
brute-force	O
attack	O
which	O
calculates	O
a	O
hash	B-Algorithm
on	O
every	O
attempt	O
,	O
but	O
more	O
processing	O
time	O
and	O
less	O
storage	O
than	O
a	O
simple	O
table	B-Data_Structure
that	O
stores	O
the	O
hash	B-Algorithm
of	O
every	O
possible	O
password	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
were	O
invented	O
by	O
Philippe	O
Oechslin	O
as	O
an	O
application	O
of	O
an	O
earlier	O
,	O
simpler	O
algorithm	O
by	O
Martin	O
Hellman	O
.	O
</s>
<s>
For	O
user	O
authentication	O
,	O
passwords	O
are	O
stored	O
either	O
as	O
plaintext	O
or	O
hashes	B-Algorithm
.	O
</s>
<s>
Since	O
passwords	O
stored	O
as	O
plaintext	O
are	O
easily	O
stolen	O
if	O
database	O
access	O
is	O
compromised	O
,	O
databases	O
typically	O
store	O
hashes	B-Algorithm
instead	O
.	O
</s>
<s>
When	O
a	O
user	O
enters	O
a	O
password	O
for	O
authentication	O
,	O
a	O
hash	B-Algorithm
is	O
computed	O
for	O
it	O
and	O
then	O
compared	O
to	O
the	O
stored	O
hash	B-Algorithm
for	O
that	O
user	O
.	O
</s>
<s>
Authentication	O
fails	O
if	O
the	O
two	O
hashes	B-Algorithm
do	O
not	O
match	O
;	O
moreover	O
,	O
authentication	O
would	O
equally	O
fail	O
if	O
a	O
hashed	O
value	O
were	O
entered	O
as	O
a	O
password	O
,	O
since	O
the	O
authentication	O
system	O
would	O
hash	B-Algorithm
it	O
a	O
second	O
time	O
.	O
</s>
<s>
To	O
learn	O
a	O
password	O
from	O
a	O
hash	B-Algorithm
is	O
to	O
find	O
a	O
string	O
which	O
,	O
when	O
input	O
into	O
the	O
hash	B-Algorithm
function	I-Algorithm
,	O
creates	O
that	O
same	O
hash	B-Algorithm
.	O
</s>
<s>
This	O
is	O
the	O
same	O
as	O
inverting	O
the	O
hash	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
dictionary	O
attacks	O
)	O
may	O
be	O
used	O
to	O
try	O
to	O
invert	O
a	O
hash	B-Algorithm
function	I-Algorithm
,	O
they	O
can	O
become	O
infeasible	O
when	O
the	O
set	O
of	O
possible	O
passwords	O
is	O
large	O
enough	O
.	O
</s>
<s>
An	O
alternative	O
to	O
brute-force	O
is	O
to	O
use	O
precomputed	O
hash	B-Algorithm
chain	O
tables	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
are	O
a	O
special	O
kind	O
of	O
such	O
table	B-Data_Structure
that	O
overcome	O
certain	O
technical	O
difficulties	O
.	O
</s>
<s>
The	O
term	O
rainbow	B-Algorithm
tables	I-Algorithm
was	O
first	O
used	O
in	O
Oechslin	O
's	O
initial	O
paper	O
.	O
</s>
<s>
The	O
term	O
refers	O
to	O
the	O
way	O
different	O
reduction	B-Algorithm
functions	I-Algorithm
are	O
used	O
to	O
increase	O
the	O
success	O
rate	O
of	O
the	O
attack	O
.	O
</s>
<s>
The	O
original	O
method	O
by	O
Hellman	O
uses	O
many	O
small	O
tables	O
with	O
a	O
different	O
reduction	B-Algorithm
function	I-Algorithm
each	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
are	O
much	O
bigger	O
and	O
use	O
a	O
different	O
reduction	B-Algorithm
function	I-Algorithm
in	O
each	O
column	O
.	O
</s>
<s>
When	O
colors	O
are	O
used	O
to	O
represent	O
the	O
reduction	B-Algorithm
functions	I-Algorithm
,	O
a	O
rainbow	O
appears	O
in	O
the	O
rainbow	B-Algorithm
table	I-Algorithm
.	O
</s>
<s>
Given	O
a	O
password	B-Algorithm
hash	B-Algorithm
function	I-Algorithm
H	O
and	O
a	O
finite	O
set	O
of	O
passwords	O
P	O
,	O
the	O
goal	O
is	O
to	O
precompute	O
a	O
data	O
structure	O
that	O
,	O
given	O
any	O
output	O
h	O
of	O
the	O
hash	B-Algorithm
function	I-Algorithm
,	O
can	O
either	O
locate	O
an	O
element	O
p	O
in	O
P	O
such	O
that	O
H(p )	O
=	O
h	O
,	O
or	O
determine	O
that	O
there	O
is	O
no	O
such	O
p	O
in	O
P	O
.	O
The	O
simplest	O
way	O
to	O
do	O
this	O
is	O
compute	O
H(p )	O
for	O
all	O
p	O
in	O
P	O
,	O
but	O
then	O
storing	O
the	O
table	B-Data_Structure
requires	O
Θ( |P|n	O
)	O
bits	O
of	O
space	O
,	O
where	O
|P|	O
is	O
the	O
size	O
of	O
the	O
set	O
P	O
and	O
n	O
is	O
the	O
size	O
of	O
an	O
output	O
of	O
H	O
,	O
which	O
is	O
prohibitive	O
for	O
large	O
|P|	O
.	O
</s>
<s>
Hash	B-Algorithm
chains	O
are	O
a	O
technique	O
for	O
decreasing	O
this	O
space	O
requirement	O
.	O
</s>
<s>
The	O
idea	O
is	O
to	O
define	O
a	O
reduction	B-Algorithm
function	I-Algorithm
R	O
that	O
maps	O
hash	B-Algorithm
values	O
back	O
into	O
values	O
in	O
P	O
.	O
Note	O
,	O
however	O
,	O
that	O
the	O
reduction	B-Algorithm
function	I-Algorithm
is	O
not	O
actually	O
an	O
inverse	O
of	O
the	O
hash	B-Algorithm
function	I-Algorithm
,	O
but	O
rather	O
a	O
different	O
function	O
with	O
a	O
swapped	O
domain	B-Algorithm
and	O
codomain	B-Algorithm
of	O
the	O
hash	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
By	O
alternating	O
the	O
hash	B-Algorithm
function	I-Algorithm
with	O
the	O
reduction	B-Algorithm
function	I-Algorithm
,	O
chains	O
of	O
alternating	O
passwords	O
and	O
hash	B-Algorithm
values	O
are	O
formed	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
P	O
were	O
the	O
set	O
of	O
lowercase	O
alphabetic	O
6-character	O
passwords	O
,	O
and	O
hash	B-Algorithm
values	O
were	O
32	O
bits	O
long	O
,	O
a	O
chain	O
might	O
look	O
like	O
this	O
:	O
</s>
<s>
The	O
only	O
requirement	O
for	O
the	O
reduction	B-Algorithm
function	I-Algorithm
is	O
to	O
be	O
able	O
to	O
return	O
a	O
"	O
plain	O
text	O
"	O
value	O
in	O
a	O
specific	O
size	O
.	O
</s>
<s>
To	O
generate	O
the	O
table	B-Data_Structure
,	O
we	O
choose	O
a	O
random	O
set	O
of	O
initial	O
passwords	O
from	O
P	O
,	O
compute	O
chains	O
of	O
some	O
fixed	O
length	O
k	O
for	O
each	O
one	O
,	O
and	O
store	O
only	O
the	O
first	O
and	O
last	O
password	O
in	O
each	O
chain	O
.	O
</s>
<s>
In	O
the	O
example	O
chain	O
above	O
,	O
"	O
aaaaaa	O
"	O
would	O
be	O
the	O
starting	O
point	O
and	O
"	O
kiebgt	O
"	O
would	O
be	O
the	O
endpoint	O
,	O
and	O
none	O
of	O
the	O
other	O
passwords	O
(	O
or	O
the	O
hash	B-Algorithm
values	O
)	O
would	O
be	O
stored	O
.	O
</s>
<s>
Now	O
,	O
given	O
a	O
hash	B-Algorithm
value	O
h	O
to	O
invert	O
(	O
find	O
the	O
corresponding	O
password	O
for	O
)	O
,	O
compute	O
a	O
chain	O
starting	O
with	O
h	O
by	O
applying	O
R	O
,	O
then	O
H	O
,	O
then	O
R	O
,	O
and	O
so	O
on	O
.	O
</s>
<s>
If	O
at	O
any	O
point	O
a	O
value	O
matches	O
one	O
of	O
the	O
endpoints	O
in	O
the	O
table	B-Data_Structure
,	O
the	O
corresponding	O
starting	O
point	O
allows	O
to	O
recreate	O
the	O
complete	O
chain	O
.	O
</s>
<s>
For	O
example	O
,	O
given	O
the	O
hash	B-Algorithm
,	O
its	O
chain	O
can	O
be	O
computed	O
by	O
first	O
applying	O
R	O
:	O
</s>
<s>
Since	O
""	O
is	O
one	O
of	O
the	O
endpoints	O
in	O
our	O
table	B-Data_Structure
,	O
the	O
corresponding	O
starting	O
password	O
""	O
allows	O
to	O
follow	O
its	O
chain	O
until	O
is	O
reached	O
:	O
</s>
<s>
Thus	O
,	O
the	O
password	O
is	O
""	O
(	O
or	O
a	O
different	O
password	O
that	O
has	O
the	O
same	O
hash	B-Algorithm
value	O
)	O
.	O
</s>
<s>
Note	O
however	O
that	O
this	O
chain	O
does	O
not	O
always	O
contain	O
the	O
hash	B-Algorithm
value	O
h	O
;	O
it	O
may	O
so	O
happen	O
that	O
the	O
chain	O
starting	O
at	O
h	O
merges	O
with	O
a	O
chain	O
having	O
a	O
different	O
starting	O
point	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
chain	O
of	O
hash	B-Algorithm
value	O
FB107E70	O
,	O
also	O
leads	O
to	O
kiebgt	O
:	O
</s>
<s>
The	O
table	B-Data_Structure
content	O
does	O
not	O
depend	O
on	O
the	O
hash	B-Algorithm
value	O
to	O
be	O
inverted	O
.	O
</s>
<s>
It	O
is	O
created	O
once	O
and	O
then	O
repeatedly	O
used	O
for	O
the	O
lookups	B-Data_Structure
unmodified	O
.	O
</s>
<s>
Increasing	O
the	O
length	O
of	O
the	O
chain	O
decreases	O
the	O
size	O
of	O
the	O
table	B-Data_Structure
.	O
</s>
<s>
However	O
,	O
it	O
also	O
increases	O
the	O
time	O
required	O
to	O
perform	O
lookups	B-Data_Structure
,	O
and	O
this	O
is	O
the	O
time-memory	O
trade-off	O
of	O
the	O
rainbow	B-Algorithm
table	I-Algorithm
.	O
</s>
<s>
In	O
a	O
simple	O
case	O
of	O
one-item	O
chains	O
,	O
the	O
lookup	B-Data_Structure
is	O
very	O
fast	O
,	O
but	O
the	O
table	B-Data_Structure
is	O
very	O
big	O
.	O
</s>
<s>
Once	O
chains	O
get	O
longer	O
,	O
the	O
lookup	B-Data_Structure
slows	O
,	O
but	O
the	O
table	B-Data_Structure
size	O
goes	O
down	O
.	O
</s>
<s>
Simple	O
hash	B-Algorithm
chains	O
have	O
several	O
flaws	O
.	O
</s>
<s>
Most	O
serious	O
if	O
at	O
any	O
point	O
two	O
chains	O
collide	O
(	O
produce	O
the	O
same	O
value	O
)	O
,	O
they	O
will	O
merge	O
and	O
consequently	O
the	O
table	B-Data_Structure
will	O
not	O
cover	O
as	O
many	O
passwords	O
despite	O
having	O
paid	O
the	O
same	O
computational	O
cost	O
to	O
generate	O
.	O
</s>
<s>
The	O
hash	B-Algorithm
function	I-Algorithm
H	O
is	O
unlikely	O
to	O
produce	O
collisions	O
as	O
it	O
is	O
usually	O
considered	O
an	O
important	O
security	O
feature	O
not	O
to	O
do	O
so	O
,	O
but	O
the	O
reduction	B-Algorithm
function	I-Algorithm
R	O
,	O
because	O
of	O
its	O
need	O
to	O
correctly	O
cover	O
the	O
likely	O
plaintexts	O
,	O
cannot	O
be	O
collision	B-Algorithm
resistant	O
.	O
</s>
<s>
In	O
effect	O
R	O
shepherds	O
the	O
results	O
of	O
prior	O
hash	B-Algorithm
calculations	O
back	O
to	O
likely	O
plaintexts	O
but	O
this	O
benefit	O
comes	O
with	O
the	O
drawback	O
that	O
R	O
likely	O
wo	O
n't	O
produce	O
every	O
possible	O
plaintext	O
in	O
the	O
class	O
the	O
attacker	O
wishes	O
to	O
check	O
denying	O
certainty	O
to	O
the	O
attacker	O
that	O
no	O
passwords	O
came	O
from	O
their	O
chosen	O
class	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
effectively	O
solve	O
the	O
problem	O
of	O
collisions	O
with	O
ordinary	O
hash	B-Algorithm
chains	O
by	O
replacing	O
the	O
single	O
reduction	B-Algorithm
function	I-Algorithm
R	O
with	O
a	O
sequence	O
of	O
related	O
reduction	B-Algorithm
functions	I-Algorithm
R1	O
through	O
Rk	O
.	O
</s>
<s>
A	O
final	O
postprocessing	O
pass	O
can	O
sort	O
the	O
chains	O
in	O
the	O
table	B-Data_Structure
and	O
remove	O
any	O
"	O
duplicate	O
"	O
chains	O
that	O
have	O
the	O
same	O
final	O
values	O
as	O
other	O
chains	O
.	O
</s>
<s>
New	O
chains	O
are	O
then	O
generated	O
to	O
fill	O
out	O
the	O
table	B-Data_Structure
.	O
</s>
<s>
These	O
chains	O
are	O
not	O
collision-free	O
(	O
they	O
may	O
overlap	O
briefly	O
)	O
but	O
they	O
will	O
not	O
merge	O
,	O
drastically	O
reducing	O
the	O
overall	O
number	O
of	O
collisions	O
.	O
</s>
<s>
Using	O
sequences	O
of	O
reduction	B-Algorithm
functions	I-Algorithm
changes	O
how	O
lookup	B-Data_Structure
is	O
done	O
:	O
because	O
the	O
hash	B-Algorithm
value	O
of	O
interest	O
may	O
be	O
found	O
at	O
any	O
location	O
in	O
the	O
chain	O
,	O
it	O
's	O
necessary	O
to	O
generate	O
k	O
different	O
chains	O
.	O
</s>
<s>
The	O
first	O
chain	O
assumes	O
the	O
hash	B-Algorithm
value	O
is	O
in	O
the	O
last	O
hash	B-Algorithm
position	O
and	O
just	O
applies	O
Rk	O
;	O
the	O
next	O
chain	O
assumes	O
the	O
hash	B-Algorithm
value	O
is	O
in	O
the	O
second-to-last	O
hash	B-Algorithm
position	O
and	O
applies	O
Rk−1	O
,	O
then	O
H	O
,	O
then	O
Rk	O
;	O
and	O
so	O
on	O
until	O
the	O
last	O
chain	O
,	O
which	O
applies	O
all	O
the	O
reduction	B-Algorithm
functions	I-Algorithm
,	O
alternating	O
with	O
H	O
.	O
This	O
creates	O
a	O
new	O
way	O
of	O
producing	O
a	O
false	O
alarm	O
:	O
an	O
incorrect	O
"	O
guess	O
"	O
of	O
the	O
position	O
of	O
the	O
hash	B-Algorithm
value	O
may	O
needlessly	O
evaluate	O
a	O
chain	O
.	O
</s>
<s>
Although	O
rainbow	B-Algorithm
tables	I-Algorithm
have	O
to	O
follow	O
more	O
chains	O
,	O
they	O
make	O
up	O
for	O
this	O
by	O
having	O
fewer	O
tables	O
:	O
simple	O
hash	B-Algorithm
chain	O
tables	O
cannot	O
grow	O
beyond	O
a	O
certain	O
size	O
without	O
rapidly	O
becoming	O
inefficient	O
due	O
to	O
merging	O
chains	O
;	O
to	O
deal	O
with	O
this	O
,	O
they	O
maintain	O
multiple	O
tables	O
,	O
and	O
each	O
lookup	B-Data_Structure
must	O
search	O
through	O
each	O
table	B-Data_Structure
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
can	O
achieve	O
similar	O
performance	O
with	O
tables	O
that	O
are	O
k	O
times	O
larger	O
,	O
allowing	O
them	O
to	O
perform	O
a	O
factor	O
of	O
k	O
fewer	O
lookups	B-Data_Structure
.	O
</s>
<s>
Starting	O
from	O
the	O
hash	B-Algorithm
(	O
"	O
re3xes	O
"	O
)	O
in	O
the	O
image	O
below	O
,	O
one	O
computes	O
the	O
last	O
reduction	O
used	O
in	O
the	O
table	B-Data_Structure
and	O
checks	O
whether	O
the	O
password	O
appears	O
in	O
the	O
last	O
column	O
of	O
the	O
table	B-Data_Structure
(	O
step	O
1	O
)	O
.	O
</s>
<s>
If	O
this	O
test	O
is	O
positive	O
(	O
step	O
3	O
,	O
linux23	O
appears	O
at	O
the	O
end	O
of	O
the	O
chain	O
and	O
in	O
the	O
table	B-Data_Structure
)	O
,	O
the	O
password	O
is	O
retrieved	O
at	O
the	O
beginning	O
of	O
the	O
chain	O
that	O
produces	O
linux23	O
.	O
</s>
<s>
Here	O
we	O
find	O
passwd	O
at	O
the	O
beginning	O
of	O
the	O
corresponding	O
chain	O
stored	O
in	O
the	O
table	B-Data_Structure
.	O
</s>
<s>
At	O
this	O
point	O
(	O
step	O
4	O
)	O
,	O
one	O
generates	O
a	O
chain	O
and	O
compares	O
at	O
each	O
iteration	O
the	O
hash	B-Algorithm
with	O
the	O
target	O
hash	B-Algorithm
.	O
</s>
<s>
We	O
find	O
the	O
hash	B-Algorithm
re3xes	O
in	O
the	O
chain	O
,	O
and	O
the	O
password	O
that	O
produced	O
it	O
(	O
culture	O
)	O
one	O
step	O
earlier	O
in	O
the	O
chain	O
:	O
the	O
attack	O
is	O
successful	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
use	O
a	O
refined	O
algorithm	O
with	O
a	O
different	O
reduction	B-Algorithm
function	I-Algorithm
for	O
each	O
"	O
link	O
"	O
in	O
a	O
chain	O
,	O
so	O
that	O
when	O
there	O
is	O
a	O
hash	B-Algorithm
collision	I-Algorithm
in	O
two	O
or	O
more	O
chains	O
,	O
the	O
chains	O
will	O
not	O
merge	O
as	O
long	O
as	O
the	O
collision	B-Algorithm
does	O
n't	O
occur	O
at	O
the	O
same	O
position	O
in	O
each	O
chain	O
.	O
</s>
<s>
This	O
increases	O
the	O
probability	O
of	O
a	O
correct	O
crack	O
for	O
a	O
given	O
table	B-Data_Structure
size	O
,	O
at	O
the	O
cost	O
of	O
squaring	O
the	O
number	O
of	O
steps	O
required	O
per	O
lookup	B-Data_Structure
,	O
as	O
the	O
lookup	B-Data_Structure
routine	O
now	O
also	O
needs	O
to	O
iterate	O
through	O
the	O
index	O
of	O
the	O
first	O
reduction	B-Algorithm
function	I-Algorithm
used	O
in	O
the	O
chain	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
are	O
specific	O
to	O
the	O
hash	B-Algorithm
function	I-Algorithm
they	O
were	O
created	O
for	O
e.g.	O
,	O
MD5	B-Algorithm
tables	O
can	O
crack	O
only	O
MD5	B-Algorithm
hashes	I-Algorithm
.	O
</s>
<s>
The	O
theory	O
of	O
this	O
technique	O
was	O
invented	O
by	O
Philippe	O
Oechslin	O
as	O
a	O
fast	O
form	O
of	O
time/memory	O
tradeoff	O
,	O
which	O
he	O
implemented	O
in	O
the	O
Windows	B-Application
password	O
cracker	O
Ophcrack	B-Application
.	O
</s>
<s>
The	O
more	O
powerful	O
RainbowCrack	B-General_Concept
program	O
was	O
later	O
developed	O
that	O
can	O
generate	O
and	O
use	O
rainbow	B-Algorithm
tables	I-Algorithm
for	O
a	O
variety	O
of	O
character	O
sets	O
and	O
hashing	O
algorithms	O
,	O
including	O
LM	O
hash	B-Algorithm
,	O
MD5	B-Algorithm
,	O
and	O
SHA-1	B-Algorithm
.	O
</s>
<s>
In	O
the	O
simple	O
case	O
where	O
the	O
reduction	B-Algorithm
function	I-Algorithm
and	O
the	O
hash	B-Algorithm
function	I-Algorithm
have	O
no	O
collision	B-Algorithm
,	O
given	O
a	O
complete	O
rainbow	B-Algorithm
table	I-Algorithm
(	O
one	O
that	O
makes	O
sure	O
to	O
find	O
the	O
corresponding	O
password	O
given	O
any	O
hash	B-Algorithm
)	O
the	O
size	O
of	O
the	O
password	O
set	O
|P|	O
,	O
the	O
time	O
T	O
that	O
had	O
been	O
needed	O
to	O
compute	O
the	O
table	B-Data_Structure
,	O
the	O
length	O
of	O
the	O
table	B-Data_Structure
L	O
and	O
the	O
average	O
time	O
t	O
needed	O
to	O
find	O
a	O
password	O
matching	O
a	O
given	O
hash	B-Algorithm
are	O
directly	O
related	O
:	O
</s>
<s>
A	O
rainbow	B-Algorithm
table	I-Algorithm
is	O
ineffective	O
against	O
one-way	B-Algorithm
hashes	I-Algorithm
that	O
include	O
large	O
salts	O
.	O
</s>
<s>
For	O
example	O
,	O
consider	O
a	O
password	B-Algorithm
hash	I-Algorithm
that	O
is	O
generated	O
using	O
the	O
following	O
function	O
(	O
where	O
""	O
is	O
the	O
concatenation	O
operator	O
)	O
:	O
</s>
<s>
The	O
salt	O
value	O
is	O
not	O
secret	O
and	O
may	O
be	O
generated	O
at	O
random	O
and	O
stored	O
with	O
the	O
password	B-Algorithm
hash	I-Algorithm
.	O
</s>
<s>
A	O
large	O
salt	O
value	O
prevents	O
precomputation	O
attacks	O
,	O
including	O
rainbow	B-Algorithm
tables	I-Algorithm
,	O
by	O
ensuring	O
that	O
each	O
user	O
's	O
password	O
is	O
hashed	O
uniquely	O
.	O
</s>
<s>
This	O
means	O
that	O
two	O
users	O
with	O
the	O
same	O
password	O
will	O
have	O
different	O
password	B-Algorithm
hashes	I-Algorithm
(	O
assuming	O
different	O
salts	O
are	O
used	O
)	O
.	O
</s>
<s>
The	O
salt	O
must	O
be	O
large	O
enough	O
,	O
otherwise	O
an	O
attacker	O
can	O
make	O
a	O
table	B-Data_Structure
for	O
each	O
salt	O
value	O
.	O
</s>
<s>
For	O
older	O
Unix	B-Algorithm
passwords	I-Algorithm
which	O
used	O
a	O
12-bit	O
salt	O
this	O
would	O
require	O
4096	O
tables	O
,	O
a	O
significant	O
increase	O
in	O
cost	O
for	O
the	O
attacker	O
,	O
but	O
not	O
impractical	O
with	O
terabyte	O
hard	O
drives	O
.	O
</s>
<s>
The	O
SHA2-crypt	O
and	O
bcrypt	O
methods	O
—	O
used	O
in	O
Linux	B-Application
,	O
BSD	B-Operating_System
Unixes	I-Operating_System
,	O
and	O
Solaris	B-Application
—	O
have	O
salts	O
of	O
128	O
bits	O
.	O
</s>
<s>
When	O
stretching	O
is	O
used	O
,	O
the	O
salt	O
,	O
password	O
,	O
and	O
some	O
intermediate	O
hash	B-Algorithm
values	O
are	O
run	O
through	O
the	O
underlying	O
hash	B-Algorithm
function	I-Algorithm
multiple	O
times	O
to	O
increase	O
the	O
computation	O
time	O
required	O
to	O
hash	B-Algorithm
each	O
password	O
.	O
</s>
<s>
For	O
instance	O
,	O
MD5-Crypt	O
uses	O
a	O
1000	O
iteration	O
loop	O
that	O
repeatedly	O
feeds	O
the	O
salt	O
,	O
password	O
,	O
and	O
current	O
intermediate	O
hash	B-Algorithm
value	O
back	O
into	O
the	O
underlying	O
MD5	B-Algorithm
hash	I-Algorithm
function	O
.	O
</s>
<s>
The	O
user	O
's	O
password	B-Algorithm
hash	I-Algorithm
is	O
the	O
concatenation	O
of	O
the	O
salt	O
value	O
(	O
which	O
is	O
not	O
secret	O
)	O
and	O
the	O
final	O
hash	B-Algorithm
.	O
</s>
<s>
This	O
principle	O
is	O
applied	O
in	O
MD5-Crypt	O
and	O
in	O
bcrypt	O
.	O
</s>
<s>
It	O
also	O
greatly	O
increases	O
the	O
time	O
needed	O
to	O
build	O
a	O
precomputed	O
table	B-Data_Structure
,	O
but	O
in	O
the	O
absence	O
of	O
salt	O
,	O
this	O
needs	O
only	O
be	O
done	O
once	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
and	O
other	O
precomputation	O
attacks	O
do	O
not	O
work	O
against	O
passwords	O
that	O
contain	O
symbols	O
outside	O
the	O
range	O
presupposed	O
,	O
or	O
that	O
are	O
longer	O
than	O
those	O
precomputed	O
by	O
the	O
attacker	O
.	O
</s>
<s>
Because	O
of	O
the	O
sizable	O
investment	O
in	O
computing	O
processing	O
,	O
rainbow	B-Algorithm
tables	I-Algorithm
beyond	O
fourteen	O
places	O
in	O
length	O
are	O
not	O
yet	O
common	O
.	O
</s>
<s>
Specific	O
intensive	O
efforts	O
focused	O
on	O
LM	O
hash	B-Algorithm
,	O
an	O
older	O
hash	B-Algorithm
algorithm	O
used	O
by	O
Microsoft	O
,	O
are	O
publicly	O
available	O
.	O
</s>
<s>
LM	O
hash	B-Algorithm
is	O
particularly	O
vulnerable	O
because	O
passwords	O
longer	O
than	O
7	O
characters	O
are	O
broken	O
into	O
two	O
sections	O
,	O
each	O
of	O
which	O
is	O
hashed	O
separately	O
.	O
</s>
<s>
Choosing	O
a	O
password	O
that	O
is	O
fifteen	O
characters	O
or	O
longer	O
guarantees	O
that	O
an	O
LM	O
hash	B-Algorithm
will	O
not	O
be	O
generated	O
.	O
</s>
<s>
Nearly	O
all	O
distributions	O
and	O
variations	O
of	O
Unix	B-Application
,	O
Linux	B-Application
,	O
and	O
BSD	B-Operating_System
use	O
hashes	B-Algorithm
with	O
salts	O
,	O
though	O
many	O
applications	O
use	O
just	O
a	O
hash	B-Algorithm
(	O
typically	O
MD5	B-Algorithm
)	O
with	O
no	O
salt	O
.	O
</s>
<s>
The	O
Microsoft	B-Application
Windows	I-Application
NT/2000	O
family	O
uses	O
the	O
LAN	O
Manager	O
and	O
NT	O
LAN	O
Manager	O
hashing	O
method	O
(	O
based	O
on	O
MD4	B-Algorithm
)	O
and	O
is	O
also	O
unsalted	O
,	O
which	O
makes	O
it	O
one	O
of	O
the	O
most	O
popularly	O
generated	O
tables	O
.	O
</s>
<s>
Rainbow	B-Algorithm
tables	I-Algorithm
have	O
seen	O
reduced	O
usage	O
as	O
of	O
2020	O
as	O
salting	O
is	O
more	O
common	O
and	O
GPU-based	O
brute	O
force	O
attacks	O
have	O
become	O
more	O
practical	O
.	O
</s>
<s>
However	O
,	O
rainbow	B-Algorithm
tables	I-Algorithm
are	O
available	O
for	O
eight	O
and	O
nine	O
character	O
NTLM	O
passwords	O
.	O
</s>
