Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/06/2014, 10:56
Avatar de eccorposse
eccorposse
 
Fecha de Ingreso: diciembre-2009
Ubicación: Beijing
Mensajes: 69
Antigüedad: 14 años, 4 meses
Puntos: 0
Respuesta: AES Encrypt y Decrypt

Por ejemplo, esto lo tome para hacer el ejercicio (copy/paste):

<?php
function encryptData($value){
$key = "7685647tfyr65413285746352413sgfh";
$text = "hola";
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypttext = AES_ENCRYPT($key, $text);
return $crypttext;
}

echo 'Encripted: ' . encryptData('Esto es una prueba, si Hola = c927311b8b5c31cc42c8276f714cc9d0, nos vamos de party');
?>

Esto me salta: Call to undefined function AES_ENCRYPT() in ...\test\index.php on line 28 que se refiere a:

$crypttext = AES_ENCRYPT($key, $text);