PluginProbe
UpdraftPlus: WP Backup & Migration Plugin / 1.16.53
UpdraftPlus: WP Backup & Migration Plugin v1.16.53
1.26.7 1.26.6 1.26.5 1.26.4 1.26.3 1.9.19 1.9.25 1.9.26 1.9.30 1.9.31 1.9.32 1.9.4 1.9.40 1.9.41 1.9.42 1.9.43 1.9.44 1.9.45 1.9.46 1.9.5 1.9.50 1.9.51 1.9.60 1.9.62 1.9.63 All 371 releases
updraftplus / example-decrypt.php

example-decrypt.php in UpdraftPlus: WP Backup & Migration Plugin 1.16.53, at example-decrypt.php

44 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // @codingStandardsIgnoreStart
3 /*
4 To dump the decrypted file using the given key on stdout, call:
5
6 rijndael_decrypt_file('../path/to/file.crypt' , 'mykey');
7
8 Thus, here are the easy instructions:
9
10 1) Add a line like the above into this PHP file (not inside these comments, but outside)
11 e.g.
12 rijndael_decrypt_file('/home/myself/myfile.crypt' , 'MYKEY');
13
14 2) Run this file (and make sure that includes/Rijndael.php is available, if you are moving this file around)
15 e.g.
16 php /home/myself/example-decrypt.php >output.sql.gz
17
18 3) You may then want to gunzip the resulting file to have a standard SQL file.
19 e.g.
20 gunzip output.sql.gz
21
22 */
23 // @codingStandardsIgnoreEnd
24
25 /**
26 * An example of how to decrypt a file
27 *
28 * @param String $file Full path to file to decrypt
29 * @param String $key Key or salting to be used
30 */
31 function rijndael_decrypt_file($file, $key) {
32
33 include_once(dirname(__FILE__).'/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php');
34
35 $rijndael = new Crypt_Rijndael();
36
37 $rijndael->setKey($key);
38
39 $ciphertext = file_get_contents($file);
40
41 print $rijndael->decrypt($ciphertext);
42
43 }
44