<s>
Digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
is	O
one	O
of	O
the	O
agreed-upon	O
methods	O
a	O
web	B-Application
server	I-Application
can	O
use	O
to	O
negotiate	O
credentials	O
,	O
such	O
as	O
username	O
or	O
password	O
,	O
with	O
a	O
user	O
's	O
web	B-Application
browser	I-Application
.	O
</s>
<s>
It	O
applies	O
a	O
hash	B-Algorithm
function	I-Algorithm
to	O
the	O
username	O
and	O
password	O
before	O
sending	O
them	O
over	O
the	O
network	O
.	O
</s>
<s>
In	O
contrast	O
,	O
basic	B-Protocol
access	I-Protocol
authentication	I-Protocol
uses	O
the	O
easily	O
reversible	O
Base64	B-Protocol
encoding	I-Protocol
instead	O
of	O
hashing	O
,	O
making	O
it	O
non-secure	O
unless	O
used	O
in	O
conjunction	O
with	O
TLS	B-Protocol
.	O
</s>
<s>
Technically	O
,	O
digest	B-Protocol
authentication	I-Protocol
is	O
an	O
application	O
of	O
MD5	B-Algorithm
cryptographic	B-Algorithm
hashing	I-Algorithm
with	O
usage	O
of	O
nonce	O
values	O
to	O
prevent	O
replay	O
attacks	O
.	O
</s>
<s>
It	O
uses	O
the	O
HTTP	B-Protocol
protocol	I-Protocol
.	O
</s>
<s>
Digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
was	O
originally	O
specified	O
by	O
(	O
An	O
Extension	O
to	O
HTTP:	O
Digest	B-Protocol
Access	I-Protocol
Authentication	I-Protocol
)	O
.	O
</s>
<s>
RFC	O
2069	O
specifies	O
roughly	O
a	O
traditional	O
digest	B-Protocol
authentication	I-Protocol
scheme	I-Protocol
with	O
security	O
maintained	O
by	O
a	O
server-generated	O
nonce	O
value	O
.	O
</s>
<s>
An	O
MD5	B-Algorithm
hash	I-Algorithm
is	O
a	O
16-byte	O
value	O
.	O
</s>
<s>
The	O
HA1	O
and	O
HA2	O
values	O
used	O
in	O
the	O
computation	O
of	O
the	O
response	O
are	O
the	O
hexadecimal	O
representation	O
(	O
in	O
lowercase	O
)	O
of	O
the	O
MD5	B-Algorithm
hashes	I-Algorithm
respectively	O
.	O
</s>
<s>
RFC	O
2069	O
was	O
later	O
replaced	O
by	O
(	O
HTTP	B-Protocol
Authentication	O
:	O
Basic	O
and	O
Digest	B-Protocol
Access	I-Protocol
Authentication	I-Protocol
)	O
.	O
</s>
<s>
RFC	O
2617	O
introduced	O
a	O
number	O
of	O
optional	O
security	O
enhancements	O
to	O
digest	B-Protocol
authentication	I-Protocol
;	O
"	O
quality	O
of	O
protection	O
"	O
(	O
qop	O
)	O
,	O
nonce	O
counter	O
incremented	O
by	O
client	O
,	O
and	O
a	O
client-generated	O
random	O
nonce	O
.	O
</s>
<s>
In	O
September	O
2015	O
,	O
RFC	O
7616	O
replaced	O
RFC	O
2617	O
by	O
adding	O
4	O
new	O
algorithms	O
:	O
"	O
SHA-256	B-Algorithm
"	O
,	O
"	O
SHA-256-sess	O
"	O
,	O
"	O
SHA-512-256	B-Algorithm
"	O
and	O
"	O
SHA-512-256-sess	O
"	O
.	O
</s>
<s>
The	O
encoding	O
is	O
equivalent	O
to	O
"	O
MD5	B-Algorithm
"	O
and	O
"	O
MD5-sess	O
"	O
algorithms	O
,	O
with	O
MD5	B-Algorithm
hashing	I-Algorithm
function	I-Algorithm
replaced	O
with	O
SHA-256	B-Algorithm
and	O
SHA-512-256	B-Algorithm
.	O
</s>
<s>
However	O
,	O
as	O
of	O
July	O
2021	O
,	O
none	O
of	O
popular	O
browsers	B-Application
,	O
including	O
Firefox	B-Application
and	O
Chrome	B-Application
,	O
support	O
SHA-256	B-Algorithm
as	O
the	O
hash	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
As	O
of	O
October	O
2021	O
,	O
Firefox	B-Application
93	O
officially	O
supports	O
"	O
SHA-256	B-Algorithm
"	O
and	O
"	O
SHA-256-sess	O
"	O
algorithms	O
for	O
digest	B-Protocol
authentication	I-Protocol
.	O
</s>
<s>
However	O
,	O
support	O
for	O
"	O
SHA-512-256	B-Algorithm
"	O
,	O
"	O
SHA-512-256-sess	O
"	O
algorithms	O
and	O
username	O
hashing	O
is	O
still	O
lacking	O
.	O
</s>
<s>
The	O
MD5	B-Algorithm
calculations	O
used	O
in	O
HTTP	B-Protocol
digest	I-Protocol
authentication	I-Protocol
is	O
intended	O
to	O
be	O
"	O
one	O
way	O
"	O
,	O
meaning	O
that	O
it	O
should	O
be	O
difficult	O
to	O
determine	O
the	O
original	O
input	O
when	O
only	O
the	O
output	O
is	O
known	O
.	O
</s>
<s>
If	O
the	O
password	O
itself	O
is	O
too	O
simple	O
,	O
however	O
,	O
then	O
it	O
may	O
be	O
possible	O
to	O
test	O
all	O
possible	O
inputs	O
and	O
find	O
a	O
matching	O
output	O
(	O
a	O
brute-force	O
attack	O
)	O
–	O
perhaps	O
aided	O
by	O
a	O
dictionary	O
or	O
suitable	B-Algorithm
look-up	I-Algorithm
list	I-Algorithm
,	O
which	O
for	O
MD5	B-Algorithm
is	O
readily	O
available	O
.	O
</s>
<s>
The	O
HTTP	B-Protocol
scheme	O
was	O
designed	O
by	O
Phillip	O
Hallam-Baker	O
at	O
CERN	O
in	O
1993	O
and	O
does	O
not	O
incorporate	O
subsequent	O
improvements	O
in	O
authentication	O
systems	O
,	O
such	O
as	O
the	O
development	O
of	O
keyed-hash	B-Algorithm
message	I-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
HMAC	B-Algorithm
)	O
.	O
</s>
<s>
Although	O
the	O
cryptographic	O
construction	O
that	O
is	O
used	O
is	O
based	O
on	O
the	O
MD5	B-Algorithm
hash	I-Algorithm
function	O
,	O
collision	B-Algorithm
attacks	I-Algorithm
were	O
in	O
2004	O
generally	O
believed	O
to	O
not	O
affect	O
applications	O
where	O
the	O
plaintext	O
(	O
i.e.	O
</s>
<s>
However	O
,	O
claims	O
in	O
2006	O
cause	O
some	O
doubt	O
over	O
other	O
MD5	B-Algorithm
applications	O
as	O
well	O
.	O
</s>
<s>
So	O
far	O
,	O
however	O
,	O
MD5	B-Algorithm
collision	B-Algorithm
attacks	I-Algorithm
have	O
not	O
been	O
shown	O
to	O
pose	O
a	O
threat	O
to	O
digest	B-Protocol
authentication	I-Protocol
,	O
and	O
the	O
RFC	O
2617	O
allows	O
servers	O
to	O
implement	O
mechanisms	O
to	O
detect	O
some	O
collision	O
and	O
replay	O
attacks	O
.	O
</s>
<s>
HTTP	B-Protocol
digest	I-Protocol
authentication	I-Protocol
is	O
designed	O
to	O
be	O
more	O
secure	O
than	O
traditional	O
digest	B-Protocol
authentication	I-Protocol
schemes	I-Protocol
,	O
for	O
example	O
"	O
significantly	O
stronger	O
than	O
(	O
e.g.	O
)	O
</s>
<s>
CRAM-MD5	O
...	O
"	O
(	O
RFC	O
2617	O
)	O
.	O
</s>
<s>
Some	O
of	O
the	O
security	O
strengths	O
of	O
HTTP	B-Protocol
digest	I-Protocol
authentication	I-Protocol
are	O
:	O
</s>
<s>
The	O
password	O
is	O
not	O
used	O
directly	O
in	O
the	O
digest	O
,	O
but	O
rather	O
HA1	O
=	O
MD5( 	O
username:realm:password	O
)	O
.	O
</s>
<s>
(	O
Public	B-Application
key	I-Application
systems	O
rely	O
on	O
the	O
user	O
being	O
able	O
to	O
verify	O
that	O
the	O
URL	O
is	O
correct	O
.	O
)	O
</s>
<s>
There	O
are	O
several	O
drawbacks	O
with	O
digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
:	O
</s>
<s>
Digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
is	O
vulnerable	O
to	O
a	O
man-in-the-middle	O
(	O
MITM	O
)	O
attack	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
MITM	O
attacker	O
could	O
tell	O
clients	O
to	O
use	O
basic	B-Protocol
access	I-Protocol
authentication	I-Protocol
or	O
legacy	O
RFC2069	O
digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
mode	O
.	O
</s>
<s>
A	O
server	O
can	O
store	O
HA1	O
=	O
MD5( 	O
username:realm:password	O
)	O
instead	O
of	O
the	O
password	O
itself	O
.	O
</s>
<s>
Also	O
,	O
since	O
the	O
MD5	B-Algorithm
algorithm	I-Algorithm
is	O
not	O
allowed	O
in	O
FIPS	O
,	O
HTTP	B-Protocol
Digest	I-Protocol
authentication	I-Protocol
will	O
not	O
work	O
with	O
FIPS-certified	O
crypto	O
modules	O
.	O
</s>
<s>
By	O
far	O
the	O
most	O
common	O
approach	O
is	O
to	O
use	O
a	O
HTTP+HTML	O
form-based	O
authentication	O
cleartext	O
protocol	O
,	O
or	O
more	O
rarely	O
Basic	B-Protocol
access	I-Protocol
authentication	I-Protocol
.	O
</s>
<s>
These	O
weak	O
cleartext	O
protocols	O
used	O
together	O
with	O
HTTPS	B-Protocol
network	O
encryption	O
resolve	O
many	O
of	O
the	O
threats	O
that	O
digest	B-Protocol
access	I-Protocol
authentication	I-Protocol
is	O
designed	O
to	O
prevent	O
.	O
</s>
<s>
However	O
,	O
this	O
use	O
of	O
HTTPS	B-Protocol
relies	O
upon	O
the	O
end	O
user	O
to	O
accurately	O
validate	O
that	O
they	O
are	O
accessing	O
the	O
correct	O
URL	O
each	O
time	O
to	O
prevent	O
sending	O
their	O
password	O
to	O
an	O
untrusted	O
server	O
,	O
which	O
results	O
in	O
phishing	O
attacks	O
.	O
</s>
<s>
Public	B-Application
key	I-Application
authentication	O
(	O
usually	O
implemented	O
with	O
a	O
HTTPS	B-Protocol
/	O
SSL	B-Protocol
client	O
certificate	O
)	O
using	O
a	O
client	O
certificate	O
.	O
</s>
<s>
Kerberos	B-Protocol
or	O
SPNEGO	B-Protocol
authentication	O
,	O
employed	O
for	O
example	O
by	O
Microsoft	B-Application
IIS	I-Application
running	O
configured	O
for	O
Integrated	O
Windows	O
Authentication	O
(	O
IWA	O
)	O
.	O
</s>
<s>
Secure	B-Protocol
Remote	I-Protocol
Password	I-Protocol
protocol	I-Protocol
(	O
preferably	O
within	O
the	O
HTTPS	B-Protocol
/	O
TLS	B-Protocol
layer	O
)	O
.	O
</s>
<s>
However	O
,	O
this	O
is	O
not	O
implemented	O
by	O
any	O
mainstream	O
browsers	B-Application
.	O
</s>
<s>
JSON	B-General_Concept
Web	I-General_Concept
Token	I-General_Concept
(	O
JWT	O
)	O
is	O
a	O
JSON-based	O
standard	O
RFC	O
7519	O
for	O
creating	O
access	O
tokens	O
that	O
assert	O
some	O
number	O
of	O
claims	O
.	O
</s>
<s>
Note	O
that	O
only	O
the	O
"	O
auth	O
"	O
(	O
authentication	O
)	O
quality	O
of	O
protection	O
code	O
is	O
covered	O
–	O
,	O
only	O
the	O
Opera	B-Application
and	O
Konqueror	B-Application
web	B-Application
browsers	I-Application
are	O
known	O
to	O
support	O
"	O
auth-int	O
"	O
(	O
authentication	O
with	O
integrity	O
protection	O
)	O
.	O
</s>
<s>
Although	O
the	O
specification	O
mentions	O
HTTP	B-Protocol
version	O
1.1	O
,	O
the	O
scheme	O
can	O
be	O
successfully	O
added	O
to	O
a	O
version	O
1.0	O
server	O
,	O
as	O
shown	O
here	O
.	O
</s>
<s>
The	O
server	O
responds	O
with	O
the	O
401	B-Protocol
"	I-Protocol
Unauthorized	I-Protocol
"	I-Protocol
response	O
code	O
,	O
providing	O
the	O
authentication	O
realm	O
and	O
a	O
randomly	O
generated	O
,	O
single-use	O
value	O
called	O
a	O
nonce	O
.	O
</s>
<s>
At	O
this	O
point	O
,	O
the	O
browser	B-Application
will	O
present	O
the	O
authentication	O
realm	O
(	O
typically	O
a	O
description	O
of	O
the	O
computer	O
or	O
system	O
being	O
accessed	O
)	O
to	O
the	O
user	O
and	O
prompt	O
for	O
a	O
username	O
and	O
password	O
.	O
</s>
<s>
If	O
the	O
username	O
is	O
invalid	O
and/or	O
the	O
password	O
is	O
incorrect	O
,	O
the	O
server	O
might	O
return	O
the	O
"	B-Protocol
401	I-Protocol
"	I-Protocol
response	I-Protocol
code	O
and	O
the	O
client	O
would	O
prompt	O
the	O
user	O
again	O
.	O
</s>
<s>
Where	O
values	O
are	O
combined	O
,	O
they	O
are	O
delimited	B-Algorithm
by	O
colons	O
.	O
</s>
<s>
The	O
MD5	B-Algorithm
hash	I-Algorithm
of	O
the	O
combined	O
username	O
,	O
authentication	O
realm	O
and	O
password	O
is	O
calculated	O
.	O
</s>
<s>
The	O
MD5	B-Algorithm
hash	I-Algorithm
of	O
the	O
combined	O
method	O
and	O
digest	O
URI	B-Protocol
is	O
calculated	O
,	O
e.g.	O
</s>
<s>
The	O
MD5	B-Algorithm
hash	I-Algorithm
of	O
the	O
combined	O
HA1	O
result	O
,	O
server	O
nonce	O
(	O
nonce	O
)	O
,	O
request	O
counter	O
(	O
nc	O
)	O
,	O
client	O
nonce	O
(	O
cnonce	O
)	O
,	O
quality	O
of	O
protection	O
code	O
(	O
qop	O
)	O
and	O
HA2	O
result	O
is	O
calculated	O
.	O
</s>
<s>
In	O
the	O
example	O
given	O
above	O
the	O
result	O
is	O
formed	O
as	O
follows	O
,	O
where	O
MD5( )	O
represents	O
a	O
function	O
used	O
to	O
calculate	O
an	O
MD5	B-Algorithm
hash	I-Algorithm
,	O
backslashes	O
represent	O
a	O
continuation	O
and	O
the	O
quotes	O
shown	O
are	O
not	O
used	O
in	O
the	O
calculation	O
.	O
</s>
<s>
At	O
this	O
point	O
the	O
client	O
may	O
make	O
another	O
request	O
,	O
reusing	O
the	O
server	O
nonce	O
value	O
(	O
the	O
server	O
only	O
issues	O
a	O
new	O
nonce	O
for	O
each	O
"	B-Protocol
401	I-Protocol
"	I-Protocol
response	I-Protocol
)	O
but	O
providing	O
a	O
new	O
client	O
nonce	O
(	O
cnonce	O
)	O
.	O
</s>
<s>
Obviously	O
changing	O
the	O
method	O
,	O
URI	B-Protocol
and/or	O
counter	O
value	O
will	O
result	O
in	O
a	O
different	O
response	O
value	O
.	O
</s>
<s>
.htdigest	O
is	O
a	O
flat-file	B-Application
used	O
to	O
store	O
usernames	O
,	O
realm	O
and	O
passwords	O
for	O
digest	B-Protocol
authentication	I-Protocol
of	O
Apache	B-Application
HTTP	I-Application
Server	I-Application
.	O
</s>
<s>
The	O
name	O
of	O
the	O
file	O
is	O
given	O
in	O
the	O
.htaccess	B-Protocol
configuration	O
,	O
and	O
can	O
be	O
anything	O
,	O
but	O
"	O
.htdigest	O
"	O
is	O
the	O
canonical	O
name	O
.	O
</s>
<s>
The	O
file	O
name	O
starts	O
with	O
a	O
dot	O
,	O
because	O
most	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
consider	O
any	O
file	O
that	O
begins	O
with	O
dot	O
to	O
be	O
hidden	O
.	O
</s>
<s>
This	O
file	O
is	O
often	O
maintained	O
with	O
the	O
shell	B-Operating_System
command	O
"	O
htdigest	O
"	O
which	O
can	O
add	O
,	O
and	O
update	O
users	O
,	O
and	O
will	O
properly	O
encode	O
the	O
password	O
for	O
use	O
.	O
</s>
<s>
The	O
"	O
htdigest	O
"	O
command	O
is	O
found	O
in	O
the	O
apache2-utils	O
package	O
on	O
dpkg	B-Language
package	O
management	O
systems	O
and	O
the	O
httpd-tools	O
package	O
on	O
RPM	B-Application
package	I-Application
management	I-Application
systems	O
.	O
</s>
<s>
Session	B-Application
Initiation	I-Application
Protocol	I-Application
(	O
SIP	O
)	O
uses	O
basically	O
the	O
same	O
digest	B-Protocol
authentication	I-Protocol
algorithm	O
.	O
</s>
<s>
Most	O
browsers	B-Application
have	O
substantially	O
implemented	O
the	O
spec	O
,	O
some	O
barring	O
certain	O
features	O
such	O
as	O
auth-int	O
checking	O
or	O
the	O
MD5-sess	O
algorithm	O
.	O
</s>
<s>
If	O
the	O
server	O
requires	O
that	O
these	O
optional	O
features	O
be	O
handled	O
,	O
clients	O
may	O
not	O
be	O
able	O
to	O
authenticate	O
(	O
though	O
note	O
mod_auth_digest	O
for	O
Apache	B-Application
does	O
not	O
fully	O
implement	O
RFC	O
2617	O
either	O
)	O
.	O
</s>
<s>
Tasman-based	O
:	O
</s>
<s>
Trident-based	O
:	O
</s>
<s>
Presto-based	O
:	O
</s>
<s>
Because	O
of	O
the	O
disadvantages	O
of	O
Digest	B-Protocol
authentication	I-Protocol
compared	O
to	O
Basic	B-Protocol
authentication	I-Protocol
over	O
HTTPS	B-Protocol
it	O
has	O
been	O
deprecated	O
by	O
a	O
lot	O
of	O
software	O
e.g.	O
</s>
