PHP code example of dorantor / simple-crypt

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

    

dorantor / simple-crypt example snippets


// 32 byte string as key
$key = md5('simple-crypt'); // 1b8ee2dc7723b2846792349dd4c74dc2
$crypt = new \Dorantor\SimpleCrypt($key);

$eMessage = $crypt->encrypt('Secret message that should be read only by trusted ones');

// ...

$oMessage = $crypt->decrypt($eMessage);