I'm tasked with decrypting ciphertext acquired from an encrypted card reader. The card reader utilizes DUKPT(derived unique key per transaction) scheme and 3DES encryption. I don't have a problem with the 3DES encryption as it is a common algorithm implemented by well known libraries like BouncyCastle and Java JCE.
Prior to this assignment, I have had no encounters with DUKPT at all so I am a complete newbie to this.
From what I have read so far, DUKPT utilizes a key derivation mechanism based on a Base Derivation Key(BDK) which is basically a shared secret key and Key Serial Numbers for the particular transaction. In the case of the card reader, each time I swipe(even with the same card), the cipher text would be different and the KSN would be different. Knowing the BDK, the KSN, the encryption algorithm(which in this case is 3DES) and the cipher text, how do I go about deriving the Key for the transaction based on this information? I would imagine there is some sort of key derivation function right?