PHP code example of websvc / cryptor

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

    

websvc / cryptor example snippets


$data = '{"val1":"xxxxxx"}';

$encryption_key = "964POMWCLRCP+A0ER3UMRPODSJGFV3843QĹK,FD9843MQewocm3c4";
$crypt = new CryptorFixedIv($encryption_key);
$encrypted = $crypt->encrypt($data);
echo "\nencrypted: " . $encrypted;

$crypt = new CryptorFixedIv($encryption_key);
echo "\ndecrypted: " . $crypt->decrypt($encrypted);
echo chr(10);

# encrypted: PAlHiBIcsH7A61fPySEasRurrYAGzAmTIMxTR82LB8w=
# decrypted: {"val1":"xxxxxx"}