How message authentication code works? Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 19 Likes Like Report 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: Message Key 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. Create Quiz Comment K KattamuriMeghna Follow 19 Improve K KattamuriMeghna Follow 19 Improve Article Tags : Misc Computer Networks Articles Explore Computer Network BasicsBasics of Computer Networking4 min readTypes of Computer Networks6 min readIntroduction to Internet5 min readNetwork Devices4 min readWhat is OSI Model? - Layers of OSI Model11 min readTCP/IP Model6 min readOSI and TCP/IP Model4 min readPhysical LayerPhysical Layer in OSI Model3 min readTypes of Network Topology9 min readTransmission Modes3 min readTransmission Media in Computer Networks7 min readData Link LayerData Link Layer in OSI Model4 min readSwitching | Computer Networks2 min readVirtual LAN (VLAN)3 min readFraming in Data Link Layer3 min readError Control in Data Link Layer3 min readFlow Control4 min readPiggybacking in Computer Networks2 min readNetwork LayerNetwork Layer in OSI Model3 min readIntroduction of Classful IP Addressing7 min readClassless Addressing in IP Addressing7 min readWhat is an IP Address?11 min readIPv4 Datagram Header4 min readDifference Between IPv4 and IPv63 min readPublic and Private IP addresses4 min readIntroduction To Subnetting5 min readWhat is Routing?10 min readNetwork Layer Protocols9 min readTransport LayerTransport Layer in OSI Model4 min readTransport Layer Protocols9 min readTransmission Control Protocol - TCP4 min readUser Datagram Protocol - UDP3 min readSession Layer & Presentation LayerSession Layer in OSI model2 min readPresentation Layer in OSI model2 min readSecure Socket Layer (SSL)4 min readPoint-to-Point Tunneling Protocol - PPTP2 min readMultipurpose Internet Mail Extension (MIME) Protocol3 min readApplication LayerApplication Layer in OSI Model4 min readClient-Server Model3 min readWorld Wide Web (WWW)5 min readIntroduction to Electronic Mail4 min readWhat is a Content Distribution Network and how does it work?4 min readProtocols in Application Layer4 min readAdvanced TopicsWhat is Network Security?4 min readQuality of Service and Multimedia5 min readAuthentication in Computer Network3 min readEncryption, Its Algorithms And Its Future6 min readIntroduction of Firewall in Computer Network3 min readMAC Filtering in Computer Network3 min readWi-Fi Standards Explained2 min readWhat is Bluetooth?6 min readGenerations of wireless communication2 min readCloud Networking4 min readPracticeTop 50 Plus Networking Interview Questions and Answers15+ min readTop 50 TCP/IP Interview Questions and Answers 202515+ min readNetwork Fundamentals Interview Questions - Computer Networks15+ min readLast Minute Notes for Computer Networks14 min readComputer Network - Cheat Sheet15+ min read Like