PHP code example of jsnlib / des

1. Go to this page and download the library: Download jsnlib/des 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/ */

    

jsnlib / des example snippets


use Jsnlib\DES;

$des = new DES('key123456', 'DES-ECB', DES::OUTPUT_BASE64);
$data = [
    'id' => 'A123456',
    'name' => 'Cary',
    'expired' => '2099-01-01'
];
$encrypt = $des->encrypt(json_encode($data));
$descrypt = $des->decrypt($encrypt);