updraftplus
Last commit date
addons
13 years ago
central
10 years ago
css
10 years ago
images
10 years ago
includes
10 years ago
languages
10 years ago
methods
10 years ago
vendor
10 years ago
admin.php
10 years ago
backup.php
10 years ago
class-updraftplus.php
10 years ago
class-zip.php
10 years ago
clean-composer.sh
10 years ago
composer.json
10 years ago
composer.lock
10 years ago
example-decrypt.php
10 years ago
index.html
10 years ago
options.php
10 years ago
readme.txt
10 years ago
restorer.php
10 years ago
updraftplus.php
10 years ago
example-decrypt.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | |
| 5 | To dump the decrypted file using the given key on stdout, call: |
| 6 | |
| 7 | rijndael_decrypt_file( '../path/to/file.crypt' , 'mykey' ); |
| 8 | |
| 9 | Thus, here are the easy instructions: |
| 10 | |
| 11 | 1) Add a line like the above into this PHP file (not inside these comments, but outside) |
| 12 | e.g. |
| 13 | rijndael_decrypt_file( '/home/myself/myfile.crypt' , 'MYKEY' ); |
| 14 | |
| 15 | 2) Run this file (and make sure that includes/Rijndael.php is available, if you are moving this file around) |
| 16 | e.g. |
| 17 | php /home/myself/example-decrypt.php >output.sql.gz |
| 18 | |
| 19 | 3) You may then want to gunzip the resulting file to have a standard SQL file. |
| 20 | e.g. |
| 21 | gunzip output.sql.gz |
| 22 | |
| 23 | */ |
| 24 | |
| 25 | function rijndael_decrypt_file($file, $key) { |
| 26 | |
| 27 | require_once(dirname(__FILE__).'/includes/phpseclib/Crypt/Rijndael.php'); |
| 28 | |
| 29 | $rijndael = new Crypt_Rijndael(); |
| 30 | |
| 31 | $rijndael->setKey($key); |
| 32 | |
| 33 | $ciphertext = file_get_contents($file); |
| 34 | |
| 35 | print $rijndael->decrypt($ciphertext); |
| 36 | |
| 37 | } |
| 38 |