Calculates or reverses an ISO 9564 Format 0 PIN block. A PIN block is the encrypted form of a cardholder's PIN, created by XORing the PIN field with the PAN field. Format 0 is the most widely used format in payment systems.
Inputs
Mode: Calculate a PIN block from PIN + PAN, or reverse a PIN block to extract the PIN.
PIN: The cardholder's Personal Identification Number (4-12 digits).
PAN: Primary Account Number (card number). The rightmost 12 digits (excluding check digit) are used.
PIN Block: The 16-hex-character PIN block to reverse (for Reverse mode).
Tips
Format 0 PIN block = XOR of (0 + PIN length + PIN + padding) with (0000 + rightmost 12 PAN digits).
The PIN block is then encrypted under a PIN Encryption Key (PEK/ZPK) before transmission.
Steps display shows the intermediate calculation for learning/debugging.