The CSC is generated when the card is issued, calculated by encrypting the bank card number, expiration date and service code with encryption keys known only to the card issuer, and decimalising the result.
The CSC is generated. The card is issued. The card is calculated by encrypting the bank card number with encryption keys, and decimalising the result. The card is calculated by encrypting expiration date with encryption keys, and decimalising the result. The card is calculated by encrypting service code with encryption keys, and decimalising the result. These encryption keys are known only to the card issuer.