PHP code example of steein / cryptopad

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

    

steein / cryptopad example snippets


$crypto = new \SteeinCrypt\CryptoPad();

//Test key and global key
$key        = 'rUhidagNflImJ3wB';
$global_key = '%31.1e$i86e$f!8jz';


$encrypt = $crypto->encrypt('default text', $key);
echo $encrypt;

$decrypt = $crypto->decrypt($encrypt, $key);
echo $decrypt;

$encryptBase64 = $crypto->encryptBase64('base64_encrypt', $key, true);
$crypto->decryptBase64($encryptBase64, $key, true);

$global_crypt = $crypto
    ->setKey($global_key)
    ->encrypt('default_text', $key);
$crypto->decrypt($global_crypt, $key);