z/OS Cryptographic Services ICSF Application Programmer's Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF


Constructing the PIN-block for transporting an EMV smart-card PIN

z/OS Cryptographic Services ICSF Application Programmer's Guide
SA22-7522-16

The PIN block is used to transport a new PIN value. The PIN block also contains an authentication code, and optionally the "current" PIN value, enabling the smart card to further ensure receipt of a valid PIN value. To enable incorporation of the PIN block into the a message for an EMV smart-card, the PIN block is padded to 16 bytes prior to encryption.

PINs of length 4 - 12 digits are supported.

PIN-block construction:

  1. Form three 8-byte, 16-digit blocks, block-1, block-2, and block-3, and set all digits to X'0'.
  2. Replace the rightmost four bytes of block-1 with the authentication code described in the previous section.
  3. Set the second digit of block-2 to the length of the new PIN (4 to 12), followed by the new PIN, and padded to the right with X'F'.
  4. Include any current PIN by placing it into the leftmost digits of block-3.
  5. Exclusive-OR block-1, block-2, and block-3 to form the 8-byte PIN block.
  6. Pad the PIN block with other portions of the message for the smart card:
    • Prepend X'08' (the length of the PIN block)
    • Append X'80', followed by 6 bytes of X'00'

The resulting message is ECB-mode triple-encrypted with an appropriate session key.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014