K6 DUKPT (TDES)
Needs: Supporter
A unique key per transaction: BDK, IPEK, KSN, the counter and the PIN, MAC and data variants.
This is a supporter feature. Create a free account, then try every supporter feature free for 7 days.
What this module covers
You will be able to
- Parse a KSN
- Derive the IPEK from a BDK
- Derive the transaction key for a counter
- Pick the PIN, MAC or data variant
- Explain the counter limit and why the terminal never holds the BDK
The lesson
- Why it matters
- The concept
- Step by step: the host's view
- In the real world
- Common mistakes
- What to test
In the module
- The lesson, with diagrams, common mistakes and what to test
- A worked example you can change: From the BDK to an encrypted PIN block
- Practice: 6 kinds of generated exercise, each with a step-by-step solution
- A quiz of 9 questions
Key terms
- Base derivation key (BDK)
- The secret key, held only in host HSMs, from which every device's initial key and every transaction key is derived.
- DUKPT (Derived unique key per transaction)
- A key scheme in which each transaction uses a different key, derived from a base derivation key and the device's KSN, so a stolen key exposes only one transaction.
- Future keys
- The keys a DUKPT device keeps ready for coming transactions. Each used key is erased.
- Initial key (IPEK, IK)
- The key loaded into a device, derived from the BDK and the device's KSN with the counter set to zero. The BDK never leaves the host.
- Key set identifier (KSI)
- The left part of the KSN, which tells the host which BDK to use.
- KSN (Key serial number)
- The value sent with each DUKPT transaction: the key set ID, the device ID and the transaction counter. The host uses it to derive the same key.
- Non-reversible key generation
- The TDES DUKPT step that derives each new key from the previous one, so a device key cannot be used to go back to earlier keys.
- PIN variant
- The DUKPT working key for PIN encryption: the transaction key XORed with the PIN mask. MAC and data keys use other masks.
- Transaction counter
- The right 21 bits of a TDES DUKPT KSN (32 bits in AES DUKPT), increased for every transaction. Values with too many one bits are skipped.
The lesson, worked example, practice and quiz open with a supporter pass, which you can try free for 7 days.