Section 5. communications, Card data – MagTek Bluetooth MagneSafe V5 Swipe Reader User Manual

Page 21

Advertising
background image

13

SECTION 5. COMMUNICATIONS

CARD DATA

The details about how the card data and commands are structured follow later in this section.
Windows applications that communicate with this reader can be easily developed.

The reader will send only one swipe message per card swipe. When a card is swiped, the swipe
message will be sent even if the data is not decodable. If no data is detected on a track then
nothing will be transmitted for that track. If an error is detected on a track, the ASCII character
“E” will be sent in place of the track data to indicate an error. The LED will come on for about
two seconds and another swipe will be allowed. Data from the bad swipe is still transmitted.

A Swipe Message is composed of readable ASCII characters. It includes:

• Structural ASCII characters intended to give clues to the structure of the rest of the data.

• Simple ASCII fields that convey the ASCII representation of:

Masked Track Data
Device Serial Number
Format Code

• Binary fields that use sets of two ASCII characters representing hexadecimal digits to

convey the binary value of each byte in the field. The Binary fields are:

Reader Encryption Status
Encrypted Track Data
MagnePrint Status
Encrypted MagnePrint Data
Encrypted Session ID
DUKPT Key Serial Number
Clear Text CRC
Encrypted CRC


For the encrypted fields, the original binary bytes are encrypted using the DES CBC mode with
an Initialization Vector starting at all binary zeroes and the PIN Encryption Key associated with
the current DUKPT KSN. This is done in segments of 8 bytes. If the last segment of the original
data is less than eight bytes long (track data only), the last bytes of the block will be set to binary
zeroes before encrypting. When decrypting track data, the End Sentinel can be used to find the
actual end of the data (ignoring the final zeroes). Each byte of encrypted data is then converted
to two bytes of ASCII data representing the Hexadecimal value of the encrypted byte (many of
the encrypted bytes will not have values in the ASCII character range).

Advertising