Authenticating a message
When providing message authentication, we have several methods that can provide assurance that the message came from an authorized sender and was not modified during transmission.
In this section, we'll take a look at creating a MAC using symmetric encryption for a single message such as a document. Then we'll take a look at using a MAC while encrypting data.
Let's start with how we can create a MAC.
Creating a MAC
A MAC is a code that authenticates or verifies the sender. To provide message authentication, we can use the following:
- Asymmetric (public key) encryption. We covered this method in Chapter 5 Dissecting Asymmetric Encryption, in the Creating a digital signature section.
- Symmetric encryption using a shared secret key.
Either method can be used when sending a message across an insecure network. The method used will depend on the application.
Let's outline what happens when creating a MAC using...