I have the following function that is written in php
function encrypt($string) {
//Key
$key = "key";
//Encryption
$cipher_alg = MCRYPT_TRIPLEDES;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg,MCRYPT_MODE_ECB), MCRYPT_RAND);
$encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_ECB, $iv);
return base64_encode($encrypted_string);
return $encrypted_string;
}
A desktop application uses the same scheme to decrypt the generated string.Newer versions of PHP does not support mcrypt.How can i replace this code to achieve the same result?