$data = '{"message": 123}';
$secret_key = 'test';
$secret_iv = 'test;
$method = "AES-192-CBC";
$iv = substr(hash('sha256', $secret_iv), 0, 16);
$encrypted = openssl_encrypt($data, $method, $secret_key,0,$iv);
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js"></script></head>
<body>
<script>
var data = '{"message": 123}';
var secret_key = 'test';
var secret_iv = 'test';
var method = "AES-192-CBC";
var iv = CryptoJS.SHA256(secret_iv).toString().substring(0, 16);
var encrypted = CryptoJS.AES.encrypt(data, secret_key, {iv: iv, mode: CryptoJS.mode.CBC}).toString();
console.log(encrypted);
</script>
</body>
</html>
import CryptoJS from 'crypto-js';
const data = '{"message": 123}';
const secret_key = 'test';
const secret_iv = 'test';
const method = 'AES-192-CBC';
const iv = CryptoJS.SHA256(secret_iv).toString().substring(0, 16);
const encrypted = CryptoJS.AES.encrypt(data, secret_key, { iv: iv, mode: CryptoJS.mode.CBC }).toString();
console.log(encrypted);