Skip to main content
A message authentication code (MAC) shows that data hasn’t changed since the MAC was generated, and that whoever generated it had access to the key. To generate a MAC, send your data to Infisical with a Generate/Verify MAC key. To check the data later, send the data and the MAC back with the same key. The key’s algorithm, such as HMAC-SHA-256, decides the MAC algorithm, so you don’t pick one for each request.

Prerequisites

Generate a MAC

1
In your KMS project, go to Overview, select the options menu on the key’s row, then select Generate MAC.
2
Enter your data in Data to Authenticate. If your data is already Base64 encoded, turn on Data is Base64 encoded.
3
Select Generate MAC, then copy the MAC from Message Authentication Code.

Verify a MAC

1
In your KMS project, go to Overview, select the options menu on the row of the key that generated the MAC, then select Verify MAC.
2
Enter the data in Data to Verify and the MAC in Message Authentication Code. If your data is already Base64 encoded, turn on Data is Base64 encoded.
3
Select Verify MAC. MAC Status shows Valid if the MAC matches the data, and Invalid if it doesn’t.