Jump to content

Help with decryption


tutorialstuff

Recommended Posts

This seems to work fine in IE8, but whenever I view it in FF3, There is some weird trailing characters after the decrypted text.

 

$decryption_key = "Yru8S09edICE";
$cipher_alg=MCRYPT_RIJNDAEL_256;

function hex2bin($data) {
    $len = strlen($data);
    return pack("H" . $len, $data);
} 

$iv = bin2hex(mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_CBC), MCRYPT_RAND));

$encryppted_text = mcrypt_encrypt($cipher_alg, $decryption_key, 'this is text', MCRYPT_MODE_CBC, hex2bin($iv));

print $encryppted_text."<br />";

$decrypted_text = mcrypt_decrypt($cipher_alg, $decryption_key, $encryppted_text, MCRYPT_MODE_CBC, hex2bin($iv));

print $decrypted_text;

Link to comment
https://forums.phpfreaks.com/topic/186072-help-with-decryption/
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.