R
R
Roman Sarvarov2021-07-22 10:53:54
PHP
Roman Sarvarov, 2021-07-22 10:53:54

How to rewrite mcrypt_decrypt function under PHP 7.4?

The mcrypt_decrypt function has been deprecated since php 7.1.

private function decode3DES($enc_str)
{
    $key_hex = pack('H*', $this->secretKey);
    $data_hex = pack('H*', $enc_str);

    return mcrypt_decrypt(MCRYPT_3DES, $key_hex, $data_hex, MCRYPT_MODE_ECB);
}


How can I make it work on later versions of PHP?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question