When CVN is calculated, two 64-bit verification keys, Keya and keyb, are used.
1) Data Sources for CVN calculation include: Primary Account (PAN), downtime, and Service Code, which are arranged from left to right.
4123456789012345 + 8701 + 111
2) Extend the data source to 128-bit binary data (less than 128-bit right-complement binary 0 ).
41234567890123458701111 + 000000000
3) divide 128-bit binary data into two 64-bit data blocks. The leftmost 64-bit is block1, And the rightmost 64-bit is block2.
Keya = 0123456789 abcdef, block1 = 4123456789012345
4) use Keya to encrypt block1.
3des_enc (block1, Keya, enca)
Enca = b76addce71ccc6be
5) The encrypted results of block1 are different or different from those of block2. Use Keya to encrypt an exception or result.
Block2 = 8701111000000000
Encb = XOR (block2, enca)
Encb = 306bccde71ccc6be
3des_enc (encb, Keya, ENCC)
ENCC = bae6746f6de1f0e6
Keyb = fedcba9876543210
6) Use keyb to decrypt the encrypted result.
3des_de (ENCC, keyb, encd)
Encd = b262abcb9de99a63
7) Use Keya to encrypt the decryption result.
3des_enc (encd, Keya, ENCE)
Ence = 8d5625fa78011a0c
8) extract the numbers (0-9) from the Left to right to form a group of numbers.
Ccrsn = 85625780110
9) extract the characters (A-F) in the encryption result from left to right, subtract 10 and combine the remainder array into a group of numbers after the numbers in step (8.
Ccrsa = dfaac
CCRSA-10 = 35002 // each digit minus 10
RST = 85625780110 35002
10) the first group of three digits on the left of STEP (9) is the CVN value.
CVN = 856