updraftplus
Last commit date
addons
13 years ago
central
9 years ago
css
9 years ago
images
9 years ago
includes
9 years ago
languages
9 years ago
methods
9 years ago
vendor
9 years ago
admin.php
9 years ago
backup.php
9 years ago
changelog.txt
9 years ago
class-updraftplus.php
9 years ago
class-zip.php
9 years ago
clean-composer.sh
9 years ago
composer.json
9 years ago
composer.lock
9 years ago
example-decrypt.php
9 years ago
index.html
9 years ago
options.php
9 years ago
readme.txt
9 years ago
restorer.php
9 years ago
updraftplus.php
9 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 |