arispati/php-encrypt-file

PHP library for encrypt and decrypt file

v0.1.0 2021-11-12 11:41 UTC

This package is auto-updated.

Last update: 2024-11-12 18:10:31 UTC


README

PHP library for encrypt and decrypt file

How to Install

  • Install with composer
composer require arispati/php-encrypt-file

How to Use

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');

Credits

  • Thanks to Antoine Lamé - Medium.