PHP code example of tonicforhealth / dukpt
1. Go to this page and download the library: Download tonicforhealth/dukpt 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/ */
tonicforhealth / dukpt example snippets
use TonicForHealth\DUKPT\Device\PinEncryptionDevice;
use TonicForHealth\DUKPT\DUKPTFactory;
$cipherText = '160954FE1071D30C5CF260C5AC48EB5FBEFE37B32033E3B7EF693F8C6AB1BBD6276446FB3689728B926D923CD9ECCD522B6DE5850FD9AB2D7976D943C12CDC947E023098CAAE4F6D';
$device = new PinEncryptionDevice(new DUKPTFactory());
$device->load('0123456789ABCDEFFEDCBA9876543210', 'FFFF9876543210E00008');
$plainText = $device->decrypt($cipherText); // %B4124939999999990^TEST/TESTCARD^19129015432139614567891234567890?