PHP code example of blocktrail / cryptojs-aes-php

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

    

blocktrail / cryptojs-aes-php example snippets



use Blocktrail\CryptoJSAES\CryptoJSAES;

use Blocktrail\CryptoJSAES\CryptoJSAES;

$passphrase = "my passphrase";
$text = "example value";

$encrypted = CryptoJSAES::encrypt($text, $passphrase);
var_dump("Encrypted: ", $encrypted);

$decrypted = CryptoJSAES::decrypt($encrypted, $passphrase);
var_dump("Decrypted: ", $decrypted);


# Install Composer
curl -sS https://getcomposer.org/installer | php

# Add the BlockTrail SDK as a dependency
php composer.phar 

"blocktrail/cryptojs-aes-php": "~0.1.0"