swisnl / flysystem-encrypted
Flysystem Adapter Encryption Decorator
Installs: 3 206
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- illuminate/encryption: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- league/flysystem: ^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.14
- league/flysystem-adapter-test-utilities: ^2.0|^3.0
- league/flysystem-memory: ^2.0|^3.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-24 19:42:20 UTC
README
This Flysystem adapter is a transparent decorator that encrypts/decrypts files using the Illuminate Encrypter.
Install
Via Composer
$ composer require swisnl/flysystem-encrypted
N.B. Using Flysystem 1? Please use version 1.x of this adapter.
Usage
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);
Known limitations
- 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.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
Credits
License
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 ❤️ Open Source
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.