I use the following script (the actual example I based mine off of)
[code=php]<?php
$key = ‘That golden key that opes the palace of eternity’;
$data = ‘2345’;
$alg = MCRYPT_BLOWFISH;
$mode = MCRYPT_MODE_CBC;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($alg,$mode),MCRYPT_DEV_URANDOM);
$encrypted_data = mcrypt_encrypt($alg, $key, $data, $mode, $iv);
$plain_text = base64_encode($encrypted_data);
echo $plain_text;
$decoded = mcrypt_decrypt($alg,$key,base64_decode($plain_text),$mode,$iv);
echo $decoded;
?>
Funny, in Firefox it adds 6 strange ? mark characters to the end of the decryption which I can’t copy and paste into here, but it kinda looks a black diamond with a white question mark inside of it.
Anyway I can get rid of that?