<?php
function decrypt($value)
{
global $LICENSE_KEY;
$key = substr(md5($_SERVER['REMOTE_ADDR']), 0, 6);
if(function_exists("mcrypt_ecb"))
{
return mcrypt_ecb(MCRYPT_3DES, $key, $value, MCRYPT_DECRUPT);
}
else return $value;
}
// Расштфровка кукисов с использованием ключа
function encrypt($value)
{
global $LICENSE_KEY;
$key = substr(md5($_SERVER['REMOTE_ADDR']), 0, 6);
if(function_exists("mcrypt_ecb"))
{
return mcrypt_ecb(MCRYPT_3DES, $key, $value, MCRYPT_ENCRYPT);
}
else return $value;
}
?>
mcrypt_ecb
(PHP 4, PHP 5)
mcrypt_ecb — Obsoleto: Encripta/decripta datos en modo ECB
Descripción
string mcrypt_ecb
( int $cipher
, string $key
, string $data
, int $mode
)
string mcrypt_ecb
( string $cipher
, string $key
, string $data
, int $mode
[, string $iv
] )
El primer prototipo es cuando está enlazado con libmcrypt 2.2.x, el segundo cuando está enlazado con libmcrypt 2.4.x o superiores. El parámetro mode debería estar presente tanto en MCRYPT_ENCRYPT como en MCRYPT_DECRYPT.
Esta función está obsoleta y ya no debería ser utilizada, véase mcrypt_generic() y mdecrypt_generic() para reemplazos.
andry at zionit dot ru
26-Aug-2007 12:52
