PIN blocks · DUKPT · MACs · CVC3 · bitmaps

Payment Utilities

PIN block encoding across the ISO 9564 formats and OEM variants, AES-encrypted PIN blocks, TPK-to-ZPK translation and DUKPT PIN encryption — alongside the AS2805, DUKPT, card-verification, MAC and bitmap utilities in the same group. Each tool validates inputs in real time and logs every operation for audit.

ISO8583StudioProfessional Payment Testing
Tool Categories
Payment Simulators9 tools
EMV & Card Tools12 tools
Cryptographic Tools7 tools
Key Management10 tools
Payment Utilities21 tools
Data Converters6 tools
Card Validation4 tools
DUKPT Tools6 tools
MAC Tools5 tools
Payment Utilities
Payment processing and validation utilities
21 tools
015 tools
PIN blocks
ISO 9564 · AES · offset · PVV · ZKA
023 tools
Card verification
CVV · CSC · CVC3
038 tools
MAC & hash
9797-1 · X9.9 · HMAC · CMAC · MDC
042 tools
DUKPT
ISO 9797 · AES
053 tools
ISO 8583
AS2805 · bitmap · parser
All tools
PIN blocks, card verification, MACs, DUKPT and ISO 8583 helpers
hex-driven · audit log
PIN Block Calculator01
PIN Block(AES) Calculator01
PIN Offset (IBM 3624)01
PIN PVV Calculator01
ZKA01
CVV Calculator02
AMEX CSC02
MasterCard CVC02
ISO/IEC 9797-103
ANSI X9.9 & X9.1903
AS2805.4.1 MAC Calculator03
TDES-CBC MAC Calculator03
HMAC MAC Calculator03
CMAC MAC Calculator03
Retail MAC Calculator03
MDC Hash Calculator03
DUKPT ISO 979704
DUKPT ISO AES04
AS2805 Calculator05
Bitmap Calculator05
Message Parser05
›Opening PIN Offset (IBM 3624) · Generating and recovering PINs using the IBM 3624 PIN Offset method
Activity log
Every operation logged with its inputs.
On this page
pin-tools · Payment Utilities hub — above

Introduction

A PIN block is a fixed-format encoding of a cardholder PIN designed to be encrypted under a key (TPK, ZPK, or DUKPT-derived) and transmitted across a payment network. ISO 9564 defines the canonical formats; vendors and legacy networks add a few non-standard variants you may still encounter.

The PIN calculators live in Tools → Payment Utilities, alongside the card-verification, DUKPT and MAC tools. Two of them are dedicated PIN tools — PIN Block Calculator and PIN Block (AES) — and two more tools in the group carry PIN block operations of their own, covered in PIN Block Translation and DUKPT PIN below.

The rest of the group follows, one screen at a time: the other three AS2805 Calculator tabs, the DUKPT Utilities derivation and operation tabs and their AES counterpart, the AMEX CSC and MasterCard CVC3 calculators, the four MAC calculators and the Bitmap Calculator.

PIN Block CalculatorEncode or decode a PIN block in any ISO 9564 or OEM format — the format picked once, Encode and Decode as a tab pair.
PIN Block (AES)ISO Format 4 encode and decode under an AES-128 key, with every intermediate value logged.
AS2805 Calculator · Translate PIN BlockRe-encrypt a block from the terminal key to the zone key, changing its format on the way.
DUKPT Utilities · DUKPT PINEncrypt or decrypt a PIN block under a PIN Entry Key derived per transaction.

All tools

Every tool in this category — each card links to the detailed reference below.

Reference · ISO 9564-1

PIN Block Formats

FormatSourcePAN-bound?Notes
ISO-0ISO 9564-1YesPIN XOR PAN. Most common in legacy systems. Equivalent to ANSI X9.8.
ISO-1ISO 9564-1NoPIN + random padding. Used when PAN is not available.
ISO-2ISO 9564-1NoPIN + F padding. EMV ICC offline PIN.
ISO-3ISO 9564-1YesLike ISO-0 but with random fill nibbles instead of zeros.
ISO-4ISO 9564-1 (2017)Yes16-byte block; AES-only. Currently mandated for new deployments.
OEM-1Diebold / Docutel / NCRVariesVendor-specific historical formats — rarely needed for new work.
ECI 1-4Eurocheque / EFTVariesEuropean legacy variants.
Use ISO-4 for new work
If you have flexibility, target ISO Format 4 with AES — it’s the only format approved for new PCI-PIN evaluations.
Tool · Encode & Decode tabs

PIN Block Calculator

The PIN Block Calculator builds a formatted PIN block, or recovers the PIN from one. The format is picked once from the PIN block format drop-down at the top of the screen; Encode and Decode sit below it as a tab pair, so the same format applies in both directions.

pin-tools · PIN Block Calculator — Format 0 (ISO-0) selected in the PIN block format drop-down, the Encode tab active, and PAN and PIN fields above the Encode button

Inputs

  • PIN block format — Drop-down covering the ISO 9564 formats and the OEM / ECI variants. Format 0 (ISO-0) is the default.
  • PAN — Only the PAN-bound formats ask for it; the field reads PAN is required for this format when the current selection needs one.
  • PIN — 4–12 numeric digits.

The rest of the form follows the format you pick, so a format that carries no PAN simply drops that field.

Walk-through (Encode, ISO-0)

  1. Open the PIN Block Calculator from Tools → Payment Utilities → PIN Block Calculator.
  2. Pick Format 0 (ISO-0) in the PIN block format drop-down.
  3. Stay on the Encode tab.
  4. Enter the PAN. ISO-0 uses the rightmost 12 digits excluding the check digit.
  5. Enter the PIN (e.g. 1234).
  6. Click Encode. The formatted PIN block is written to the activity log with its inputs.

The Decode tab reverses the same format: give it the PIN block and it recovers the PIN.

pin-tools · PIN Block Calculator — the Decode tab of the same tool — the PIN block in, the PIN out

Formatting and encryption are separate steps
This tool produces the formatted PIN block. To encrypt it under a working key, take the block into the DES / 3DES or AES calculator, or use DUKPT PIN when the key comes from a DUKPT derivation.
Reference · byte by byte

Format Walk-throughs

ISO-0 / ANSI X9.8

Step 1 (PIN block):  04 12 34 FF FF FF FF FF
   - 04 = PIN length (4 digits)
   - 1234 = PIN
   - FF padding to 8 bytes

Step 2 (PAN block):  00 00 12 34 56 78 90 12
   - leading zeros + rightmost 12 digits of PAN excluding check digit

Step 3 (XOR):        04 12 26 CB A9 87 6F ED
Step 4 (Encrypt):    encrypted under TPK / ZPK

ISO-1

No PAN; the PIN is followed by random fill bytes. Use when PAN is not transmitted (e.g. some IVR / VRU flows).

ISO-3

Like ISO-0 but the padding nibbles are random in the range 0xA–0xF. Each generated PIN block is unique even for the same PIN + PAN combination.

ISO-4 (AES)

16-byte clear PIN block: control field, PIN length, PIN digits, then a random fill. Encrypted with AES (128 / 192 / 256-bit) and XOR-combined with a derived PAN block. Use the dedicated AES PIN Block tab for ISO-4 work.

OEM-1 / ECI

Reserved for compatibility with legacy ATM and POS networks. The exact layout differs per vendor; the calculator labels each tab with the vendor name.

Tool · Encode & Decode buttons

AES PIN Block (ISO-4) Calculator

The PIN Block (AES) tool focuses on the modern ISO Format 4 design. One form covers both directions — Encode and Decode are buttons rather than tabs, and the middle field changes meaning between them.

pin-tools · PIN Block (AES) Calculator — a 32-hex Key field, the combined PIN (Encode) / PIN Block (Decode) field, a PAN field, and Encode and Decode buttons

Inputs

  • Key — 32 hex chars (AES-128).
  • PIN (Encode) / PIN Block (Decode) — One field serving both directions: the PIN going in, the encrypted block coming back out.
  • PAN — Required for the PAN block XOR step.

Buttons: Encode, Decode.

Output

  • Clear PIN block (16 bytes)
  • PAN block (16 bytes)
  • Intermediate ciphertext (after AES of clear PIN block)
  • Final encrypted PIN block (after XOR with PAN block)
DUKPT-AES
For DUKPT AES PIN translation, derive the AES PIN working key in the DUKPT Tools first, then plug it in here.
Tab · AS2805 Calculator

PIN Block Translation (AS2805)

Translation re-encrypts a PIN block from one key to another without ever exposing the clear PIN — the acquiring step that moves a PIN from the terminal key (TPK) it arrived under to the zone key (ZPK) shared with the next node. The AS2805 Calculator carries it on its Translate PIN Block tab, and can change the PIN block format in the same operation.

pin-tools · AS2805 Calculator — System ZPK and Terminal TPK hex fields, STAN, Transaction Amount, incoming and outgoing PIN block format selectors, the incoming PIN block and an account number, above a Translate button

Inputs

  • System ZPK (Hex) — The zone key the block is translated to.
  • Terminal TPK (Hex) — The terminal key the block arrived under.
  • STAN — System trace audit number of the transaction.
  • Transaction Amount
  • Incoming / Outgoing PIN Block Format — Two-digit format codes, defaulting to 01. Set them differently to translate the format as well as the key.
  • Incoming PIN Block (Hex)
  • Account Number — Binds the block for the PAN-bound formats.

Button: Translate.

Where it lives
Open Tools → Payment Utilities → AS2805 Calculator and pick the Translate PIN Block tab. The same tool also generates terminal key sets and computes AS2805 MACs and one-way functions.
Tool · four tabs

AS2805 Calculator

The AS2805 Calculator is one tool with four tabs — Generate Terminal Key Set, Translate PIN Block, MAC and OWF. Translation is covered above; the other three tabs share the same form-and-log layout.

Generate Terminal Key Set

Creates the terminal keys — TPK and TAK — an AS2805 terminal receives at logon, wrapped under the receiving key-encrypting key.

pin-tools · AS2805 Calculator — Key Flag, KEKr Key, the KEKE and LMK key schemes and the key check value type above Generate Keys

  • Key Flag — Drop-down; 1 by default.
  • KEKr Key (Hex) — The receiving KEK the new set is wrapped under.
  • Key Scheme KEKE / Key Scheme LMK — Drop-downs, B and Z by default — the scheme tags for the KEK-wrapped and LMK-wrapped copies.
  • Key Check Value Type — Drop-down; 1 by default.
  1. Open Tools → Payment Utilities → AS2805 Calculator; the tool opens on Generate Terminal Key Set.
  2. Enter the KEKr key. Leave the key flag, schemes and KCV type at their defaults unless your host specifies otherwise.
  3. Click Generate Keys. The TPK and TAK land in the activity log with their key check values.

MAC

pin-tools · AS2805 Calculator — Key (Hex) and Data (Hex) above Calculate MAC

Two hex fields — Key (Hex) and Data (Hex) — and a Calculate MAC button. The MAC is computed to AS 2805.4 over the data under the key you give it.

OWF

pin-tools · AS2805 Calculator — Key (Hex) and Data (Hex) above Calculate OWF

The one-way function used in AS2805 key management. Same two fields; Calculate OWF writes the result to the log.

Both fields are required
Every field on these tabs validates as you type — an empty key or data field reads cannot be empty and the button stays disabled until both are filled.
Tab · DUKPT Utilities

DUKPT PIN

Under DUKPT, the PIN is encrypted with a PIN Entry Key (PEK) derived per transaction rather than a static TPK. The DUKPT PIN tab takes a PEK you have already derived and encrypts or decrypts a PIN block with it.

pin-tools · DUKPT Utilities — a 32-hex PEK field and a 16-hex PIN Block field above Encrypt and Decrypt buttons

Inputs

  • PEK — 32 hex chars. Derive it first on the PEK Derivation tab from a BDK or IPEK plus the KSN.
  • PIN Block — 16 hex chars: the clear block to encrypt, or the encrypted block to recover.

Buttons: Encrypt, Decrypt.

Two-step flow
Build the block in the PIN Block Calculator, then encrypt it here under the derived PEK. Key derivation itself — PEK, DEK, and the AES variants — is covered in DUKPT Utilities below.
Tools · DUKPT Utilities & DUKPT AES Utilities

DUKPT Utilities

Derived Unique Key Per Transaction generates a fresh key for every transaction without ever transmitting it: the terminal holds an IPEK derived from a BDK and a KSN, advances the KSN counter each time, and the host — knowing only the BDK and the KSN it received — derives the same key independently. The DUKPT Utilities tool implements ANSI X9.24-1 with 3DES across five tabs: two derivation tabs that produce working keys and three operation tabs that consume them. DUKPT AES Utilities does the same for ANSI X9.24-3. For the derivation walk-through, KSN layout and the X9.24 test vectors, the reference page is DUKPT Tools; the MAC calculators have their own page at MAC Tools.

VariantStandardCipherBDKKSN
DUKPT ISO 9797ANSI X9.24-13DES16 bytes (32 hex)10 bytes (20 hex)
DUKPT AESANSI X9.24-3AES-128 / 192 / 25616 / 24 / 32 bytes12 bytes (24 hex)

PEK Derivation

pin-tools · DUKPT Utilities — BDK selected as the input key designation, the BDK and KSN fields and Derive PEK — run on the X9.24 sample BDK and KSN

  • Input Key Designation — Drop-down: BDK or IPEK. Determines which key field is shown.
  • BDK (32 Hex Chars) / IPEK (32 Hex Chars) — Whichever the designation asks for.
  • KSN (20 Hex Chars) — Always visible; the rightmost 21 bits are the transaction counter.
  1. Pick Input Key Designation — BDK if you have the base key, IPEK if a previous step already produced the initial key.
  2. Enter the key in the resulting BDK or IPEK field (32 hex chars).
  3. Enter the KSN (20 hex chars).
  4. Click Derive PEK. The activity log shows the resulting PIN Encryption Key — copy it for the operation tabs.

DEK Derivation

pin-tools · DUKPT Utilities — the same designation, BDK and KSN fields above Derive DEK

Identical fields and flow to PEK Derivation — the only difference is the variant applied, which produces a Data Encryption Key instead.

DUKPT MAC

pin-tools · DUKPT Utilities — a PEK field, the DES / 3DES algorithm radio pair and a hex Data field above Generate MAC

  • PEK (32 Hex Chars) — The MAC key, typically derived on the PEK Derivation tab.
  • Algorithm — Radio: DES or 3DES.
  • Data (Hex) — Multi-line hex input.

Button: Generate MAC.

DUKPT Data

pin-tools · DUKPT Utilities — a PEK field, the Use Data Variant Key switch, the ASCII data input type, the CBC / ECB cipher-mode radio pair and a Data field above Encrypt and Decrypt

  • PEK (32 Hex Chars) — Working key from PEK Derivation, or from DEK Derivation when the data variant is required.
  • Use Data Variant Key — Switch. When on, the tool applies the data-encryption variant XOR before encrypting.
  • Data Input Type — ASCII or Hex.
  • Cipher Mode (zero IV) — Radio: CBC or ECB.
  • Data — Multi-line input in the chosen format.

Buttons: Encrypt, Decrypt.

Two-step workflow
The tool deliberately separates derivation from use: derive the working key on PEK Derivation or DEK Derivation first, then paste the result into the DUKPT PIN, MAC or Data tab. This mirrors how a host-side stack stages keys.

DUKPT AES Utilities · Key Derivation

The AES tool implements ANSI X9.24-3. Four tabs — Key Derivation, DUKPT PIN, DUKPT MAC, DUKPT Data — split derivation from operations the same way.

pin-tools · DUKPT AES Utilities — the Key Derivation tab — BDK as the input key designation, AES-128 initial and working key types, BDK / IK and KSN fields above Derive Keys

  • Input Key Designation — BDK or IK.
  • Initial Key Type — Drop-down: AES-128, AES-192, AES-256.
  • BDK / IK — Hex; length matches the initial key type.
  • Working Key Type — Drop-down: 2TDEA, 3TDEA, AES-128, AES-192, AES-256 — TDES working keys too, for backwards compatibility.
  • KSN — 24 hex chars: 4-byte BDK ID, 4-byte derivation ID, 4-byte counter.
  1. Pick Input Key Designation and Initial Key Type.
  2. Enter the BDK / IK.
  3. Pick Working Key Type and enter the KSN.
  4. Click Derive Keys. The activity log lists the IK (when starting from a BDK) and the working key.
3DES KSN (10 bytes)
| 5-byte BDK ID + Device ID | 2-byte counter (high) | 21-bit Tx Counter |

AES KSN (12 bytes)
| 4-byte BDK ID | 4-byte Derivation ID | 4-byte Transaction Counter |
Keep the counters in sync
The KSN you receive in field 53 / 60 of an ISO 8583 message is what the host uses to derive the same key. Off-by-one is the most common bug — if MACs suddenly go wrong, check whether the terminal advanced its counter without you advancing yours.
Tools · Generate & Validate tabs

AMEX CSC & MasterCard CVC3

Two issuer-side calculators for card security values. Each has a Generate tab and a Validate tab: Validate takes the same inputs plus the value under test and reports whether it matches. The card-verification reference page is Card Validation.

AMEX CSC Calculator

pin-tools · Amex CSC Calculator — the Generate tab — CSC Version, CSC Key, PAN, Expiration Date, Service Code and Verification Value Type above Generate

  • CSC Version — Drop-down; Version 1 by default.
  • CSC Key (Hex) — The Amex CSC key.
  • PAN — 15-digit Amex account number.
  • Expiration Date (YYMM) — Four digits.
  • Service Code — Three digits.
  • Verification Value Type — Drop-down; CSC by default.
  1. Open Tools → Payment Utilities → AMEX CSC; the tool opens on Generate.
  2. Pick the CSC Version, then enter the CSC Key, PAN, expiry and service code.
  3. Click Generate. The activity log lists the CSC-5, CSC-4 and CSC-3 values.
  4. To check values from a card, switch to Validate: enter the same PAN, expiry and service code, then the CSC-5, CSC-4 and CSC-3 you were given, and click Validate.

pin-tools · Amex CSC Calculator — the Validate tab — PAN, Expiration Date, Service Code and Verification Value Type, then the three values to validate

MasterCard CVC3

pin-tools · MasterCard CVC3 — the Generate tab — IMK, PAN, PAN Seq No, Track 1/2 Data, Unpredictable Num, ATC and CVC3 Type above Generate

  • IMK — The issuer master key for CVC3.
  • PAN / PAN Seq No — Derive the card key from the IMK.
  • Track 1/2 Data — The track data the CVC3 is computed over.
  • Unpredictable Num — The terminal’s unpredictable number, hex.
  • ATC — Application transaction counter, hex.
  • CVC3 Type — Drop-down; Dynamic CVC3 by default.
  1. Open Tools → Payment Utilities → MasterCard CVC on the Generate tab.
  2. Enter the IMK, PAN and PAN sequence number, then the track data, unpredictable number and ATC from the transaction.
  3. Click Generate. The log shows the derived key, the IVCVC3 and the CVC3.
  4. On Validate, add the Dynamic CVC3 received from the card and click Validate to compare.

pin-tools · MasterCard CVC3 — the Validate tab — the same inputs plus a Dynamic CVC3 field to check

Static CVV / CVC / iCVV
The static three-digit values are the CVV Calculator’s job — first tile in the hub, and covered in EMV & Card Tools. The two tools here handle the Amex CSC family and MasterCard’s dynamic CVC3.
Tools · four calculators

MAC Calculators

A Message Authentication Code is a short tag computed from a message and a secret key; the receiver recomputes it to confirm the message was not altered and came from someone holding the same key. Payment networks rely on MACs on ISO 8583 messages, terminal-host links and PIN-translation pipelines. The group carries a calculator for every MAC algorithm commonly seen in payment specifications — the block-cipher family, and HMAC for hash-based tags. The dedicated reference for ISO 9797-1, X9.9/X9.19 and HMAC — with the worked vectors — is MAC Tools.

AlgorithmStandardBlock / CipherCommon use
HMACRFC 2104, FIPS 198-1Hash (SHA-256, etc.)API authentication, JWS, payment APIs.
CMACNIST SP 800-38BAES / TDESEMV-like cryptograms, modern PIN translation.
TDES CBC-MACANSI X9.9 (legacy)3DESOlder banking integrations.
ANSI X9.19 MACANSI X9.19Single DES + 3DES finalizeU.S. retail / banking ISO 8583.
ISO 9797 MACISO/IEC 9797-1DES / 3DES / AESCross-network ISO 8583 MACs.
Retail MACISO 9797-1 Algorithm 33DESEuropean retail payments.
AS2805 MACAS 2805.43DESAustralian payment systems.

ISO/IEC 9797-1

ISO/IEC 9797-1 standardises six MAC algorithms over block ciphers; the calculator exposes each from the MAC Algorithm drop-down.

pin-tools · ISO/IEC 9797-1 MAC — Algorithm 1 selected, the Key (K′) field, Padding, Data and Truncation Length above Generate MAC — the worked example below, "Hello" under Method 2 padding

VariantDescriptionTypical cipher
Algorithm 1Plain CBC-MAC. Single key. Last block is the MAC.DES / 3DES / AES
Algorithm 2Last block encrypted with a derived key (K′).DES
Algorithm 3Retail MAC: single DES CBC-MAC, then 3DES finalize. Equivalent to ANSI X9.19.DES + 3DES
Algorithm 4CBC-MAC with two parallel CBC-MAC chains XOR-combined.DES / 3DES
Algorithm 5EMAC: CBC-MAC re-encrypted with a second key.AES
Algorithm 6MAC double-CBC encryption with separate keys.AES
  • MAC Algorithm — Drop-down, Algorithm 1 through Algorithm 6.
  • Key (K′) — Hex; the algorithms that need a second key derive it from this one.
  • Padding — Drop-down: Method 1, Method 2, Method 3.
  • Data (Hex) — The message to authenticate.
  • Truncation Length (Chars) — Defaults to 8.
  1. Open Tools → Payment Utilities → ISO/IEC 9797-1.
  2. Pick the MAC Algorithm and Padding your host specifies — Algorithm 1 with TDES is widespread for ISO 8583 MAC fields (bit 64 / 128); Algorithm 3 is the European retail standard.
  3. Enter the key and the hex data, and set the truncation length.
  4. Click Generate MAC. The padded data, the full MAC and the truncated MAC are written to the log.
Key:    0123456789ABCDEFFEDCBA9876543210
IV:     0000000000000000
Method: 2 (0x80 followed by zero bytes)
Data:   48656C6C6F     (ASCII "Hello")

Padded: 48656C6C6F800000

Output: 8F9E4CCDD623E590

ANSI X9.9 & X9.19

One tool covers both ANSI schemes — X9.9 (wholesale) and X9.19 (retail) — selected from the MAC Algorithm drop-down. X9.19 runs single-DES CBC-MAC across the message with a final 3DES step over the last block, which makes it equivalent to ISO 9797-1 Algorithm 3.

pin-tools · ANSI X9.9 & X9.19 — ANSI MAC X9.9 (Wholesale MAC) selected, Key (K), Data and Truncation Length above Generate MAC

  • MAC Algorithm — ANSI MAC X9.9 (Wholesale MAC) or the X9.19 retail variant.
  • Key (K) — Hex key; the 3DES halves are taken from it in order.
  • Data (Hex) — The message to authenticate.
  • Truncation Length (Chars) — Defaults to 8.

TDES-CBC MAC

Triple-DES CBC-MAC: encrypt the message under TDES in CBC mode and take the last block as the MAC. Common in legacy ISO 8583 implementations.

pin-tools · TDES-CBC MAC Calculator — the fixed TDES CBC-MAC algorithm, a 32-hex Key (K), ISO9797-1 Padding Method 1, Data and Truncation Length above Generate MAC

  • MAC Algorithm — Fixed to TDES CBC-MAC on this tool.
  • Key (K) — 32 hex chars (2-key 3DES).
  • Padding — Drop-down; defaults to ISO9797-1 (Padding Method 1).
  • Data (Hex) — The message to authenticate.
  • Truncation Length (Chars) — Hex characters of MAC to keep; defaults to 8.
Security note
Pure CBC-MAC is vulnerable to length extension when the message length is variable. For variable-length messages, use ISO 9797-1 Algorithm 3 (Retail MAC) instead.

HMAC

Hash-based MAC defined by RFC 2104. Key and data are each entered as ASCII or hexadecimal; the output is hex of the digest length — 32 bytes for SHA-256, 64 for SHA-512.

pin-tools · HMAC MAC Calculator — SHA-256 as the hash type, a hex key and ASCII data, the HMAC Key and Data fields above Generate HMAC — RFC 4231 test case 2

  • Hash Type — Drop-down: MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, RIPEMD-160.
  • Key Input / Data Input — Drop-downs: ASCII or Hexadecimal.
  • HMAC Key — Single-line text in the chosen format.
  • Data — Multi-line text in the chosen format.
  1. Pick Hash Type — SHA-256 is a safe default for new work.
  2. Pick Key Input and enter the HMAC Key in that format.
  3. Pick Data Input and enter the Data.
  4. Click Generate HMAC. The digest is appended to the activity log.

Padding methods (ISO 9797-1)

MethodRuleNotes
Method 1Append 00 bytes to the next block boundary.Simple but ambiguous — cannot distinguish trailing zeros in plaintext.
Method 2Append a single 80 byte, then 00 bytes.Self-describing and unambiguous. Recommended.
Method 3Prefix the message with its length, then pad with 00.Used in some legacy systems; rare in payments.
Match the padding to the host spec
A wrong padding method produces a deterministic but wrong MAC — one of the most common debugging traps. Confirm the IV too: many hosts default to all zeros, but some chain the previous transaction’s MAC.
Tool · ISO 8583

Bitmap Calculator

An ISO 8583 bitmap declares which data elements follow the message type: 64 bits, one per field, with bit 1 announcing that a secondary bitmap for fields 65–128 is present. The Bitmap Calculator works in both directions — toggle the fields present and read the hex, or paste a bitmap and see the fields it declares.

pin-tools · Bitmap Calculator — the calculated bitmap with its copy button, and the primary (1–64) and secondary (65–128) grids with the present fields lit

  1. Open Tools → Payment Utilities → Bitmap Calculator.
  2. Click the fields present in your message in the Primary Bitmap (1-64) grid. Click any field above 64 in the Secondary Bitmap (65-128) grid and field 1 switches on by itself.
  3. Read the Calculated Bitmap at the top and copy it with the button at its right.
  4. Going the other way, paste a 16- or 32-hex bitmap into the field and the grids light up the fields it declares. The refresh button in the title bar clears the grid.

Byte walk-through

E0701800 28000A00 60000000 00000001

E0 = 1110 0000  →  1  2  3     secondary bitmap present · PAN · processing code
70 = 0111 0000  →  10 11 12    billing conversion rate · STAN · local time
18 = 0001 1000  →  20 21       PAN country code · forwarding institution country
28 = 0010 1000  →  35 37       Track 2 · RRN
0A = 0000 1010  →  53 55       security control info · ICC data
00 bytes        →  no fields in that run of eight

60 = 0110 0000  →  66 67       settlement code · extended payment code
01 = 0000 0001  →  128         MAC
Reading a captured message
Paste the bitmap from a captured 0200 into the calculator to see which fields to expect before running the message through the Message Parser in the same group.

Tips

  1. If the host rejects your PIN block, verify the format on both sides — ISO-0 and ISO-3 look identical at a glance but produce different blocks.
  2. When testing DUKPT-protected PIN flows, derive the working key first (PEK Derivation), then encrypt or decrypt with it under DUKPT PIN. The activity log shows both the input PIN block and the decrypted clear PIN for cross-checking.
  3. For DUKPT-derived MAC keys, derive the session key in DUKPT Utilities first, then plug the result into the corresponding MAC calculator.
  4. Keep BDKs out of source control. The activity log holds keys in memory for the session but never writes them to disk.

Try it on your own transactions

Free and open source. Download the studio and run these calculators on your desk in minutes.

✦ Pro

Testing with a team, or certifying with a scheme? Pro raises the CPS ceiling, unlocks the full algorithm set and deep simulator tweaks, plus hosted endpoints and priority support.

Register for Pro