Computes the IBM 3624 PIN offset for a cardholder-chosen PIN, or recovers that PIN from a stored offset. Validation data derived from the PAN is encrypted with the PVK under 3DES-ECB, the 16 nibbles of the result are mapped to decimal through a decimalization table, and the leading digits form the natural PIN; the offset is the digit-by-digit difference modulo 10 between the customer PIN and the natural PIN. Issuers store the offset so a chosen PIN can be verified without storing the PIN itself.
Inputs
Mode: Direction of the calculation.
PVK: PIN Verification Key in hex. 32 hex chars (double-length) or 48 (triple-length). Whitespace is stripped.
PAN: Primary Account Number, 13-19 digits. Spaces and hyphens are stripped. Used to build the validation data when that field is left empty.
PIN: The customer PIN, 4-12 digits. Calculate mode only. Its length decides how many leading digits of the decimalized block form the natural PIN.
PIN Offset: The stored offset, 4-12 digits. Decrypt mode only. Its length decides the length of the recovered PIN.
Decimalization Table: Sixteen decimal digits mapping hex nibbles 0-F of the encrypted block to digits 0-9. Position 0 is the image of nibble 0, position 15 the image of nibble F.
Validation Data (optional): Overrides the PAN-derived validation data. Hex, up to 16 chars, right-padded with zeros to 16 nibbles (one 8-byte block). 12 or 16 chars is the usual length.
Tips
The offset is not secret. It is stored on the card or in the issuer record, and without the PVK it reveals nothing about the PIN.
Subtraction and addition are per digit modulo 10 with no borrow or carry, so each offset digit depends only on the PIN digit in the same position.
Validation data derivation is issuer-specific. This tool takes the rightmost 12 PAN digits excluding the check digit; other systems take the leftmost 12, keep the check digit, or pad differently. When an offset does not match a host, compare the Validation Data and Encrypted values shown with the result before suspecting the key.
A non-default decimalization table changes every natural PIN. Tables that collapse many nibbles onto the same digit shrink the PIN space and enable the decimalization table attack, so keep 0123456789012345 unless the issuer profile says otherwise.
Standards: IBM 3624 PIN Generation and Offset Method, ISO 9564-1, ANSI X9.8