PIN Change/Unblock verb

The PIN Block calculation PIN Change/Unblock.

  1. Form three 8-byte, 16-digit blocks, -1, -2, and -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 blocks -1, -2, and -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'
    • append X'80'
    • append an additional six bytes of X'00'.

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