This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const crypto = require('crypto'); | |
const AES_METHOD = 'aes-256-cbc'; | |
const IV_LENGTH = 16; // For AES, this is always 16, checked with php | |
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters) | |
function encrypt(text, password) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Library; | |
use function bin2hex; | |
use function hex2bin; | |
use function openssl_decrypt; | |
use function openssl_encrypt; | |
/** |