Jump to content


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



Recommended Posts

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

Share this post

Link to post
Share on other sites


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.