Jump to content

RIJINDAEL help


werty37

Recommended Posts

Hi
I need some help with this script

[code]
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);
?>
[/code]

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
Link to comment
https://forums.phpfreaks.com/topic/11376-rijindael-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.