Prerequisite – Message authentication codes
Apart from intruders, the transfer of message between two people also faces other external problems like noise, which may alter the original message constructed by the sender. To ensure that the message is not altered there’s this cool method MAC.
MAC stands for Message Authentication Code. Here in MAC, sender and receiver share same key where sender generates a fixed size output called Cryptographic checksum or Message Authentication code and appends it to the original message. On receiver’s side, receiver also generates the code and compares it with what he/she received thus ensuring the originality of the message. These are components:
- MAC algorithm
- MAC value
There are different types of models Of Message Authentication Code (MAC) as following below:
- MAC without encryption –
This model can provide authentication but not confidentiality as anyone can see the message.
- Internal Error Code –
In this model of MAC, sender encrypts the content before sending it through network for confidentiality. Thus this model provides confidentiality as well as authentication.
M' = MAC(M, k)
- External Error Code –
For cases when there is an alteration in message, we decrypt it for waste, to overcome that problem, we opt for external error code. Here we first apply MAC on the encrypted message ‘c’ and compare it with received MAC value on the receiver’s side and then decrypt ‘c’ if they both are same, else we simply discard the content received. Thus it saves time.
c = E(M, k') M' = MAC(c, k)
Problems in MAC –
If we do reverse engineering we can reach plain text or even the key. Here we have mapped input to output, to overcome this we move on to hash functions which are “One way”.
Note – symbol “E” denotes symmetric key encryption.
- Computer Networks | Set 1
- Computer Networks | Set 2
- Computer Networks | Set 5
- Computer Networks | Set 3
- Computer Networks | Set 4
- Computer Networks | Set 12
- Computer Networks | Set 6
- Computer Networks | Set 7
- Computer Networks | Set 8
- Computer Networks | Set 9
- Computer Networks | Set 10
- Computer Networks | Set 11
- Last Minute Notes - Computer Networks
- Internet Control Message Protocol (ICMP) | Computer Networks
- Commonly asked Computer Networks Interview Questions | Set 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.