The most common PIN-block formats are based on ISO 9564, but many more are in implemented worldwide. Another common problem is that same PIN-block calculation methods are being called with their aliases, making sometimes difficult to get a right one. This article brings a list of PIN-blocks applied in payments, their calculation methods and examples and bit of related background.
Well worded Wikipedia’s definition of a PIN-block format: «The PIN is used to verify the identity of a customer (the user of a bank card) within an electronic funds transfer system, and (typically) to authorize the transfer of funds, so it is important to protect it against unauthorized disclosure or misuse. Modern banking systems require interoperability between different card issuers, acquiring banks and retailers – including transmission of PINs between those entities – so a common set of rules for handling and securing PINs is required, both to ensure technical compatibility and a mutually agreed level of security.»
Note that the same encoding & decoding functionality as covered in this article is also available through our freeware BP-Tools product.
PIN Block Format | Alias | Description |
---|---|---|
ISO-0 | Format 0, ANSI X9.8, VISA-1, and ECI-0 | ISO 9564-1 Format 0. An ISO-0 PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats and is similar to a VISA-4 PIN block format. The ISO-0 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. The first nibble (which identifies the block format) has the value 0. |
ISO-1 | Format 1 and ECI-4 | ISO 9564-1:2003 Format 1. The ISO-1 PIN block format is equivalent to an ECI-4 PIN block format and is recommended for usage where no PAN data is available. The ISO-1 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. The first nibble (which identifies the block format) has the value 1. |
ISO-2 | Format 2 | ISO 9564-3: 2003 Format 2. Format 2 is for local use with off-line systems only. The first nibble (which identifies the block format) has the value 2. |
ISO-3 | Format 3 | ISO 9564-1: 2002 Format 3. Format 3 is the same as format 0, except that the “fill” digits are random values from 10 to 15, and the first nibble (which identifies the block format) has the value 3. |
ANSI X9.8 | – | Same as ISO 9564 Format 0 (ISO-0) |
OEM-1 | Diebold, Docutel, NCR | The OEM-1 PIN block format is equivalent to the PIN block formats that Diebold, Docutel, and NCR define. The OEM-1 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. Identical to existing Docutel 5100 Format 8 |
ECI-1 | – | Eurocheque International format 1. Same as ISO 9564 Format 0 (ISO-0) |
ECI-2 | – | Eurocheque International format 2. The ECI-2 PIN block format supports a 4-digit PIN. A PIN that is longer than 4 digits is truncated on the right. |
ECI-3 | – | Eurocheque International format 3. The ECI-3 PIN block format supports a PIN from 4 to 6 digits in length. A PIN that is longer than 6 digits is truncated on the right. |
ECI-4 | – | Eurocheque International format 4. Same as ISO 9564 Format 1 (ISO-1) |
IBM 3621 | The 3621 PIN block format supports a PIN from 1 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. | |
IBM 3624 | PIN-TRAN 4 | The 3624 PIN block format is equivalent to the PIN-TRAN 4 format and supports a PIN from 1 to 16 digits in length. A PIN that is longer than 16 digits is truncated on the right. |
IBM 4704-EPP (Encrypting PIN Pad) | – | The 4704 encrypting PIN Pad PIN block format supports a PIN from 1 to 13 digits in length. A PIN that is longer than 13 digits is truncated on the right. |
IBM 5906 | Same as IBM 3621. | |
VISA-1 | – | Same as ISO 9564 Format 0 (ISO-0) |
VISA-2 | Docutel 2 | The VISA-2 PIN block format supports a PIN from 4 to 6 digits in length. A PIN that is longer than 6 digits is truncated on the right. |
VISA-3 | – | The VISA-3 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. |
VISA-4 | – | The VISA-4 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right. |
Docutel 2 | VISA-2 | Same as VISA-2. Contains 1-digit PIN length, 4 to 6-digit PIN and a user-defined padding string of 9 digits. If the PIN has 4 or 5 digits, it is initially padded to the right with 2 or 1 zero digits to total 6 digits. |
AS2805 Format 1 | – | The AS2805 Format 1 PIN block is used in situations where the account number is not available. The PIN block is formed by concatenation of the PIN and other data. PIN block format supports a PIN from 4 to 12 digits in length. |
AS2805 Format 8 | Format 46 | The zero length PIN block format is identical to format 01 with the some exceptions. |
ISO-4 | Format 4 | ISO 9564-1: 2017 Format 4. Format 4 uses AES encryption. PIN Block is padded with fill digit ‘A’ and also with random random values from 0 to 15, and the first nibble (which identifies the block format) has the value 4. |
Is any PIN-block or its alias missing? Please let us know.
Is the first and most common PIN block encoding format based on ISO 9564 – an international standard for personal identification number (PIN) management and security in retail banking.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F |
XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR |
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: Format 0 (ISO-0)
—————————————-
Clear PIN block:0412AC89ABCDEF67
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 0412AC89ABCDEF67
PAN: 43219876543210987
PAD: N/A
Format: Format 0 (ISO-0)
—————————————-
Decoded PIN: 1234
The ISO-1 PIN block format is equivalent to an ECI-4 PIN block format. The ISO-1 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | L | P | P | P | P | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: Format 1 (ISO-1)
—————————————-
Clear PIN block:141234CE8C767872
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 141234CE8C767872
PAN: N/A
PAD: N/A
Format: Format 1 (ISO-1)
—————————————-
Decoded PIN: 1234
Format 2 is for local use with off-line systems only (e.g. smart cards).
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: Format 2 (ISO-2)
—————————————-
Clear PIN block:241234FFFFFFFFFF
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 241234FFFFFFFFFF
PAN: N/A
PAD: N/A
Format: Format 2 (ISO-2)
—————————————-
Decoded PIN: 1234
Format 3 is the same as format 0, except that the “fill” digits are random values from 10 to 15, and the first nibble (which identifies the block format) has the value 3.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | L | P | P | P | P | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | L | P | P | P | P | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R |
XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR |
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: Format 3 (ISO-3)
—————————————-
Clear PIN block:3412ACC9B98CDF43
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 3412ACC9B98CDF43
PAN: 43219876543210987
PAD: N/A
Format: Format 3 (ISO-3)
—————————————-
Decoded PIN: 1234
ISO 9564-1: 2017 Format 4. Format 4 uses AES-128 ECB encryption. PIN Block is padded with fill digit ‘A’ and also with random random values from 0 to 15, and the first nibble (which identifies the block format) has the value 4.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | F | F | R | R | R | R | R | R | R | R | R | R | R | R | R | R | R | R |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
M | A | A | A | A | A | A | A | A | A | A | A | A | A/0 | A/0 | A/0 | A/0 | A/0 | A/0 | A/0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 432198765432109870
PIN: 1234
PAD: N/A
Format: Format 4 (ISO-4)
—————————————-
Clear PIN block:441234AAAAAAAAAA911B9B36BC7CE94E
Clear PAN block:64321987654321098700000000000000
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 441234AAAAAAAAAA911B9B36BC7CE94E
PAN block: 64321987654321098700000000000000
PAD: N/A
Format: Format 4 (ISO-4)
—————————————-
Decoded PIN: 1234
Decoded PAN: 432198765432109870
Same as ISO-0.
The OEM-1 PIN block format is equivalent to the PIN block formats that Diebold, Docutel, and NCR define. The OEM-1 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
P | P | P | P | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | X | X | X | X |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: 5
Format: Diebold, Docutel, NCR
—————————————-
Clear PIN block:1234555555555555
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 1234555555555555
PAN: N/A
PAD: 5
Format: Diebold, Docutel, NCR
—————————————-
Decoded PIN: 1234
Same as ISO-0.
The ECI-2 PIN block format supports a 4-digit PIN. A PIN that is longer than 4 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
P | P | P | P | R | R | R | R | R | R | R | R | R | R | R | R |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: ECI-2
—————————————-
Clear PIN block:1234095621C2F02F
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 1234095621C2F02F
PAN: N/A
PAD: N/A
Format: ECI-2
—————————————-
Decoded PIN: 1234
The ECI-3 PIN block format supports a PIN from 4 to 6 digits in length. A PIN that is longer than 6 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
L | P | P | P | P | P/0 | P/0 | R | R | R | R | R | R | R | R | R |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: ECI-3
—————————————-
Clear PIN block:41234E07180DD697
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 41234E07180DD697
PAN: N/A
PAD: N/A
Format: ECI-3
—————————————-
Decoded PIN: 1234
Same as ISO-1.
The 3621 PIN block format supports a PIN from 1 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
S1 | S2 | S3 | S4 | P | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: 5
Format: IBM 3621
—————————————-
Clear PIN block:0000123455555555
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 0000123455555555
PAN: 43219876543210987
PAD: N/A
Format: IBM 3621
—————————————-
Decoded PIN: 1234
The 3624 PIN block format supports a PIN from 1 to 16 digits in length. A PIN that is longer than 16 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
P | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X | P/X |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: 5
Format: IBM 3624
—————————————-
Clear PIN block:1234555555555555
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 1234555555555555
PAN: N/A
PAD: N/A
Format: IBM 3624
—————————————-
Decoded PIN: 1234
The 4704 encrypting PIN Pad PIN block format supports a PIN from 1 to 13 digits in length. A PIN that is longer than 13 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
L | P | P/F | P/F | P/F | P/X | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | S1 | S2 |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: IBM 4704 EPP
—————————————-
Clear PIN block:41234FFFFFFFFF00
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 41234FFFFFFFFF00
PAN: N/A
PAD: 5
Format: IBM 4704 EPP
—————————————-
Decoded PIN: 1234
Same as IBM 3621.
Same as ISO-0.
The VISA-2 PIN block format supports a PIN from 4 to 6 digits in length. A PIN that is longer than 6 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
L | P | P | P | P | P/0 | P/0 | D | D | D | D | D | D | D | D | D |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: 5
Format: VISA-2
—————————————-
Clear PIN block:4123400555555555
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 4123400555555555
PAN: N/A
PAD: N/A
Format: VISA-2
—————————————-
Decoded PIN: 1234
The VISA-3 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
P | P | P | P | P/F | P/F/X | P/F/X | P/F/X | P/F/X | P/F/X | P/F/X | P/F/X | F/X | X | X | X |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: 5
Format: VISA-3
—————————————-
Clear PIN block:1234F55555555555
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 1234F55555555555
PAN: N/A
PAD: N/A
Format: VISA-3
—————————————-
Decoded PIN: 1234
The VISA-4 PIN block format supports a PIN from 4 to 12 digits in length. A PIN that is longer than 12 digits is truncated on the right.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | F | F |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | L | P | P | P | P | P/F | P/F | P/F | P/F | P/F | P/F | P/F | P/F | F | F |
XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR |
0 | 0 | 0 | 0 | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN | PAN |
Where:
PIN blocks: PIN block encrypt operation finished
****************************************
PAN: 43219876543210987
PIN: 1234
PAD: N/A
Format: VISA-4
—————————————-
Clear PIN block:041277DE6789ABCD
PIN blocks: PIN block decode operation finished
****************************************
PIN block: 041277DE6789ABCD
PAN: N/A
PAD: N/A
Format: VISA-4
—————————————-
Decoded PIN: 1234
The AS2805 Format 1 PIN block format is similar to an ISO-1 PIN block format. The PIN block format supports a PIN from 4 to 12 digits in length.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | L | P | P | P | P | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | R | R |
Where:
The AS2805 Format 8 PIN block (format 46) is similar to an Format 1 PIN block format. The PIN block format supports zero length PIN Block.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C | L | P | P | P | P | P/R | P/R | P/R | P/R | P/R | P/R | P/R | P/R | F | F |
8 | 0 | R | R | R | R | R | R | R | R | R | R | R | R | F | F |
Where: