I am looking for hash functions. In this process i came across hash & keyed hash functions(HAMC). In which it uses some has function to generate MAC.

And also Matyas-Meyer-Oseas hash function, which is of block cipher hash function.

I would like to know the difference between HMAC, and hash functions?

And about Matyas-Meyer-Oseas hash function, how hash will be calculated?

At least where can i find proper solution for this?

  • 1
    $\begingroup$ What research have you done? I'm asking because sharing research efforts helps everyone! Tell us what research you did, what you found, and why it didn’t meet your needs. That shows users you took time trying to help yourself, it saves us from reiterating obvious answers, and (most important) it helps you to get more relevant on-point answers. In case of doubt, you can start by searching this site for related Q&As that might shed light on your question. At worst it will help you frame “a better question”; at best it might even answer it. $\endgroup$
    – e-sushi
    Feb 24, 2017 at 17:47

2 Answers 2


Intuitively a MAC is essentially the symmetric cryptography variant of a signature. To calculate a MAC a secret key which is shared between sender and receiver is used. This means that somebody who does not have the key cannot calculate the MAC.

A hash function on the other hand can be computed by anybody, uses no secrets and is simply used to get a shorter representation of data. For example, if somebody wants to sign an e-mail they usually hash it first and then sign the hash.

The Matyas–Meyer–Oseas construction is a way to construct a one-way compression function from a block cipher. This can then be used in the construction of a hash function, for example, using the Merkle–Damgård construction.

In particular, this means that the Matyas–Meyer–Oseas construction doesn't actually specify a complete hash function in an implementable way.

  • 2
    $\begingroup$ "A hash function on the other hand ... is simply used to get a shorter representation of data."; actually, there are additional reasons we use hash functions, such as in hash based signatures or commitment schemes, where we need oneway-ness... $\endgroup$
    – poncho
    Feb 24, 2017 at 17:44
  • $\begingroup$ Absolutely it's just the simplest reason that came to mind to use a hash even though it has no key. $\endgroup$
    – Elias
    Feb 24, 2017 at 18:08

By studying these links i understood Matyas–Meyer–Oseas,




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.