Assume that the IC card application key of the issuing bank is as follows:
PBOC_IMK_AC F0C34A8124CEE0A91A0B034AA97D6EAC PBOC_IMK_ENC D30F45EABC12AC3EF56B0C0D7F8654DE PBOC_IMK_MAC 12B1AC4AF070CC35612BFE2D30AB600D
ARQC and ARPC and process data are as follows:
[9f26] ---> [8] ---> [5D016C91005E7CC2] // Apply ciphertext [9f27] ---> [1] ---> [80] // Ciphertext information data [9f10]- -> [19] ---> [07000103A04002010A010000001000D1F61152] // Issuer bank application data [9f37] ---> [4] ---> [1E78EEBC] // Terminal random number [9f36] ---> [2] ---> [0240] // Application transaction counter [95] ---> [5] ---> [0080046000] // Terminal verification result (TVR) [9a] ---> [3] --- > [140701] // Transaction date [9c] ---> [1] ---> [00] // Transaction type [9f02] ---> [6] ---> [000000000001] // Authorized amount [5f2a] ---> [2] ---> [0156] // Transaction currency code [82] ---> [2] ---> [7D00] // Application Interaction Feature (AIP) [9f1a] ---> [2] ---> [0156] // Terminal country code [9f03] ---> [6] ---> [000000000000] // Other amounts [9f33] ---> [3] ---> [60E1C8] // Terminal performance [9f34] ---> [3] ---> [020300] // Cardholder authentication result [9f35] ---> [1] ---> [ 22] // Terminal type [9f1e] ---> [8] ---> [3833323049434300] // Interface device serial number [84] ---> [8] ---> [A000000333010101] // Special file (DF) Name [9f09] ---> [2] ---> [0020] // Application version Number (Terminal) [9f41] ---> [4] ---> [00000007] // transaction sequence counter
Calculate ARQC process data:
Calculated Card Number: 6228000100001 Card Serial Number: 01
Transaction counter: 0240
Data for calculating ARQC: 000000000001000000000000015600800460000156140701001E78EEBC7D00024003A04002
Calculated ARQC: 5D016C91005E7CC2 Obtained ARQC: 5D016C91005E7CC2
Calculate the process data of ARPC:
Calculated card number: 6228000100001 Card serial number: 01 Transaction counter: 0240 ARQC value: 5D016C91005E7CC2 Authorization response code: 01 Calculated ARPC: 21415243527CE78F
The calculation formula of the IC card process key SKAC:
Calculate the decentralized key first, and then calculate the process key PAN + serial number to take the rightmost 16 digits Y: PAN + serial number to take the rightmost 16 digits Z: = ALG (MDK) [Y || (Y⊕ ('FF' || ' FF '||' FF '||' FF '||' FF '||' FF '||' FF '||' FF '))] Get the card scatter key: Z process key SKAC: = ALG ( Key (= Z)) ['00' || '00' || '00' || '00' || '00' || '00' || ATC || '00' || '00' || '00' || '00' || '00' || '00' || (ATC⊕'FFFF ')]
Example calculation: Pan: 6228000100001 Serial number: 01 ATC: 0240 Y: 0622800010000101 (Y⊕ ('FF' || 'FF' || 'FF' || 'FF' || 'FF' || 'FF' || 'FF' || 'FF')): 0622800010000101 XOR FFFFFFFFFFFFFFFF = F9DD7FFFEFFFFEFE Y || (Y⊕ ('FF' || 'FF' || 'FF' || 'FF' || 'FF' || ' FF '||' FF '||' FF ')): 0622800010000101F9DD7FFFEFFFFEFE Get the card dispersion factor: 0622800010000101F9DD7FFFEFFFFEFE PBOC_IMK_AC Encrypt the dispersion factor by 3DES to get the card dispersion key Z: 014D996FCC8F49157DC8B49E3BCDFD99 The dispersion process is generated by [ || '00' || '00' || '00' || '00' || '00' || ATC || '00' || '00' || '00' || '00' || '00' || '00' || (ATC⊕'FFFF ')]: 0000000000000240000000000000FDBF The process key SKAC is obtained by Z 3DES encryption of the above dispersion factor: D4102725E6E5AD329E55AAB50BF23DA9
ARQC calculation And Step formula:
SKAC use key data involved in the calculation performed by PBOC-3DES algorithm Mac calculated ARQC. Data to calculate ARQC: 000000000001000000000000015600800460000156140701001E78EEBC7D00024003A04002 Process key SKAC: D4102725E6E5AD329E55AAB50BF23DA9 Use the process key SKAC to calculate the data calculated by the parameter through the PBOC-3DES algorithm to calculate ARQC: 5D016C91005E7CC2
ARPC calculation steps and formulas:
Calculate the ARPC process: X = (ARC || ‘00’ || ’00’ || ’00’ || ’00’ || ’00’ || ’00’)
Y: = ARQC⊕ X
ARPC: = ALG (SKAC) [Y || ’00’ || ’00’ || ’00’ || ’00’ || ’00’ || ’00 ||’ 00 ’||’ 00]
Example calculation: ARC: 01 X: 3031000000000000 Y: 5D016C91005E7CC2⊕3031000000000000 = 6D306C91005E7CC2 [Y || '00' || '00' || '00' || '00' || '00' || '00 ||' 00 '||' 00]: 6D306C91005E7CC20000000000000000 ARPC by key SKAC pair [Y || '00' || '00' || '00' || '00' || '00' || '00 ||' 00 '||' 00] Perform 3DES encryption operation to get: 21415243527CE78FEFA66824CDC903C0 that is ARPC: 21415243527CE78F
Go to: Financial IC Card ARQC and ARPC Calculation Methods and Examples
Financial IC card ARQC and ARPC calculation methods and examples (turn)