PHP code example of camcima / dukpt-php
1. Go to this page and download the library: Download camcima/dukpt-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
camcima / dukpt-php example snippets
use DUKPT\DerivedKey;
use DUKPT\KeySerialNumber;
use DUKPT\Utility;
$ksnObj = new KeySerialNumber($ksn);
$decryptionKey = DerivedKey::calculateDataEncryptionRequestKey($ksnObj, $bdk);
use DUKPT\DerivedKey;
use DUKPT\KeySerialNumber;
use DUKPT\Utility;
$decryptedData = Utility::hex2bin(
Utility::removePadding(
Utility::tripleDesDecrypt($encryptedHexData, $decryptionKey, true)
)
);