You can install encryption library for Javascript using the following:
npm install --save hesabe-crypt
You can also download the library files from here and use the encrypt and decrypt methods.
If you are importing the library on your own then you are required to add a CDN as well.
<script type="text/javascript"
src="https://cdn.rawgit.com/ricmoo/aes-js/e27b99df/index.js"></script>
<script>
let secret = 'XXXXX' // Secret provided by Hesabe
let ivCode = 'XXXXX' // IV provided by Hesabe
key = aesjs.utils.utf8.toBytes(secret);
iv = aesjs.utils.utf8.toBytes(ivKey);
let payment = new hesabeCrypt(key, iv);
let encrypted = payment.encryptAes('XXXX') // Ecnryption
let decrypted = payment.decryptAes(encrypted);