Implemented this example https://stackoverflow.com/questions/26623768/decrypting-aes-with-javascript-cryptojs-after-encrypting-with-php-mcrypt Works, but Russian characters are no longer displayed. Instead of "Example", we get "Example". Online decoders say this: CP1252-> CP1251 or ISO-8859-1 -> CP1251. Can not display Russian characters. The page itself is in windows-1251. some values ​​are encoded in JSON. PHP:

*function encrypt($content) { $key = 'key_value'; $iv = 'iv_value'; $encrypted = base64_encode( mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $content, MCRYPT_MODE_CBC, $iv ) ); return $encrypted; }* 

For JS https://code.google.com/archive/p/js-mcrypt/

 var Mdecrypt = function (data, key, iv) { return mcrypt.Decrypt(atob(data), iv, key, 'rijndael-128', 'cbc'); }; 

As a result, incomprehensible characters. Can you translate them into Russian?

  • Show your code - Dmytryk
  • As for me - it is unlikely that the problem is in the code, there is nothing here to break the Cyrillic alphabet. I would recommend checking the source code pages and the page template (where the head is). It seems to me that the question was closed may not be in vain, but the exact wording of the closure is incorrect. It seems to me that the author should look for the conditions for the reproduction of the bug - but for now, I guess for re-opening the issue. - AK

0