payShield host commands

Data & MAC

payShield M0 — Encrypt Data Block

answers with M1

Encrypt a data block using ECB, CBC, CFB, OFB or CTR. CTR requires an AES key with usage 25.

Fields

FieldWhat it holds
Mode Flag1 or 2 chars00 ECB · 01 CBC · 02 CFB8 · 03 CFB64 · 05 OFB · 06 CTR (IV required except ECB)
Input Format1 chars0 binary · 1 hex-encoded · 2 text (M0 only for data encryption/decryption)
Output Format1 chars0 binary · 1 hex-encoded · 2 text (M2)
Key Type3 chars000 (ZMK), 001 (ZPK), 002 (TMK/TPK), 003 (PVK), 009 (MAC key)
Key under LMKKey Block LMK: enter the complete S key block. Variant LMK: 16 hex digits, U followed by 32, or T followed by 48.
KSN Descriptor3 chars3 hex: BDK-id len / reserved / device-id len (e.g. A05) — BDK destination only
Key Serial Number20 chars20 hex digits — BDK/DUKPT path only
IV16 or 32 charsCBC only: 16 hex (3DES) / 32 hex (AES)
Counter Offset3 chars3 decimal digits · bits from the least significant bit
Counter Length3 chars3 decimal digits · at least 8 bits within the IV
OFB Mode Flag1 chars1 OFB8 · 8 OFB64
Data Block (HEX)Hex data (multiple of 16 chars for ECB)
Message trailerOptional · up to 32 printable ASCII characters.

On the wire

The four zeros are the message header. The device echoes them in its response.

Encrypt Data Block

0000M00011FFFS10096D0TB00S00004EA7F62C3D05B27FCD6ED9E4590D7BDEAD1F9777861CF80279772FB09EDC999B90F78F4C3E672F8C002000112233445566778899AABBCCDDEEFF

4-char headercommand140 bytes of fields
Send M0 to the simulator

Opens the simulator with this command already filled in.

Data & MAC