All pages
Powered by GitBook
1 of 1

Loading...

Key Serial Numbers (KSNs)

The device can use two different types of keys: Triple Data Encryption Standard (TDES) DUKPT Keys and AES DUKPT Keys. The Key Serial Number (KSN) format is slightly different depending on which type of key is injected into the key slot that is being used by the operation being performed or the data being passed.

When the device and host are using TDES keys, the Key Serial Number (KSN) is an 80-bit value. The rightmost 21 bits are the current value of the encryption counter associated with that key. The leftmost 59 bits are the Initial KSN for that key, which is specified during key injection and is a combination of the Key Set ID that identifies the Base Derivation Key (BDK) injected into the device during manufacture, and the device’s serial number (DSN); how those two values are combined into the 59 bit Initial KSN is defined by a convention the customer defines when architecting the solution, with support from MagTek.For example, one common scheme is to concatenate:

  • a 7 hex digit (28 bit) Key Set ID,

  • a 7 hex digit (28 bit) Device Serial Number,

  • and a 3 bit Initial Key Load Counter the injecting host increments each time the same key is re-loaded into the device.

In these cases, the key can be referenced by an 8-digit MagTek part number (“key ID”) consisting of the 7 hex digit Key Set ID plus a trailing “0.”

Need Help?

For additional support, please contact MagTek Support:

Technical Support:

  • 📧 Email: support@magtek.com

  • 📞 Phone: 1-800-788-6835 (US) | +1-562-546-6616 (International)

  • 🕐 Hours: Monday-Friday, 6:00 AM - 5:00 PM PST

Online Resources:

  • 🌐 Official Site:

  • 💬 Developer Forum:

Documentation Feedback:

Help us improve this documentation!

https://www.magtek.com
https://forum.magtek.com
Submit feedback