mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-21 01:00:08 -05:00
51719ec5b1
- Add Extra Security Measures To Backups! - We simply listen for when the .zip-file generated by the backupmanger is done, grabs it and applies your password and encryption of your liking. - NOTE: Encryption Types: \App\Helpers\BackupEncryption::ENCRYPTION_DEFAULT (PKWARE/ZipCrypto) \App\Helpers\BackupEncryption::ENCRYPTION_WINZIP_AES_128 (AES 128) \App\Helpers\BackupEncryption::ENCRYPTION_WINZIP_AES_192 (AES 192) \App\Helpers\BackupEncryption::ENCRYPTION_WINZIP_AES_256 (AES 256) Important information regarding encryption: Using the 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. Password: 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. Set to NULL if you want to keep your backup without a password.
24 lines
733 B
PHP
24 lines
733 B
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE.
|
|
*
|
|
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D
|
|
*
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author HDVinnie
|
|
*/
|
|
|
|
namespace App\Helpers;
|
|
|
|
use PhpZip\ZipFile;
|
|
|
|
class BackupEncryption
|
|
{
|
|
const ENCRYPTION_DEFAULT = ZipFile::ENCRYPTION_METHOD_TRADITIONAL;
|
|
const ENCRYPTION_WINZIP_AES_128 = ZipFile::ENCRYPTION_METHOD_WINZIP_AES_128;
|
|
const ENCRYPTION_WINZIP_AES_192 = ZipFile::ENCRYPTION_METHOD_WINZIP_AES_192;
|
|
const ENCRYPTION_WINZIP_AES_256 = ZipFile::ENCRYPTION_METHOD_WINZIP_AES_256;
|
|
} |