2

I am new to Cryptography and unable to understand clearly about MAC concept. As per MAC concept, Sender 'A' will encrypt the original message with symmetric key to create MAC1 value and then will send the original message and MAC1 value to the receiver 'B'. Now, 'B' will encrypt the original message with same symmetric key to create MAC2 value.

If MAC1=MAC2, then message integrity is achieved.

I just want to understand why do the sender send original text in plain format? This would also attract eavesdrops to capture the message?

Please correct me if my understanding in wrong.

4

You are correct that by only using a MAC, an eavesdropper can read the message. This is because a MAC is designed, as you note, to protect message integrity, (as well as origin authenticity, hence the "authentication" bit of "message authentication code) not message confidentiality. If we want confidentiality, we use encryption instead. If we want (as we generally do) both confidentiality and integrity, we combine encryption and a MAC, using both.

If you were to use only a MAC, this is because the data is not secret. You don't care if it can be examined, only that it cannot be modified.

Just to note there are several ways to use a MAC in addition to encryption. You can MAC then (or and) encrypt, where the MAC is over the plaintext message, but modern cryptographic thought holds that this is inferior to encrypting first, and then MAC'ing the ciphertext and IV or nonce to ensure the integrity of the ciphertext.

  • 1
    You should mention Authenticated Encryption, and why manually combining cipher and MAC is considered a bad idea. – Z.T. Apr 7 '16 at 14:31
  • 1
    Slight nitpick: A MAC provides message authenticity, whereas a MIC provides message integrity. In many cases these are the same, and in most cases one implies the other, but in some cases this is not the case. Interchanging the terms can lead to misunderstandings. An example would be a manifest file containing plain SHA256 hashes of files, which itself is signed with RSA or similar. The plain hashes provide integrity, whereas the digital signature provides authenticity. The threat models against the two components of such a scheme are different, and this is important. – Polynomial Apr 7 '16 at 14:46
  • 1
    @Polynomial A MAC by common definition (and I've just double-checked the Handbook of Applied Cryptography and a few other sources) provides both authentication (which you're right, I didn't mention) and integrity. So while the authentication component is indeed important, it would be misleading to say that a MAC does not provide integrity, at least as commonly defined, though as you say, there may scenarios where this may not be the case. – Xander Apr 7 '16 at 14:56
  • @Polynomial I've added a note about authenticity. Thanks for pointing it out. – Xander Apr 7 '16 at 15:21
  • @Z.T. While certainly good points, I considered it and decided it would taking the answer too far off track down a a rabbit hole that's potentially endless. The only reason I brought up MtE vs EtM, in fact, what because the OP specifically referenced MAC'ing the plaintext. – Xander Apr 7 '16 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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