alextartan / flysystem-libsodium-adapter
On-the-fly encrypt and decrypt flysystem files
Installs: 20 985
Dependents: 0
Suggesters: 1
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 12
Requires
- php: >=7.4
- ext-sodium: *
- alextartan/helpers: 2.0.*
- league/flysystem: ^1.0.63
- league/flysystem-adapter-decorator: ^1.0.0
- league/flysystem-aws-s3-v3: ^1.0.23
- monolog/monolog: ^2.0.2
Requires (Dev)
- ext-openssl: *
- infection/infection: ^0.15.0
- league/flysystem-memory: ^1.0.2
- php-coveralls/php-coveralls: ^2.2.0
- phpstan/phpstan: ^0.12.5
- phpstan/phpstan-phpunit: ^0.12.6
- phpstan/phpstan-strict-rules: ^0.12.1
- phpunit/phpunit: ^8.5.2
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: 3.5.*
- symfony/var-dumper: ^5.0.2
- dev-master
- 2.0.1
- 2.0.0
- 1.0.1
- 1.0.0
- 0.9.6
- 0.9.5
- 0.9.1
- 0.9
- dev-dependabot/composer/phpdocumentor/type-resolver-1.6.2
- dev-dependabot/composer/league/flysystem-1.1.10
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/myclabs/deep-copy-1.11.0
- dev-dependabot/composer/phpunit/php-file-iterator-3.0.6
- dev-dependabot/composer/sebastian/object-enumerator-4.0.4
- dev-dependabot/composer/sebastian/recursion-context-4.0.4
- dev-dependabot/composer/phpunit/php-timer-5.0.3
- dev-dependabot/composer/sebastian/resource-operations-3.0.3
- dev-dependabot/composer/phpunit/php-invoker-3.1.1
- dev-dependabot/composer/sebastian/version-3.0.2
- dev-dependabot/composer/phpunit/php-token-stream-4.0.4
This package is auto-updated.
Last update: 2024-10-17 08:08:53 UTC
README
Performing on-the-fly client-side encryption for safe storage of files.
On uploads, the content is encrypted using Poly 1305 with a secret key and stored securely on the filesystem.
On downloads, the content is decrypted.
Current build status
Installation
composer require alextartan/flysystem-libsodium-adapter
Usage
use AlexTartan\Flysystem\Adapter\ChunkEncryption\Libsodium;use AlexTartan\Flysystem\Adapter\EncryptionAdapterDecorator; use League\Flysystem\Filesystem; use League\Flysystem\Memory\MemoryAdapter; $adapter = new MemoryAdapter(); $encryption = Libsodium::factory($encryptionKey, 4096); $adapterDecorator = new EncryptionAdapterDecorator( $adapter, $encryption ); $filesystem = new Filesystem($adapterDecorator);
Notice;
Due to how AwsS3 (and probably other remote adapters) handle stream uploads,
I had to change the way this lib worked (versions up to v.1.0.0
)
New releases employ a php://temp
stream in which the encryption is done
and once that finishes, the stream is sent to writeStream
/readStream
Performance wise, it handles ok from what i could see.
Versioning
This library adheres to semver