Encrypt bulk data command – MagTek Bluetooth MagneSafe V5 Swipe Reader User Manual
Page 58

Bluetooth MagneSafe V5 Swipe Reader
50
ENCRYPT BULK DATA COMMAND
Command number:
0x30
Description:
This command will encrypt up to a maximum of 120 bytes. The Data-
Response variant of the DUKPT key will be used to encrypt data. It will
also compute a MAC for the S/N, Num Bytes Encrypted, KSN and
Cryptogram. Data to be encrypted that are not a multiple of 8 bytes will
be padded with NULLs to be a multiple of 8.
The DUKPT key counter/pointer will be incremented before processing
this command.
Result codes:
0x00 – success
0x02 – Bad Parameters, the Data Len is not supported
0x07 – Security Level < 2, MSCI CMUT was incorrect.
Example Encrypt Bulk Data Request (Hex):
Cmd Num
Data Len
Data
30
05
01 02 03 04 05
Example Encrypt Bulk Data Response (Hex):
Result
Code
Data
Len
DSN (16 bytes)
Num
Bytes
Encrypted
(1 byte)
KSN
(10 bytes)
Cryptogram
(8 bytes)
MAC
(4 bytes)
00
0x27
32 31 30 34 32 38 31 32
44 30 31 31 31 31 31 00
05
31 32 33 34
35 31 32 33
34 35
01 02 03 04
05 06 07 08
01 02 03 04
DSN
Device Serial Number, this data field will always be fixed at 16 bytes. If the
serial number is less than 15 bytes, it will be left-justified. The 16
th
byte will
always be set to NULL.
Cryptogram Encrypted data, the length of which is always a multiple of 8, this field can be
maximum of 120 characters.