CMAC Security API

Version: 1.0.0
Last Updated: 2025-01-02
Security Classification: Message Authentication Code
Author: MetaMUI Security Team

Overview

CMAC (Cipher-based MAC) is a block cipher-based message authentication code using AES, providing authentication and integrity.

Security Warnings ⚠️

  1. Key Management: Never reuse keys between CMAC and encryption
  2. Tag Truncation: Avoid truncating tags below 64 bits
  3. Nonce-less: Does not use nonces (deterministic)
  4. Block Cipher Based: Security depends on AES

API Functions

MAC Generation

def cmac_generate(key: bytes, message: bytes) -> bytes:
    """Generate CMAC tag for message"""

MAC Verification

def cmac_verify(key: bytes, message: bytes, tag: bytes) -> bool:
    """Verify CMAC tag (constant-time)"""

Security Best Practices

Security Analysis

Threat Model: CMAC Threat Model

The comprehensive threat analysis covers:

For complete security analysis and risk assessment, see the dedicated threat model documentation.

References

  1. NIST SP 800-38B: CMAC Mode

Back to Algorithm Security APIs