Laravel Backup Shield
Secure your backups
Backup Shield simply listens for when the .zip-file generated by Laravel-backup is done, grabs it and applies your password and encryption of your liking.
Using Laravel 5.2? Check out the v1 branch.
composer require olssonm/laravel-backup-shield
PHP: "^7.0" and
laravel/framework: "^5.3". As long as other requirements are met, all versions of
spatie/laravel-backup above 4.0 should work.
In Laravel > 5.5 the service provider will be automatically added. You can also add the service provider to your app.php manually if needed:
'providers' => [ Olssonm\BackupShield\BackupShieldServiceProvider::class ]
Publish your configuration using
php artisan vendor:publish. Or if you're using a version of Laravel prior to 5.5 via
php artisan vendor:publish --provider="Olssonm\BackupShield\BackupShieldServiceProvider".
You only have the ability to set two different options; password and encryption.
// Default configuration; backup-shield.php return [ 'password' => env('APP_KEY'), 'encryption' => \Olssonm\BackupShield\Encryption::ENCRYPTION_DEFAULT ];
Your password (duh). The default is the application key (
APP_KEY in your .env-file). You might want to set something more appropriate. Remember to use long strings and to keep your password safe – without it you will never be able to open your backup.
NULL if you want to keep your backup without a password.
Set your type of encryption. Available options are:
\Olssonm\BackupShield\Encryption::ENCRYPTION_WINZIP_AES_128 (AES 128)
\Olssonm\BackupShield\Encryption::ENCRYPTION_WINZIP_AES_192 (AES 192)
\Olssonm\BackupShield\Encryption::ENCRYPTION_WINZIP_AES_256 (AES 256)
Important information regarding encryption
ENCRYPTION_DEFAULT (PKWARE/ZipCrypto) crypto gives you the best portability as most operating systems can natively unzip the file – however, ZipCrypto might be weak. The Winzip AES-methods on the other hand might require a separate app and/or licence to be able to unzip depending on your OS; suggestions for macOS are Keka and Stuffit Expander.
Also to note is that when zipping very large files ZipCrypto might be very inefficient as the entire data-set will have to be loaded into memory to perform the encryption, if the zipped file's content is bigger than your available RAM you will run out of memory.
$ composer test
The MIT License (MIT). Please see the LICENSE.md for more information.
© 2019 Marcus Olsson.