tags:

views:

133

answers:

2

My understanding of a message digest is that it's an encrypted hash of some data sent along with the encrypted data so you may verify that the data has not been tampered with. What is the difference then between this and message authentication codes (MAC) and hash MACs (HMAC)?

+1  A: 

Message Digest is simply a hash of a message. A Message Authentication Code is a piece of information that proves the integrity of a message and cannot be counterfeited easily. HMAC is a specific kind of MAC defined by RFC 2104.

Wikipedia has good articles covering all these terms.

Ondrej Tucny
+6  A: 
  • A message digest algorithm takes a single input -- a message -- and produces a "message digest" (aka hash) which allows you to verify the integrity of the message: Any change to the message will (ideally) result in a different hash being generated.
  • A MAC algorithm takes two inputs -- a message and a secret key -- and produces a MAC which allows you to verify the integrity and the authenticity of the message: Any change to the message or the secret key will (ideally) result in a different MAC being generated.
  • A HMAC algorithm is simply a specific type of MAC algorithm that uses a hash algorithm internally (rather than, for example, an encryption algorithm) to generate the MAC.
LukeH
+1 good, the only other thing i would mention is cmac mode using a block cipher.
Rook