0% found this document useful (0 votes)
72 views6 pages

Comparison Between Various Message Authentication Code (MAC) Generation Methods

1) The document compares different methods for generating Message Authentication Codes (MACs), including using block cipher algorithms like OMAC, CBC-MAC, and PMAC or using hash functions like HMAC. 2) MACs provide data integrity and authentication by using a secret key to generate a code for a message. This allows verification of the message sender and that the message was not altered. 3) The advantages and disadvantages of block cipher-based and hash-based MAC generation methods are discussed. The possibility of new MAC generation methods is also mentioned.

Uploaded by

Rafa Assyifa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views6 pages

Comparison Between Various Message Authentication Code (MAC) Generation Methods

1) The document compares different methods for generating Message Authentication Codes (MACs), including using block cipher algorithms like OMAC, CBC-MAC, and PMAC or using hash functions like HMAC. 2) MACs provide data integrity and authentication by using a secret key to generate a code for a message. This allows verification of the message sender and that the message was not altered. 3) The advantages and disadvantages of block cipher-based and hash-based MAC generation methods are discussed. The possibility of new MAC generation methods is also mentioned.

Uploaded by

Rafa Assyifa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Comparison Between Various Message Authentication

Code (MAC) Generation Methods


IF3058 – Kriptografi
Halida Astatin (13507049)1
Program Studi Teknik Informatika
Sekolah Teknik Elektro dan Informatika
Institut Teknologi Bandung, Jl. Ganesha 10 Bandung 40132, Indonesia
1
[email protected]

Abstract—MAC (Message Authentication Code) about the secrecy of the email they sent, but they
Algorithm is an algorithm which accepts a private key and a definitely want to be sure that the email they received was
message to be authenticated, and later extracts a MAC tag. indeed the one being sent. It may seem that encryption
The value of a MAC protects the data integrity and also the
also provides the aspect of protecting data integrity, but
content of the message. Despites its similarity with hash
functions, both algorithm has different security needs. To be that is not always the case. Once an attacker finds out the
considered secure, a MAC function has to be able to survive algorithm used to encrypt the data, he can afterwards use
chosen-plaintext attack. This means that although an the algorithm to create fake data and intercepts the real
attacker knows the MAC value of a message, it has to take message being sent.
him a lot amount of effort to crack other messages. MAC is There are many different methods to generate message
also different from a digital signature, because MAC is
authentication code, a couple examples are using block-
generated and verified using the same private key.
There are several different methods that can be applied to cipher algorithm or hash functions. In this paper we shall
generate MAC value, for example by using the block-cipher discuss the advantages and disadvantages of each method
algorithm (OMAC, CBC-MAC, and PMAC), or using hash which can be used to generate a MAC value. Furthermore
value (HMAC). In this paper we shall discuss the advantages this paper will discuss the possibility of a modified MAC
and disadvantages of each method, also the possibility of generation method.
creating new MAC generation method.

Index Terms—Algorithm, generation, MAC, methods. II. MESSAGE AUTHENTICATION CODE


Message Authentication Code (MAC) is a short piece
I. INTRODUCTION of information in the form of a code that can be used to
authenticate another piece of information in form of a
The advancement of information technology has message. MAC is a one-way function which uses a secret
changed many aspects of our daily life. The changes made key in generating its hash value. The hash value generated
by information technology’s vast advancements includes by using MAC is always of a fixed size for any size of
the usage of network as a means of data sharing. message. Once generated, a MAC value is embedded into
However, this action has brought up the issue of data the message it corresponds to. Afterwards, MAC is used
integrity and security. A network is something highly to authenticate the message without having to encrypt the
accessible to unlimited amount of people around the message itself. However, MAC is different from a digital
world, and therefore in the case of data trading across signature because it merely provides the function of
network, the security of said data is relatively low. authentication and message integrity.
Up until now, cryptography, especially the modern A MAC Algorithm is an algorithm that accepts a
algorithms which work in bit-mode, has been considered private key and the message to be authenticated, and
a reliable method to secure data. Mainly the focus of afterwards extracts a MAC tag. The MAC value protects
cryptography is about data secrecy, but there are also not only the integrity of data, but also detects any changes
other cases in which cryptography protects data integrity. done to the contents of the message. In mathematical
One of the threats faced by data shared over the network notation, MAC goes:
is forgery or fraud. To ensure the integrity and
authentication of data, one of the method that can be MAC = CK (M)
applied is Message Authentication Code (MAC).
In many occasions, people does not care about the Where MAC is the hash value generated by the
secrecy of, for example, an email they sent using an email function, C is the hash function or MAC algorithm, and K
provider across the internet. People does not worry much equals secret key used in function.
Despite its similarity with hash functions, MAC and MAC is used for message authentication without
hash functions each possesses different security needs. having to encrypt the message itself. Using a secret key K
They both corresponds to different security aspects to be (sender and receiver are assumed to have agreed upon a
handled. To be considered secure, a MAC algorithm has certain secret key beforehand), the sender would compute
to survive forgery done using chosen-plaintext attack. In the MAC value of a message he is trying to send. The
other words, although an attacker knows the MAC value MAC value that has been computed would then be
of a message, it should take him a great amount of effort embedded into the message, and afterwards the message
to find the MAC value of other messages. which has already included the MAC value will be sent to
As mentioned above, MAC algorithms differ from the receiver. Using the exact same key, the receiver would
digital signatures. Although both methods bear the same then compute the message’s MAC value and compare it
function in its relation with data integrity and to the MAC value he received in said message. Should the
authentication, the two are different because MAC is two MAC values corresponds to each other, it can be
generated and verified using a certain secret key. concluded that the message was sent by a legit person and
Therefore, before beginning communication, both sender that the content of the message had not undergo any
and receiver of the message in question need to agree changes during transmission process. If the message was
upon a certain key. Consequently, MAC does not serve not originated from the real sender, the MAC value of the
the cryptographic function of non-repudiation. Any user sender would not be the same as the MAC value
who can verify a MAC can also generate MAC values for generated in the receiver’s end, because supposedly there
other messages. Contrary to that, a digital signature uses are no other parties other than the sender and receiver
the private key of a key pair, or using asymmetric who knows exactly what the secret key is. Same goes for
encryption method. This private key is accessible to its the case in which the content of the message is changed
holder only, hence a digital signature proves that a during transmission, the MAC value would not be
document was signed by no other than the holder of that corresponding with each other.
private key. This means that digital signatures provides
the user with non-repudiation.
MAC can be applied in authentication of an archive
used by two or more users. In exchanging data, forgery is
highly likely, hence the usage of MAC. By the means of
MAC, the two or more party sharing the same archive can
always be convinced of the authenticity of the other
parties. Other than that, MAC can also be applied in
protecting the integrity and authenticity of the archive’s
content, for example due to a virus attack.
This is how we check an archive’s integrity: compute
the MAC value of said archive, then put the MAC value
in a table. If the protection of the data is done by using a
certain hash function (for example MD5 or SHA-1), a
Figure 2 An example of MAC implementation in message
virus could then compute the hash value of the archive it
exchange
attacks and swap the value in the table. This is not
applicable, however, when a data is protected using
MAC, because the virus would not know the key used to The figure above describes the use of MAC in message
generate the message authentication code. exchanging. In the example, the message sender runs the
message through a MAC algorithm to produce MAC tag.
Afterwards, the message and the MAC data tag are sent to
the receiver. The receiver then would run the same
message through the same MAC algorithm using the
same secret key, producing his own MAC data tag. The
receiver should then compare the MAC data tag he
received from the sender with the one he generated
himself. If they are identical, the receiver can assume that
the integrity of the message has not been compromised,
and the message has not been altered during the
transmission of the message.
In its application, there are several points in MAC’s
security aspect to be noticed, including the security of the
key, the algorithm used, and forgery. The security of a
MAC algorithm is highly dependent to the secrecy of the
Figure 1Message Authentication Using MAC key used to generate the MAC value. Both the sender and
the receiver needs to protect the key from any threats it the message is exactly the same as the message that was
may face. Secondly, the MAC algorithm applied in meant to be sent to him.
generating a MAC also determines how secure the said Masukan Nilai hash

MAC is. Lastly, the security level of a MAC can be


determined by how it can protect a message against aa6df57fb6fe377d80
Halo Fungsi hash
forgery. A MAC is considered to fail when a third party b4a257b4a92cba

who does not possess the secret key K can figure out
chunks of messages and its MAC value. Said attacker can
be assumed to have compiled several examples of text Nomor teleponku 09c88f0b91d74b292
Fungsi hash
08122113451 e6f89587ab63921
and its valid MAC value by executing an act of
observation to the dataflow path between the sender and
the receiver. "Tsunami" menjadi
a996de118c61eac49
kata yang populer Fungsi hash
Further information that we can use to ensure the di Indonesia saat ini
63989aa2d73e67e

security level of the MAC algorithm implied is by


knowing the types of attack that the MAC algorithm may Figure 3Message examples and their message digests
be up against. Several types of these attacks are known-
text attack, chosen-text attack, adaptive chosen-text
Each and every message digest is unique, but it is not
attack, and brute force attack. Known-text attack is a type
reversible to its original message. A message digest is
of attack that can occur to a MAC in which the attacker
calculated by the sender and sent with the message, and
may be able to determine the pattern of MAC from two or
later the receiver should calculate the message digest of
more pair of message and its MAC. Chosen-text attack is
the message and compare it to the message digest value
a type of attack that is likely to occur to a MAC in which
sent to him. If the two message digest values are the
the attacker may be able to determine the pattern of the
same, it can be concluded that the message is legit.
MAC from a pair of message and its MAC of his own
According to that definition, it may be inferred that
choice.
MAC and hash function are the same. Both methods
The next threat a MAC is up against is the adaptive
concludes a message into a certain unique message of a
chosen-text attack. It is a type of attack a MAC may face
fixed length to guarantee the authenticity and integrity of
in which the attacker can determine the pattern of MAC
a message. However, these two needs to be distinguished.
from a certain pair of message and its MAC which later
Unlike MAC, a hash function only accepts one parameter,
leads to the discovery of the secret key used in generating
which is the document to be hashed, while MAC accepts
MAC values. Last threat against a MAC is a brute force
also a certain secret key. Since the difference of the two
attack. The brute force attack is one of the most common
methods only lies in the usage of secret key, MAC is also
attack in cryptography. A typical brute force attack is to
often called keyed-hash function.
try every single possible combination in order to obtain a
The advantage MAC has against hash function is that
certain value. In the case of MAC, a brute force attacker
only certain parties can generate the MAC data tag,
would possibly try each and every single possibility of a
because it requires a secret key that only authorized
message o correspond to a certain known hash value.
people has access to. Meanwhile, hash message digest can
There are several methods that can be applied in
be generated by anyone who knows the function used to
generating MAC values. A couple of said method are
hash the message.
using a certain block-cipher algorithm (this is applied in
OMAC, CBC-MAC, and PMAC) or using a hash function
(applied in HMAC). B. MAC versus Digital Signature
Several of the difference between MAC and digital
signature has already been discussed in the previous part
III. MAC AND ITS COMPARISON AGAINST of the paper, but in this part the differences mentioned
DIFFERENT DATA SECURITY METHODS before should be discussed further.
A digital signature is a method to authenticate a digital
A. MAC versus Hash Function message or document. A valid digital signature should
It has been briefly discussed before about the give the receiver of a message assurance that the message
differences between MAC and hash functions. In this part was created by a valid sender and has not been altered in
the aspects that makes the two distinguishable will be any ways. Digital signatures are commonly implemented
further reviewed. in the distribution of software, financial transactions, or
A hash function is a function that accepts a string input any other cases where forgery and tampering is a serious
of arbitrary length then transform the string into an output threat.
string that has a fixed length, most commonly of a far Digital signatures employ the concept of asymmetric
smaller size than the input string. cryptography. Digital signatures can be considered
The output string is often called a message digest. A equivalent to the traditional handwritten signatures in the
message digest is a unique summary of a message which sense of its functions. Digital signatures that are properly
would help the message receiver determine whether or not
implemented are even more resistant to forgery than the
traditional handwritten signatures. Also, different from
the handwritten signature, the value of digital signature IV. MAC GENERATION METHODS
differs depending on the document it signs.
A digital signature is the cipher text generated from a A. Hash-based Message Authentication Code
document’s hash value. The sender signs the document (HMAC)
using the sender’s private key, and later the receiver of HMAC (Hash-based Message Authentication Code) is
the message would verify the document using the a certain method to compute the value of a message’s
sender’s public key. Therefore, unlike in the usage of MAC that involves the use of a cryptographic hash
MAC, the sender and receiver do not need to agree upon a function combined with a secret key. The value will then
certain key beforehand. The private key used to encrypt be used to verify data integrity and authenticity of a
the message is accessible to the sender only, therefore a message. The hash function used to generate the MAC
digital signature proves that a document was signed by may vary; one can apply the MD5 algorithm or SHA-1,
none other than the holder of the private key. In this case, depending on their own preference. The resulting MAC
unlike MAC, digital signatures provide non-repudiation algorithm is termed HMAC-MD5 or HMAC-SHA-1,
aspect of message protection. depending on the hash function used to create the MAC
algorithm. The strength of a MAC algorithm therefore is
affected by the strength of the underlying hash function,
the length of the resulting message digest and also on the
size and quality of the secret key.
The size of the result of a Hash-based MAC depends
on the size of the result of the hash function, although it
can be truncated if desired.
The size of key used in HMAC has to be of the same
size as L/2 or longer, in which L is the size of the
resulting hash value. For applications that allow the secret
key size of k in which k is larger than the size of the
document itself, k has to be hashed before processed.
To implements a hash-based MAC algorithm, first of
all for example the people involved in data sharing are
Figure 4 The process of signing and verifying using Alice and Bob, and they both shared a secret key K. Alice
digital signature should then connate the message M with K and compute
the hash value of the result. The hash value resulted is the
It may seem that digital signatures are more convenient MAC value of said message, generated using the secret
to use, but in this case MAC offers a simplicity that a key K.
digital signature does not provide. The creation of a
digital signature involves a lot of complex steps, as is B. Block Cipher-based Message Authentication
explained by the figure above and below. Code (CMAC)
CMAC (Cipher-based Message Authentication Code)
is a certain method to compute the value of a message’s
MAC that is based on the use of a block cipher function.
It can be utilized to provide the sender and receiver of the
message with authenticity and integrity of a binary data.
Unlike CBC-MAC which is only secure for a fixed-length
messages, CMAC solves the security limitation of the
CBC-MAC.

Figure 5 Digital signature signing and verification


procedure
pad. In this method, MAC value is generated by using one
time pad stored in a program. This key is known only to
the person who has access to the one time pad stored in
the program.
To check the integrity of the message, the receiver has
to make use of the program storing the same one time pad
as the one used in encrypting the document. This will
become a redundancy when the program has to be sent
together with the document it encrypts. The one time pad
used is disposable—it has to be purged once used so that
it will not be used to encrypt any other documents.

Figure 6 Cipher-based MAC Schema V. ANALYSIS: COMPARISON AMONG VARIOUS MAC


GENERATION METHODS
The main substance of CMAC algorithm is a In generating a MAC value of a message, the usage of
modification of CBC-MAC that is analyzed under the hash function is considered a lot more complicated than
name XCBC. This algorithm is developed by Black and using a cipher algorithm. The reason to this is because
Rogaway; focused mainly on eliminating the security hash functions (such as MD5, SHA-1, etcetera)
deficiencies CBC-MAC possessed, but at the time it commonly already has a certain default function, and it
required three different secret keys. Iwata and Kurosawa has to be modified in such a way so that it can also accept
then proposed an improvement to XCBC, naming the and process the secret key K. Meanwhile, cipher
output algorithm as one-key-CBC-MAC (OMAC). Later algorithm does not need any modification since it also
they submitted OMAC1, a revision to OMAC with uses a certain secret key in generating a function result.
additional security analysis. CMAC here is equivalent to Nevertheless, in using a cipher-based MAC, we need to
OMAC1. determine which part of the document should be
In block cipher-based MAC algorithm, the MAC value encrypted and considered as its MAC value.
is generated by using a cipher block algorithm with CBC In cipher block mode, when an encryption process is
or CFB mode. The hash value, or in this case the MAC done only once (using any mode other than CBC), it is
value, is the result of last block’s encryption. If for highly likely that several documents may have exact same
example the cipher block used is DES, then the block size MAC values. That is, if the encrypted block is identical.
would be 64 bits, and the secret key to the MAC As a result, cipher block-based MAC requires a
algorithm is the DES key sized 56 bits. Data complicated algorithm, just like CBC, that forces the
Authentication Algorithm (DAA) is a DES-CBC based original document to be processed over and over again.
MAC algorithm that has been widely used. On the other hand, in the usage of stream cipher-based
MAC, the possibility of two different documents having
an identical MAC value is relatively low. This is because
C. Stream Cipher-based Message Authentication MAC bits consist of message bits that is distributed
Code (CMAC) everywhere inside the document, which causes the MAC
Stream cipher approach is based on bit operation, value to be distinctive from others.
which is taking chunks of bits from the document to be As for one time pad-based MAC, this method is
encrypted into a MAC. An example is the stream cipher- exceptionally safe because only the program and the
based MAC algorithm designed by the researcher in RSA sender knows the key and the program could then
laboratory, whose algorithm outputs MAC bits in the size generate MAC automatically. However, the effort
of half its original document. required to conduct this method is not worthy of the
To create a stream cipher-based algorithm MAC value, safety, especially with the existence of other much
the steps to go through are as follows. First of all, the simpler MAC methods.
document should be divided into two parts, and each part It is also possible to combine a cipher-based MAC
should undergo an LFSR operation before being generation algorithm with hash-based MAC generation
processed. The document parts will then be processed to algorithm. To do so, first of all we process the document
obtain the MAC value. in question using a selected hash function. The result of
this function will then be processed into a cipher-block
D. One time pad-based Message Authentication encryption (preferably in CBC or CFB mode). In this
case, the MAC value is the final result of this encryption
Code
process.
There is also another approach in generating a MAC
value, which uses the utilization of an ancient
unbreakable cryptography technique, which is one time
VI. CONCLUSION STATEMENT
There are several conclusions that can be drawn from I hereby certify that this paper is an original work; not a
the discussion in this paper: paraphrase or translation of someone else’s paper, neither
a. Despite the similarity the two data security method is this an act of plagiarism.
possess, MAC is different from both digital
signature and hash function. It is however said that Bandung, May 17th 2010
MAC can be called a keyed-hash function because
the difference lies only in the usage of a secret key signed
in MAC.
b. There are various different method to generate a
MAC value, some of them are hash-based MAC
algorithm, cipher-based MAC algorithm, and one
time pad-based MAC algorithm.
c. Hash-based algorithm is relatively faster to
compute, but cipher-based algorithm needs less
modification. One time pad, on the other hand, Halida Astatin
despite its high security level, is not preferable due 13507049
to the complexity it possess.
d. As a new method to generate MAC value, the
combination of hash-based algorithm with cipher
based algorithm may be considered. To do so, the
document to encrypt should be processed using a
certain hash function, then the result will be
processed using cipher-based algorithm.

VII. ACKNOWLEDGMENT
In the making of this paper, author thanks google.com
for always being a reliable search engine; a very useful
one also. Wikipedia.org for being a very resourceful
website, although many had said that it is not always
reliable. Author thanks her parents and sister for the
understanding they had given in during the author’s
campus life and its never-ending stream of tasks. Also for
every friends who spent the nights together working on
the tasks, especially the certain friend who never mind
driving halfway across Bandung to drive me home. It
would have been a lot harder to finish this paper without
the aid of said people. Thank you very much.

REFERENCES
Munir, Rinaldi. 2004. Bahan Kuliah IF3058 Kriptografi. Departemen
Teknik Informatika, Institut Teknologi Bandung.
Rifki, Guntur. 2009. Implementasi Algoritma Enkripsi Rijndael dan
Metode Otentikasi MAC(Message Authentication Code) dalam
SMS. Institut Teknologi Telkom.
Safrina, Rika. 2007. Cryptography Paper: ―Pembangunan Algoritma
MAC Berbasis Cipher Aliran‖. Institut Teknologi Bandung.
http://www.cs.princeton.edu/courses/archive/fall07/cos433/lec8.pdf
https://tao.truststc.org/Members/yuanxue/network_security/Public%20re
sources/lecture10_folder/lecture10_notes/download

You might also like