Decrypting should work as written in http://de3.php.net/manual/
/* Open module, and create IV */
$td = mcrypt_module_open('triple
$key = substr($key, 0, mcrypt_enc_get_key_size($t
$iv_size = mcrypt_enc_get_iv_size($td
$iv = mcrypt_create_iv($iv_size,
/* Initialize encryption handle */
if (mcrypt_generic_init($td, $key, $iv) != -1) {
$p_t = mdecrypt_generic($td, $c_t);
/* Clean up */
mcrypt_generic_deinit($td)
mcrypt_module_close($td);
}
Main Topics
Browse All Topics





by: slyongPosted on 2007-01-07 at 14:24:27ID: 18263427
http://au.php.net/manual/e n/function .mcrypt-de crypt.php
XTEA, MCRYPT_MODE_ECB); MCRYPT_RAND);
, $key, $text, MCRYPT_MODE_ECB, $iv);
MCRYPT_RAND);
, $key, $enc, MCRYPT_MODE_ECB, $iv);
at the bottom of the pages:
<?php
$text = "boggles the inivisble monkey will rule the world";
$key = "This is a very secret key";
$iv_size = mcrypt_get_iv_size(MCRYPT_
$iv = mcrypt_create_iv($iv_size,
echo strlen($text) . "<br>";
$enc = mcrypt_encrypt(MCRYPT_XTEA
echo strlen($enc) . "<br>";
$iv = mcrypt_create_iv($iv_size,
$key = "This is a very secret key";
$text = "Meet me at 11 o'clock behind the monument.";
echo strlen($text) . "<br>";
$crypttext = mcrypt_decrypt(MCRYPT_XTEA
echo "$crypttext<br>";
?>