ISO8583 payments MAC Calculator

Calculate message Retail MAC (Message Authentication Code)

MAC key (8 or 16 bytes, represented as 16 or 32 hex digits):

Data to apply MAC to:

[for binary data, convert it to hex and select the Hex option below]

Data format is: Hex Ascii

Algorithm used: DES 3DES

Finish operation: DES 3DES

How MAC {Message Authentication Code} Calculation works works

Let us start with this input data: 01234567890123450123456789012345

We will take the same value as the key: 01234567890123450123456789012345

We will take the setting of encryption as triple DES: 3DES

And the finish block will also be encrypted triple DES:3DES

Triple DES needs 3 keys, so up to 48 hex characters. We only provided 32 hex characters, 16 bytes double-key, the most used scenario

The first key is the first 8 bytes, first 16 hex characters(0-16);

The second key is the next 8 bytes, next 16 hex characters(16-32);

The third key is the first 8 bytes, first 16 hex characters(32-48 or 0-16) because we do not have a triple-length key;

k1:0123456789012345

k2:0123456789012345

k3:0123456789012345

We split the entire input data into blocks of 8 byes, or 16 hex characters

block:0123456789012345

We xor this block with the previous block. If this is the first block, we xor it with a block of all -zeroes

xor:0123456789012345

We perform a DES encryption of the block above with the first key. If 3DES is selected, we perform 3DES with the 3 keys

des:D5D16164F4B82E0F

Next block of 8 bytes:

block:0123456789012345

XOR with the previous block (CBC mode)

xor:D4F224037DB90D4A

And then again 3DES or DES. Given that this is the last block, the algorithm of the finishing selection will be applied.

des:04D62E1385AAF220

We are out of data to encrypt, so this is the resulting MAC

MAC:04D62E1385AAF220

Iso8583 - articles


Are you ready to start or need help?


Ready to start your next project with us? Give us a call or send us an email and we will get back to you as soon as possible!

Download and Use the software yourself


Download software

Read Documentation and Start guides


Get started