Dual licensed under MIT or GPL Version 2.0 by Ben Kulbertis
A PHP library that sends "encrypted" files/data over HTTP. It encodes the data into base64, inserts a random substring in a place that you can define in the data-string, sends the data as an HTTP post request (with no dependencies such as cURL) to a desired location, and then removes the substring and decodes the data and optionally writes it back into a file on the new server.
require('/path/to/cryptomaniac.php');to the page where you are going to use Cryptomaniac.
send_file — Send a file over HTTP as "encrypted" base64
boolean send_file( string *$filename*, string *$target_url*[, int *$pass_length*[, int *$pass_location*]] )
- filename — Path to the file to be transferred.
- target_url — URL to file that is set to recieve the file.
- pass_length — The length of the substring to be inserted into the data-string (for more obfuscation).
- pass_location — Where the substring to be inserted into the data-string should be placed (for more obfuscation).
Cryptomaniac::send_file('test.txt', 'http://foobar.org/recieve.php', 12, 1);
recieve_file — Recieve a file over HTTP sent using the send_file function
mixed recieve_file( mixed *$write_to_file*[, int *$pass_length*[, int *$pass_location*]] )
- write_to_file — If not set or set as false the function will return the decrypted file-data as a string. If set as a string, it will write the data to a file using the name of the string.
- pass_length — The length of the substring that was defined in the `send_file` function corresponding to this `recieve_file`. Must be the same or the decoded data will be malformed.
- pass_location — Where the substring was inserted into the data-string as defined in the `send_file` function corresponding to this `recieve_file`. Must be the same or the decoded data will be malformed.
Cryptomaniac::recieve_file('test.txt', 12, 1);
_post_request function that sends data as an HTTP post request is a modified version of a function
written by Wez Furlong.