I looked into mcrypt (thanks, Sgarissta) - but I haven't been able to get anywhere with it. This is what I have so far, derived from the PHP man pages:
<?PHP
/* A lot of this stuff I got from the example on PHP.net, for mcrypt_encrypt... */
$key = "fookey is good";
if($proc) {
$data = $_GET["data"];
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$foo = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_ECB, $iv);
echo $foo; //should print "This is a test..."
} else {
$text = "This is a test...";
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
echo "<a href='test2.php?proc=yes&data=$crypttext'>here</a>";
}
?>
It just prints jibberish, so my guess is that the decrypt part is broken...