An update to my PHP encryption class. Despite the name, it's becoming a pretty sophisticated encyption machine. New encryption algorithms added:

The TrivialEncoderManager class has been obsoleted by TE_Machine, an abstract class with several different child classes for encoding, decoding and analysis. TE_Machine has a greatly improved parser for methods, which has made it a lot easier for me to add additional functionality such as the ability to analyse an encryption technique to see how strong it would be, and to check whether the output would be ASCII-safe. TrivialEncoderManager is still present, but is deprecated and will be removed next release.


$trivialencoder_auto = FALSE;
include 'TrivialEncoder.class.php';

$method = 'twofish "mypassword"; xor 7; vig "ace"; base64;';
$plain_text = "Test message.\n";
$encrypted_text = TE_Machine_Encoder::Go($method, $plain_text);
$decrypted_text = TE_Machine_Decoder::Go($method, $encrypted_text);
print $decrypted_text; // prints "Test message.\n"