Payment Cryptography, Hands-On
Module 8 · Putting it together

Launching a new BIN

A BIN (bank identification number, the first 6–8 digits of the card number) identifies an issuer’s card product. Every time a new one goes live, the processor runs the whole course in miniature: generate keys, exchange them across zones, configure, test.

1. The cast

PartyRoleShares with the processor
Card network (Visa, Mastercard)Routes authorisations; may authorise on your behalf (STIP)ZMK/ZCMK (paper ceremony), then PIN keys, and CVK / MK-AC if stand-in services are on
Card bureau (personalisation)Manufactures cards, writes chip keys, prints CVV2, mails PINsIts own ZMK; then MK-AC, MK-SMI, MK-SMC, MK-IDN/CVC3, CVK, PIN-mailer key
HSM / key custodianHolds every key; may be your own HSM or a hosted oneEverything, under its master key

2. Why “one BIN → one key set”

Each BIN gets its own IMKs and CVK (Card Verification Key). If a key set is ever compromised, only that BIN’s cards are at risk and need reissuing; the rest of the portfolio is untouched. Configuration then needs a mapping BIN → key set, so that when an authorisation arrives, the processor knows which (encrypted) keys to send to the HSM (Hardware Security Module).

3. The process

  1. Zones in place? ZMKs with the network and with the bureau usually exist already (ceremonies happen once per partner, not per BIN).
  2. Generate the key set in the HSM: MK-AC (Master Key for Application Cryptograms), MK-SMI (Master Key for Secure Messaging Integrity), MK-SMC (+ IDN/CVC3), CVK. Record each KCV (Key Check Value).
  3. Export each key as a TR-31 (ANSI X9 Technical Report 31, the key block format) block under the partner’s ZMK (Zone Master Key): one export for the bureau, one for the network if needed. Same keys, different wrappings (module 3, “same key, different hex”).
  4. Exchange KCVs with each partner; they import and confirm.
  5. Store the keys for your own use — encrypted under your HSM’s master key, or as HSM key references — in your secrets store, and add the BIN → key mapping to config.
  6. Test: generate and verify a CVV2 (Card Verification Value 2, the printed code) for a test card; verify an ARQC (Authorization Request Cryptogram) from a test card or test tool; run the network’s certification scripts.
  7. Go live, and document KCVs and custody in the key inventory (PCI requires one).
The KCV is the thread through all of it Generated in the HSM, written on the export letter, compared by the bureau, compared by the network, recorded in the inventory, checked again in the config. If two KCVs that should match don’t, nothing goes live.

4. Puzzles you’ll meet

“Why are there two sets of keys?”

Possible answers, in the order to check them: (a) same keys under two different wrappings (for two partners, or for your HSM and for a partner) — KCVs match; (b) two products or brands (e.g. a Visa and a Mastercard range) — KCVs differ; (c) test vs production; (d) old and new keys during a rotation. Only the KCVs tell (a) from the rest.

“The bureau says our KCV is wrong”

Check, in order: same key (compare against your HSM’s KCV, not a spreadsheet); same KCV method (3DES (Triple DES) zeros vs AES (Advanced Encryption Standard) CMAC (Cipher-based MAC); 6 vs 4 digits); the right ZMK (theirs vs another partner’s); the key block format they expect (TR-31 vs a vendor format like AKB).

Exercises

Do you need a new key ceremony with the card bureau for every new BIN?

  • Yes
  • No, usually only once per partner (and on ZMK rotation)

Which key does the card network typically not need?

  • The zone PIN (Personal Identification Number) key (ZPK)
  • MK-SMC (secure messaging confidentiality)
  • The CVK, if stand-in processing is enabled
HintDecrypt both with their own ZMKs, compare KCVs.

The bureau imported your MK-AC and reports KCV 8A1B; your letter says 8A1B2C. Problem?

  • Probably not: they display a 2-byte KCV, you a 3-byte one — the prefixes match
  • Yes, different keys

Final boss. You are the processor. Go from paper components to a verified chip transaction.

Hint 1Combine the three components with XOR (two at a time in the XOR playground), check the KCV.
Hint 2TR-31 inspector: the key block, with the ZMK as KBPK → IMK (Issuer Master Key).
Hint 3EMV (Europay, Mastercard, Visa — the chip card standard) pipeline: IMK, PAN (Primary Account Number, the card number), PSN (PAN Sequence Number) 00, ATC (Application Transaction Counter) 0042, amount and UN (Unpredictable Number) from the question.
What next You now speak the language. Go back to your team’s runbook and map each step to a module here — that’s the best way to make it stick. Then: the reading list.