2
I have a PHP function that uses mcrypt. The problem is that PHP 7.2 no longer accepts mcrypt... Does anyone know how to redo it to get the same result using Openssl?
function Encript($Val, $chave){
$cifrado = MCRYPT_RIJNDAEL_256;
$modo = MCRYPT_MODE_ECB;
$Cript = mcrypt_encrypt($cifrado, $chave, $Val, $modo, mcrypt_create_iv(mcrypt_get_iv_size($cifrado, $modo), MCRYPT_DEV_RANDOM));
return base64_encode($Cript);
}
function Decript($Val, $chave){
$Base = base64_decode($Val);
$cifrado = MCRYPT_RIJNDAEL_256;
$modo = MCRYPT_MODE_ECB;
return mcrypt_decrypt($cifrado, $chave, $Base, $modo, mcrypt_create_iv(mcrypt_get_iv_size($cifrado, $modo), MCRYPT_DEV_RANDOM));
}
I could have just said, but all right, it went unnoticed.
– Jerfeson Guerreiro
See if the change meets what you wanted.
– Jerfeson Guerreiro