2

I'm trying to correctly parse an ISO8583(1987) message in Python 3 using the py8583 package. After running into some issues with the parser I've realized that the bitmap in the ISO8583 message seems to not be formatted correctly.

This is the ISO8583 bitmap in question: P8P1211661684989

This is the entire ISO8583 message. It's using trash test data so don't need to worry about sensitive info. NP0100P8P1211661684989300000000000002004914104019041104009904SHDPf406c431Cashier_01 01301001000200491665D9832B92FD380C

From what I understand the bitmap should only contain 1-9/A-F hex characters, yet as you can see it begins with "P8P12...".

Is there something I'm missing here? These ISO8583 messages are currently being used within an enterprise-level company. Additionally, while some online parsers throw the bitmap error, I've found one that seems to be parsing it just fine (link below). I can't figure out how it's doing the parsing.

http://www.fintrnmsgtool.com/decode-iso87-bitmap.html (Edit: It was correctly pointed out by glhr that this site doesn't allow you to type non-hex characters, only copy/paste them, so it's probably no longer relevant to the question.)

Hex dump below:

0010   08 00 45 00 00 ab 03 b1 00 00 3c 06 fa 89 c0 a8
0020   15 02 40 87 69 e1 81 1c 0b bb b7 b9 78 55 c7 86
0030   4a 2c 50 18 12 24 2f d3 00 00 4e 50 00 00 00 7d
0040   30 31 30 30 50 38 00 01 80 c0 00 50 31 32 31 31
0050   36 36 31 36 38 34 39 38 39 33 30 30 30 30 30 30
0060   30 30 30 30 30 30 30 32 30 30 34 38 31 34 30 39
0070   35 39 31 39 30 34 31 31 30 34 30 30 39 39 30 34
0080   53 48 44 50 66 34 30 36 63 34 33 31 43 61 73 68
0090   69 65 72 5f 30 31 20 20 20 20 20 30 31 33 30 31
00a0   30 30 31 30 30 30 32 30 30 34 38 31 36 36 35 44
00b0   39 38 33 32 42 39 32 46 44 33 38 30 43

Any help from ISO8583 experts would be greatly appreciated!

Kody458
  • 91
  • 4
  • Are you sure `P8P1211661684989` is a bitmap, not a data field? You'll see that the website doesn't allow typing non-hex characters (even though you can copy and paste them). – glhr Apr 17 '19 at 18:01
  • Hmm, I would assume so. I'll add the entire ISO8583 message to the post (it's all test data so nothing sensitive is being revealed.) From what I can gather the "NP" is the header, the 4 digits after is the MTI, then after should be the bitmap. – Kody458 Apr 17 '19 at 19:25
  • It does not look as valid ISO8583 message. You probably lost some non-printable bytes when posted message as ASCII string. Please provide Hexadecimal dump for this example message. – iso8583.info support Apr 18 '19 at 09:27
  • Hex dump added, I initially used Wireshark to try and read it. – Kody458 Apr 18 '19 at 11:29
  • Wikipedia gives the following mysterious comment: "The bitmap may be represented as 8 bytes of binary data or as 16 hexadecimal characters (0-9, A-F) in the ASCII or EBCDIC character sets." –  Apr 18 '19 at 11:51

1 Answers1

0

Something seems amiss.

From the hex dump it looks like some kind of 0800 network message. That would make the bitmap starting with 0x45. This would be a binary bitmap of 0100 0101, indicating bits 2, 6, and 8 are present. ISO 8583 bit 2 is always a PAN (card number), so that does not make much sense. Bit's 6 and 8 don't seem to make sense in the context of a network message either as the former is cardholder billing amount, and the latter is cardholder amount fee.