PHP code example of nichin79 / encrypt-php

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

    

nichin79 / encrypt-php example snippets




ichin79\Encryption\Encryption;

$encryption = new Encryption([
  'passphrase' => 'pass1234',
]);

$string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
$encrypted = $encryption->encrypt($string);
$decrypted = $encryption->decrypt($encrypted);

echo "\r\nOriginal String:\r\n$string\r\n";
echo "\r\nEncrypted String:\r\n$encrypted\r\n";
echo "\r\nDecrypted String:\r\n$decrypted\r\n";