Generates the CVV (also known as CVC) used on the magnetic stripe of payment cards. CVV is computed using 3DES encryption of the PAN, expiry date, and service code with a pair of CVV keys (Key A and Key B).
Inputs
PAN: Primary Account Number (card number, up to 19 digits).
Expiry Date: Card expiration date in YYMM format.
Service Code: Three-digit service code from the magnetic stripe (e.g., 101, 201).
Key A: First half of the CVV key pair (8 bytes / 16 hex chars).
Key B: Second half of the CVV key pair (8 bytes / 16 hex chars).
Tips
CVV and CVC are the same algorithm — CVV is Visa's name, CVC is Mastercard's.
The CVV key pair (A+B) forms a double-length 3DES key.
Magnetic stripe CVV is different from CVV2 (printed on card back) — they use different service codes.
Standards: Visa CVV Specification, Mastercard CVC Specification