Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp...
File: example-decrypt.php
<?php
[0] Fix | Delete
// @codingStandardsIgnoreStart
[1] Fix | Delete
/*
[2] Fix | Delete
To dump the decrypted file using the given key on stdout, call:
[3] Fix | Delete
[4] Fix | Delete
rijndael_decrypt_file('../path/to/file.crypt' , 'mykey');
[5] Fix | Delete
[6] Fix | Delete
Thus, here are the easy instructions:
[7] Fix | Delete
[8] Fix | Delete
1) Add a line like the above into this PHP file (not inside these comments, but outside)
[9] Fix | Delete
e.g.
[10] Fix | Delete
rijndael_decrypt_file('/home/myself/myfile.crypt' , 'MYKEY');
[11] Fix | Delete
[12] Fix | Delete
2) Run this file (and make sure that includes/Rijndael.php is available, if you are moving this file around)
[13] Fix | Delete
e.g.
[14] Fix | Delete
php /home/myself/example-decrypt.php >output.sql.gz
[15] Fix | Delete
[16] Fix | Delete
3) You may then want to gunzip the resulting file to have a standard SQL file.
[17] Fix | Delete
e.g.
[18] Fix | Delete
gunzip output.sql.gz
[19] Fix | Delete
[20] Fix | Delete
*/
[21] Fix | Delete
// @codingStandardsIgnoreEnd
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* An example of how to decrypt a file
[25] Fix | Delete
*
[26] Fix | Delete
* @param String $file Full path to file to decrypt
[27] Fix | Delete
* @param String $key Key or salting to be used
[28] Fix | Delete
*/
[29] Fix | Delete
function rijndael_decrypt_file($file, $key) {
[30] Fix | Delete
[31] Fix | Delete
include_once(dirname(__FILE__).'/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php');
[32] Fix | Delete
[33] Fix | Delete
$rijndael = new Crypt_Rijndael();
[34] Fix | Delete
[35] Fix | Delete
$rijndael->setKey($key);
[36] Fix | Delete
[37] Fix | Delete
$ciphertext = file_get_contents($file);
[38] Fix | Delete
[39] Fix | Delete
print $rijndael->decrypt($ciphertext);
[40] Fix | Delete
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function