  In this paper we present an algorithm to compute keyed hash function (message
authentication code MAC). Our approach uses a family of expander graphs of
large girth denoted $D(n,q)$, where $n$ is a natural number bigger than one and
$q$ is a prime power. Expander graphs are known to have excellent expansion
properties and thus they also have very good mixing properties. All
requirements for a good MAC are satisfied in our method and a discussion about
collisions and preimage resistance is also part of this work. The outputs
closely approximate the uniform distribution and the results we get are
indistinguishable from random sequences of bits. Exact formulas for timing are
given in term of number of operations per bit of input. Based on the tests, our
method for implementing DMAC shows good efficiency in comparison to other
techniques. 4 operations per bit of input can be achieved. The algorithm is
very flexible and it works with messages of any length. Many existing
algorithms output a fixed length tag, while our constructions allow generation
of an arbitrary length output, which is a big advantage.
