beautypg.com

Encrypted session id, Dukpt key serial number, Encryption counter – MagTek iDynamo MagneSafe V5 User Manual

Page 15: Clear text crc, Encrypted crc, Format code

background image

Section 2. Communications

9

null terminator, is 15 bytes. This device serial number can also be retrieved and set with the
device serial number property explained in the property section of this document. This field is
stored in non-volatile memory, so it will persist when the unit is power cycled.

Encrypted Session ID

This eight byte Binary field contains the encrypted version of the current Session ID. Its primary
purpose is to prevent replays. After a card is read, this value will be encrypted, along with the
card data, and supplied as part of the transaction message. The clear text version of this will
never be transmitted. To avoid replay, the application sets the Session ID property before a
transaction and verifies that the Encrypted Session ID returned with card data decrypts to the
value set.

DUKPT Key Serial Number

This 10 byte Binary field contains the DUKPT Key Serial Number used to encrypt the encrypted
fields in this message. This 80-bit field includes the Initial Key Serial Number in the leftmost 59
bits and a value for the Encryption Counter in the rightmost 21 bits. If no keys are loaded, all
bytes will have the value 0xFF.

Encryption Counter

This three byte field contains the value of the Encryption Counter at the end of this transaction.
See the Get Encryption Counter command for more information.

Clear Text CRC

This 2-byte Binary field contains a clear text version of a Cyclical Redundancy Check (CRC-16
CCITT, polynomial 0x1021) (least significant byte sent first). It provides a CRC of all
characters sent prior to this CRC. The CRC is converted to four characters of ASCII before
being sent. The application may calculate a CRC from the data received prior to this CRC and
compare it to the CRC received. If they are the same, the application can have high confidence
that all the data was received correctly. The CRC Flag property controls whether this field is
sent. If the property is True, the CRC is sent, if it is False, the CRC is not sent. The default state
for this property is True.

Encrypted CRC

This 8-byte Binary field contains an encrypted version of a Cyclical Redundancy Check (CRC).
It provides a CRC of all characters sent prior to this CRC. The CRC is converted to 16
characters of ASCII before being sent. After the receiver decrypts the message, the CRC is
contained in the first 2 bytes of the message, all other bytes are meaningless. The application
may calculate a CRC from the data received prior to this CRC and compare it to the CRC
received. If they are the same, the application can have high confidence that all the data was
received correctly. The CRC FLAG property controls whether this field is sent.

Format Code

This 4-character ASCII field contains the Format Code. The purpose of the Format Code is to
allow the receiver of this message to know how to find the different fields in the message. The
default Format Code for this reader is “0001”. If any of the properties that affect the format of
the message are changed, the first character of the Format Code will automatically change to a