Send "encrypted" files over HTTP and decrypt them.
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.markdown
cryptomaniac.php

README.markdown

Cryptomaniac

License:

Dual licensed under MIT or GPL Version 2.0 by Ben Kulbertis

Description:

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.

Requirements:

PHP 5

Usage:

  1. Add require('/path/to/cryptomaniac.php'); to the page where you are going to use Cryptomaniac.
  2. Use Cryptomaniac::send_file() and Cryptomaniac::recieve_file() at will!

Functions:

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).
Example:
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.
Example:
Cryptomaniac::recieve_file('test.txt', 12, 1);

Attribution:

The private _post_request function that sends data as an HTTP post request is a modified version of a function written by Wez Furlong.

More Help/Questions:

ben@kulbertis.org