Infinite Peripheral Prima M

The Prima M is a small, convenient and mobile smart card reader from Infinite Peripherals. It is an SRED certified magnetic stripes reader for end-to-end encryption capability. This 3-track encrypted Magnetic Stripe reader (MSR) can be attached to the audio jack of Android™ and Apple mobile devices. The vendor (Infinite Peripherals) provides iOS and Android SDKs that POS uses to communicate with the device.

Retrieving the Serial Number


To retrieve the device serial number on an iOS application, you need to include the SDK library libAudioReaderSDK.a in your xCode project. Use an instance of the AudioSmartCardReader::sharedDevice class to obtain ASCDeviceInfo* data from the terminal. The Device's serial number will be contained in the field info.SerialNumber.


To retrieve the device serial number on an Android application, you must include the com.datacs.audioreader.jar SDK library in your Android project. Use the AudioReaderManager class to obtain the reference to the AudioReader object. Use this object instance to call the getSerialNumber() method.

Retrieving Payload Data


To retrieve an encrypted payload on an iOS app, use a reference to AudioSmartCardReader::sharedDevice class to make a NSData* data.via call to msGetEncryptedCardData. Make sure to set the Encryption Mode to ASCEncryptionTypeIDTECH (int 3) via call to setMagneticCardModeEncryption. Once the magnetic card is swiped, the data is made available.


To retrieve an encrypted payload on an Android app, use the AudioReaderManager class to obtain a reference to the AudioReader class. Use this reference to call the getCardData() method. Make sure to set encryption mode to ENCRYPTION_TYPE_IDTECH (int 3) via call to setMagneticCardMode(). Once the magnetic card is swiped, the data is made available.

Sample Payload

The device outputs a hexadecimal encoded payload string:


This data is parsed as follows:

1-200Card encoding byte; can be ignored
3-41BTrack status. Binary 0001 1011 is interpreted as follow:
Bits 0,1,2 = track1 and 2 are sent, track3 is not;
Bits 3,4,5 = track1 and 2 hashes are sent, track3 is not;
Bit 6: 0 = session ID is not included
5-632Unencrypted track1 length (50 bytes)
7-824Unencrypted track2 length (36 bytes)
9-1000Unencrypted track3 length (not present)

Masked track1 data in hexadecimal. The ASCII value is:


Masked track2 data in hexadecimal. The ASCII value is:


Track1 and track2 encrypted data.

Total length of the track1 and track2 payloads rounded up to the nearest 8 byte. In this case the payload length is 50+36=86, it is then rounded to 88 bytes.

Decrypted data converted to ASCII is as follows:

359-39844320D...6D56B920 bytes of track1 hash (SHA2)
399-43827758D...0A9EA320 bytes of track2 hash (SHA2)
439-458000019...60000C10 bytes of Key Sequence Number (KSN)

Did this page help you?