info > openssl-mac(1)

📛 NAME

openssl-mac - perform Message Authentication Code operations

🚀 Quick Reference

Use CaseCommandDescription
🔑 Compute HMAC-SHA1openssl mac -digest SHA1 -macopt hexkey:... -in msg.bin HMAC📄 Hex-encoded HMAC‑SHA1 of a file, output to stdout.
🔑 Compute CMAC‑AES‑128‑CBCopenssl mac -cipher AES-128-CBC -macopt hexkey:... -in msg.bin CMAC📄 Hex-encoded CMAC using AES‑128‑CBC.
🔑 Compute SipHashopenssl mac -macopt hexkey:... -in msg.bin -out out.bin -binary SipHash📄 Binary SipHash output.
🔑 Compute KMAC128 with customisationopenssl mac -macopt custom:Tag -macopt hexkey:... -macopt size:16 -in msg.bin KMAC128📄 Hex-encoded KMAC128 with custom string and output length 16.
🔑 Compute GMAC‑AES‑128‑GCMopenssl mac -cipher AES-128-GCM -macopt hexiv:... -macopt hexkey:... -in msg.bin GMAC📄 Hex-encoded GMAC with IV.

📖 SYNOPSIS

openssl mac [-help] [-cipher] [-digest] [-macopt] [-in filename] [-out filename] [-binary] [-provider name] [-provider-path path] [-propquery propq] mac_name

📝 DESCRIPTION

The message authentication code functions output the MAC of a supplied input file.

⚙️ OPTIONS

💡 EXAMPLES

# Create a hex-encoded HMAC-SHA1 MAC of a file and write to stdout:
openssl mac -digest SHA1 \
        -macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 \
        -in msg.bin HMAC
# Create a SipHash MAC from a file with a binary file output:
openssl mac -macopt hexkey:000102030405060708090A0B0C0D0E0F \
        -in msg.bin -out out.bin -binary SipHash
# Create a hex-encoded CMAC-AES-128-CBC MAC from a file:
openssl mac -cipher AES-128-CBC \
        -macopt hexkey:77A77FAF290C1FA30C683DF16BA7A77B \
        -in msg.bin CMAC
# Create a hex-encoded KMAC128 MAC from a file with a Customisation String 'Tag' and output length of 16:
openssl mac -macopt custom:Tag -macopt hexkey:40414243444546 \
        -macopt size:16 -in msg.bin KMAC128
# Create a hex-encoded GMAC-AES-128-GCM with a IV from a file:
openssl mac -cipher AES-128-GCM -macopt hexiv:E0E00F19FED7BA0136A797F3 \
        -macopt hexkey:77A77FAF290C1FA30C683DF16BA7A77B -in msg.bin GMAC

📝 NOTES

The MAC mechanisms that are available will depend on the options used when building OpenSSL. Use “openssl list -mac-algorithms” to list them.

🔗 SEE ALSO

©️ COPYRIGHT

Copyright 2018‑2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the “License”). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.

openssl-mac(1)
📛 NAME 🚀 Quick Reference 📖 SYNOPSIS 📝 DESCRIPTION ⚙️ OPTIONS 💡 EXAMPLES 📝 NOTES 🔗 SEE ALSO ©️ COPYRIGHT

Generated by phpman v4.9.26-1-g511901d Author: Che Dong Under GNU General Public License
2026-08-07 07:56 @216.73.216.207
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format