PHP code example of codezero / encrypter

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

    

codezero / encrypter example snippets


composer 



$key = 'my secret key';

$encrypter = new \CodeZero\Encrypter\DefaultEncrypter($key);

$encrypted = $encrypter->encrypt('some string');

try {
    $decrypted = $encrypter->decrypt($encrypted);
} catch (\CodeZero\Encrypter\DecryptException $exception) {
    // Decryption failed...
}