on a free host there was a script with this content:

<?php function String2Hex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex .= dechex(ord($string[$i])); } return $hex; 

}

 function Hex2String($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2){ $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; } function PKCS5AddPadding($input) { $pad = strlen($input) % 16; for ($i = $pad; $i < 16; $i++) { $input .= chr(16 - $pad); } return $input; } function PKCS5RemovePadding($input) { return rtrim($input, substr($input, strlen($input) - 1, 1)); } function kn_dec($ciph,$key) { $cipherText = base64_decode($ciph); $plainText = PKCS5RemovePadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key, $cipherText, MCRYPT_MODE_CBC)); return $plainText; } function kn_enc($plai,$key) { $plainText = $plai; $cipherText = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, PKCS5AddPadding($plainText), MCRYPT_MODE_CBC); $cipherText = base64_encode($cipherText); return $cipherText; } if (isset($_POST['te'])) { die(String2Hex(kn_enc($_POST['te'],'!(*@&#^$%!&%^&*@'))); } else if (isset($_POST['td'])) { die(kn_dec(Hex2String($_POST['td']),'!(*@&#^$%!&%^&*@')); } 

Its purpose is to encrypt and decrypt text. The script worked fine, but today I started issuing an empty response.

Transfer the script to your server, there is nothing in the logs. I think this is related to the mCrypt versions, maybe, who faced?

    1 answer 1

    By the way, about mcrypt() : https://dotdev.co/upcoming-changes-in-php-7-1-76ebea53b820#.mmbyk76xk

    Short content:

    Due to the fact that the library is not supported and contains many bugs, it was decided that since PHP 7.1 it is DEPRECATED, and will be removed in subsequent versions. So, if you plan to upgrade to new versions of the language, this is another one of the things that should be checked for backward compatibility with your project.