PHP code example of arispati / php-encrypt-file

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

    

arispati / php-encrypt-file example snippets


use Arispati\PhpEncryptFile\Crypt;

// by default use 'AES-256-CBC' cipher
// you can change it on the second argument
$crypt = new Crypt('your-secret-key');

// to encrypt
$crypt->encrypt('./path/to/plainFile.ext', './path/to/encryptedFile.ext');
// to decrypt
$crypt->decrypt('./path/to/encryptedFile.ext', './path/to/decryptedFile.ext');
bash
composer