PHP code example of ronijan / encrypt-decrypt-with-php

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

    

ronijan / encrypt-decrypt-with-php example snippets




onijan\EncryptDecrypt\EncryptDecrypt;

$encryptDecrypt = new EncryptDecrypt();

$encryptionKey = sha1('SOME-KEY-HERE');

// to encrypt
echo $encryptedText = $encryptDecrypt->encrypt('Hello World', $encryptionKey);

echo '<br>';

// to decrypt
echo $encryptDecrypt->decrypt($encryptedText, $encryptionKey);