<s>
In	O
cryptography	O
,	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
MAC	O
)	O
,	O
sometimes	O
known	O
as	O
an	O
authentication	O
tag	O
,	O
is	O
a	O
short	O
piece	O
of	O
information	O
used	O
for	O
authenticating	O
a	O
message	O
.	O
</s>
<s>
The	O
term	O
message	B-Algorithm
integrity	I-Algorithm
code	I-Algorithm
(	O
MIC	O
)	O
is	O
frequently	O
substituted	O
for	O
the	O
term	O
MAC	O
,	O
especially	O
in	O
communications	O
to	O
distinguish	O
it	O
from	O
the	O
use	O
of	O
the	O
latter	O
as	O
media	O
access	O
control	O
address	O
(	O
MAC	O
address	O
)	O
.	O
</s>
<s>
However	O
,	O
some	O
authors	O
use	O
MIC	O
to	O
refer	O
to	O
a	O
message	B-Algorithm
digest	I-Algorithm
,	O
which	O
aims	O
only	O
to	O
uniquely	O
but	O
opaquely	O
identify	O
a	O
single	O
message	O
.	O
</s>
<s>
RFC	O
4949	O
recommends	O
avoiding	O
the	O
term	O
message	B-Algorithm
integrity	I-Algorithm
code	I-Algorithm
(	O
MIC	O
)	O
,	O
and	O
instead	O
using	O
checksum	B-Algorithm
,	O
error	B-Error_Name
detection	I-Error_Name
code	I-Error_Name
,	O
hash	B-Algorithm
,	O
keyed	O
hash	B-Algorithm
,	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
,	O
or	O
protected	O
checksum	B-Algorithm
.	O
</s>
<s>
Informally	O
,	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
system	O
consists	O
of	O
three	O
algorithms	O
:	O
</s>
<s>
A	O
secure	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
must	O
resist	O
attempts	O
by	O
an	O
adversary	O
to	O
forge	B-General_Concept
tags	I-General_Concept
,	I-General_Concept
for	I-General_Concept
arbitrary	I-General_Concept
,	I-General_Concept
select	I-General_Concept
,	I-General_Concept
or	I-General_Concept
all	I-General_Concept
messages	I-General_Concept
,	O
including	O
under	O
conditions	O
of	O
known	B-General_Concept
-	I-General_Concept
or	O
chosen-message	B-General_Concept
.	O
</s>
<s>
Formally	O
,	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
MAC	O
)	O
system	O
is	O
a	O
triple	O
of	O
efficient	O
algorithms	O
(	O
G	O
,	O
S	O
,	O
V	O
)	O
satisfying	O
:	O
</s>
<s>
While	O
MAC	O
functions	O
are	O
similar	O
to	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
,	O
they	O
possess	O
different	O
security	O
requirements	O
.	O
</s>
<s>
To	O
be	O
considered	O
secure	O
,	O
a	O
MAC	O
function	O
must	O
resist	O
existential	O
forgery	B-General_Concept
under	O
chosen-message	B-General_Concept
attacks	O
.	O
</s>
<s>
This	O
implies	O
that	O
the	O
sender	O
and	O
receiver	O
of	O
a	O
message	O
must	O
agree	O
on	O
the	O
same	O
key	O
before	O
initiating	O
communications	O
,	O
as	O
is	O
the	O
case	O
with	O
symmetric	B-Algorithm
encryption	I-Algorithm
.	O
</s>
<s>
MAC	O
algorithms	O
can	O
be	O
constructed	O
from	O
other	O
cryptographic	O
primitives	O
,	O
like	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
(	O
as	O
in	O
the	O
case	O
of	O
HMAC	B-Algorithm
)	O
or	O
from	O
block	O
cipher	O
algorithms	O
(	O
OMAC	B-Algorithm
,	O
CCM	B-Algorithm
,	O
GCM	B-Algorithm
,	O
and	O
PMAC	B-Algorithm
)	O
.	O
</s>
<s>
However	O
many	O
of	O
the	O
fastest	O
MAC	O
algorithms	O
like	O
UMAC-VMAC	O
and	O
Poly1305-AES	B-Algorithm
are	O
constructed	O
based	O
on	O
universal	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
Intrinsically	O
keyed	O
hash	B-Error_Name
algorithms	I-Error_Name
such	O
as	O
SipHash	B-Error_Name
are	O
also	O
by	O
definition	O
MACs	O
;	O
they	O
can	O
be	O
even	O
faster	O
than	O
universal-hashing	O
based	O
MACs	O
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS	O
)	O
,	O
the	O
input	B-General_Concept
data	I-General_Concept
is	O
split	O
in	O
halves	O
that	O
are	O
each	O
processed	O
with	O
a	O
different	O
hashing	O
primitive	O
(	O
SHA-1	B-Algorithm
and	O
SHA-2	B-Algorithm
)	O
then	O
XORed	O
together	O
to	O
output	O
the	O
MAC	O
.	O
</s>
<s>
Universal	B-Algorithm
hashing	I-Algorithm
and	O
in	O
particular	O
pairwise	O
independent	O
hash	B-Algorithm
functions	I-Algorithm
provide	O
a	O
secure	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
as	O
long	O
as	O
the	O
key	O
is	O
used	O
at	O
most	O
once	O
.	O
</s>
<s>
This	O
can	O
be	O
seen	O
as	O
the	O
one-time	B-Algorithm
pad	I-Algorithm
for	O
authentication	O
.	O
</s>
<s>
The	O
simplest	O
such	O
pairwise	O
independent	O
hash	B-Algorithm
function	I-Algorithm
is	O
defined	O
by	O
the	O
random	O
key	O
,	O
,	O
and	O
the	O
MAC	O
tag	O
for	O
a	O
message	O
m	O
is	O
computed	O
as	O
,	O
where	O
p	O
is	O
prime	O
.	O
</s>
<s>
More	O
generally	O
,	O
k-independent	B-Error_Name
hashing	I-Error_Name
functions	I-Error_Name
provide	O
a	O
secure	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
as	O
long	O
as	O
the	O
key	O
is	O
used	O
less	O
than	O
k	O
times	O
for	O
k-ways	O
independent	O
hashing	B-Error_Name
functions	I-Error_Name
.	O
</s>
<s>
Message	B-Algorithm
authentication	I-Algorithm
codes	I-Algorithm
and	O
data	O
origin	O
authentication	O
have	O
been	O
also	O
discussed	O
in	O
the	O
framework	O
of	O
quantum	O
cryptography	O
.	O
</s>
<s>
FIPS	O
PUB	O
113	O
Computer	O
Data	O
Authentication	O
,	O
withdrawn	O
in	O
2002	O
,	O
defines	O
an	O
algorithm	O
based	O
on	O
DES	B-Algorithm
.	O
</s>
<s>
ISO/IEC	B-Algorithm
9797-1	I-Algorithm
and	O
-2	O
define	O
generic	O
models	O
and	O
algorithms	O
that	O
can	O
be	O
used	O
with	O
any	O
block	O
cipher	O
or	O
hash	B-Algorithm
function	I-Algorithm
,	O
and	O
a	O
variety	O
of	O
different	O
parameters	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
FIPS	O
PUB	O
113	O
algorithm	O
is	O
functionally	O
equivalent	O
to	O
ISO/IEC	B-Algorithm
9797-1	I-Algorithm
MAC	O
algorithm	O
1	O
with	O
padding	O
method	O
1	O
and	O
a	O
block	O
cipher	O
algorithm	O
of	O
DES	B-Algorithm
.	O
</s>
