Jump to content


Photo

RIJINDAEL help


  • Please log in to reply
No replies to this topic

#1 werty37

werty37
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 07 June 2006 - 02:20 AM

Hi
I need some help with this script

class securedata
{
var $key = "Four score and twenty years ago";
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND);

function encrypt($STR)
{
return mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $STR, MCRYPT_MODE_CBC, $iv);
}

function decrypt($STR)
{
return mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $STR, MCRYPT_MODE_CBC, $iv);
}

}

$sd = new securedata();
$enc = $sd->encrypt('Message');
echo bin2hex($enc);
echo "<br>";
echo $sd->decrypt($enc);
?>

When i execute it, i get this error:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /var/www/emites/securedata_inc.php on line 15

Please help
Thanks in advance




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users