This Flysystem adapter is a transparent decorator that encrypts/decrypts files using the Illuminate Encrypter.
Via Composer
$ composer require swisnl/flysystem-encrypted
N.B. Using Flysystem 1? Please use version 1.x of this adapter.
use Illuminate\Encryption\Encrypter;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
use Swis\Flysystem\Encrypted\EncryptedFilesystemAdapter;
// Create the adapter
$localAdapter = new Local('/path/to/root');
// Create the encrypter
$encrypter = new Encrypter('key', 'cipher');
// Decorate the adapter
$adapter = new EncryptedFilesystemAdapter($localAdapter, $encrypter);
// And use that to create the file system
$filesystem = new Filesystem($adapter);
- Encrypted data is — depending on what you encrypt — roughly 30-40% bigger.
- You can use streams with this adapter, but internally they will always be converted to a string because the entire file contents need to be encrypted/decrypted at once. This requires quite some memory, so this adapter is not recommended for large files.
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.