P1 PIN blocks

Needs: Supporter

ISO 9564 formats 0 to 4: building, encrypting, decoding and translating PIN blocks.

This is a supporter feature. Create a free account, then try every supporter feature free for 7 days.

Sign in Create a free account See plans

What this module covers

Track P · PIN and card security

You will be able to

  • Build and decode ISO formats 0, 1, 2, 3 and 4
  • Take the right 12 PAN digits
  • Encrypt and decrypt a PIN block
  • Explain translation between formats and keys, and why some translations are forbidden

The lesson

  1. Why it matters
  2. The concept
  3. Step by step: ISO 0
  4. Translation
  5. In the real world
  6. Common mistakes
  7. What to test

In the module

  • The lesson, with diagrams, common mistakes and what to test
  • A worked example you can change: Building and encrypting a PIN block
  • Practice: 5 kinds of generated exercise, each with a step-by-step solution
  • A quiz of 9 questions

Key terms

ISO format 0
The common PIN block: a PIN field (0, length, PIN, F fill) XORed with a PAN field (0000 and the 12 rightmost PAN digits without the check digit).
ISO format 1
A PIN block without the PAN: 1, length, PIN, random fill. Used where the PAN is not available.
ISO format 2
A PIN block for offline PIN sent to a chip card: 2, length, PIN, F fill. Not for online use.
ISO format 3
Like format 0 but with random fill digits from A to F, so equal PINs on the same card give different blocks.
ISO format 4
The 16-byte AES PIN block: a PIN field and a PAN field of 16 bytes each, combined with two AES encryptions.
PIN block
The 8- or 16-byte block that carries an encrypted PIN, combining the PIN with fill digits and often the PAN, in one of the ISO 9564 formats.
PIN translation
Decrypting a PIN block under one key and re-encrypting it under another, possibly in another format, inside an HSM. The PIN is never in the clear outside it.

Tools for this module: PIN Block

Read the opening of the lesson →

The lesson, worked example, practice and quiz open with a supporter pass, which you can try free for 7 days.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.