How card data generation works
Calculating the correct card number
First Step is to calculate the card number based on an in initial value or a prefix or BIN. If you just press the "Generate Cards" button, an initial card number is
set by default. This is "4000340000000500", which is an invalid Card Number.
To make calculate a correct card number, we call a function that takes the first 15 characters of this card number, so without the last digit. This last digit is being
calculated with Luhn algorithm. That is why it is called the Luhn Digit. The algorithm makes the Luhn check of the first 15 digits and appends the calculated digit, so
the correct card number is 4000340000000504
Generating the card records
For printing on the plastic card, this card number is split in 4 digits groups, with a blank space as a separator. The Expiration Date is a 4 digit number in the
format of MMYY which means month as 2 digits, and year, also 2 digits. Next is the name that is printed on the card. The Institution ID is the ID of the Bank or
institution that issued the card. Nowdays there are cards issued by non-banks, like bank-in-an-app services.
Next, we need to calculate the CVV, the 3-digit number that gets printed on the back of the card. The CVV is calculated from the card number, the expiration date, and
the service code. The CVV encryption key is used to apply encryption to the data.
The following 2 records are Track1 and Track2 data. Track1 is not really used anymore, but Track2 is always used and it is printed on the magnetic stripe of the back
of the card, just like recording with a casette player recorder. The Track1 and Track2 records have a specific format which you can see from the generation console.
Next, we append the Address information, whick can consist of 2-7 records, depending on company. This is plain text address information.
A random number is being generated to uniquely identify this record , which may or may not be used. Based on this information, 3 sets of records are generated.
The card printing information
A file is generated for the company that will literally print the plastic cards, and that you can see in the record above.
The database record information
A file is generated which will make SQL inserts of the data the bank will store so it can verify this card and PIN.
The Pin printing information
A file is generated for the envelope printing service, which may contain the address and PIN number. The only place where the real, clear PIN is stored. It does not exist
in any other place, and once printed to the envelope that goes to the card Holder, the client, this value does not exist anywhere anymore