MAC Calculator
Compute ISO/IEC 9797-1 Message Authentication Codes with DES/TDEA — MAC Algorithm 1 (CBC-MAC with DES or TDEA) and Algorithm 3 (Retail MAC used in EMV/payment systems), with padding method 1, 2 or none.
Follows ISO/IEC 9797-1 MAC algorithms 1 and 3padding methods 1 and 2·verified Oct 2026· double-checked Oct 2026— Algorithm 1 reproduces the FIPS 113 sample MAC (F1D30F68); TDEA and Retail MAC cross-checked with OpenSSL and Python cryptography
Use test data only. All calculations run locally in your browser — PayProbe never sees, transmits, or stores your PAN, CVV, keys, PINs, or cryptographic inputs. How we handle data →
Input data
Algorithm overview
Algorithm 1 (CBC-MAC): a CBC chain with zero IV using the block cipher under the key given — single DES for an 8-byte key, TDEA (encrypt-decrypt-encrypt) for a 16- or 24-byte key. With an 8-byte key and padding method 1 this is the FIPS 113 / ANSI X9.9 MAC.
Algorithm 3 (Retail MAC, ANSI X9.19): needs a double-length key K ∥ K′. Every block is chained with single DES under K; the final chaining value is then decrypted under K′ and encrypted under K. Standard for EMV/payment systems. 24-byte keys are rejected: Algorithm 3 uses two keys.
ISO 9797-1's own Algorithm 2 (final encryption under a second key) and CMAC (Algorithm 5) are not offered here.
Padding method 1: append 0x00 bytes to the next 8-byte boundary (nothing if already aligned). Padding method 2: append 0x80, then 0x00 bytes to the next boundary (always at least one byte).