require_once('./lib/content.inc.php');
class Index extends Content{
function Index($test=''){
$this->test = $test;
}
function Display(){
echo "test = ".$this->test."<br>";
$key = "key";
$input = "Let us meet at 9 o'clock at the secret place.";
$size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CFB);
//$iv = mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);
//$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CFB), MCRYPT_DEV_RANDOM);
$iv = '01234567';
echo "size: ".$size."<br>";
echo $iv." size:".strlen($iv)."<br>";
$encrypted_data = mcrypt_cfb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_ENCRYPT,$iv);
$decrypted_data = mcrypt_cfb (MCRYPT_BLOWFISH, $key, $encrypted_data, MCRYPT_DECRYPT,$iv);
echo $input."<br>";
echo $encrypted_data."<br>";
echo $decrypted_data."<br>";
}
}