Work / LumiWire

LumiWire

Decodes, encodes and validates ISO 8583 from the command line.

Shipped · v2.0.0View the repository

Artifact

ISO 8583 primary bitmap 7020000020800000: fields 2, 3, 4, 11, 35 and 41 are present
002 Primary account number
411111******1111
003 Processing code
000000
004 Amount, transaction
000000001000
011 STAN
000123
035 Track 2 data
411111******1111************
041 Terminal ID
TERM0001
MTI 0200
002 Primary account number: 411111******1111
003 Processing code: 000000
004 Amount, transaction: 000000001000
011 STAN: 000123
035 Track 2 data: 411111******1111************
041 Terminal ID: TERM0001
Output of lumiwire decode on an example message, PAN and track masked. From the README. lumiwire/README.md

All data is synthetic.

Problem

ISO 8583 messages are dense binary or hex. Reading one, or building a valid one, usually takes a custom script.

Approach

Field definitions live in a JSON spec, so dialects are configuration, not code. Card numbers and track data are masked in all output by default.

What's built

  • Three commands: decode, encode and validate. Validate prints one error per line and exits 1 on a bad message.
  • Primary and secondary bitmap, fields in ASCII or BCD, fixed and variable lengths, raw binary fields.
  • Two bundled editions: ISO 8583:1987 as the default, and an ISO 8583:2003 demo spec chosen with --spec.
  • Masking of PAN and track data, with --unmask to show them in full.
  • Out of scope: PIN blocks, MAC, and network simulation.

Stack

  • Python 3.10+, Typer
  • pytest
  • JSON spec files, one per dialect

Status

Shipped · v2.0.0

The 2003 spec is a demo, not normative. Its field formats are unverified, and the known gaps are listed in the repo.