Wednesday, 11 January 2023

PIN Block Of Card Transaction

What is Pin Block?

=> The PIN block is the block of encoded data (i.e., PAN, PIN ). When the cardholder inputs his PIN on any terminal (i.e., ATM, POS etc.), we need to make sure that this PIN is safe and securely reached from the terminal to the acquirer and then the issuer.

There are different standards for building such blocks of data. One of the most commonly used standards for encoding data is ISO 9564-1 format 0 (i.e.,  ANSI X9.8, VISA-1, and ECI-1).

The steps for encoding this type of Encoding are as follows:

  1. Format of a 16 bytes PIN is : [0][Length][PIN][Padding]
    where,
               [0] indicates ISO-0 format.
               [Length] is the one-byte length of the PIN.
               [PIN] is the provided PIN by the cardholder.
               [Padding] is generally used as 'F'.

    So, For a PIN '123456', the padded PIN should be: '06123456FFFFFFFF'.

  2. Format of a 16 bytes PAN is : [0000][12 digit PAN]
    where,
               [12-digit PAN] should be getting by choosing the 12 rightmost digits of the PAN number (excluding the check digit).

    So, For a PAN '1234567890123456', the padded PAN should be: '0000456789012345'.

  3. Calculate the XOR of the padded PIN and the padded PAN should be the PIN block.
    here, 06123456FFFFFFFF   XOR   0000456789012345 =  0612713176FEDCBA

    '0612713176FEDCBA' is the PIN block.
There are several other PIN Block formats out there. For more information please visit ISO 9564 .