I have a javascript function which encrypt a json using AES cipher from Crypto-Js module. I want a equivalent of this function in python.
encryptAES = function(data1) {
var keyUtf8 = CryptoJS.enc.Base64.parse('1234567890=');
var ivUtf8 = CryptoJS.enc.Base64.parse('1234==');
var encrypted = CryptoJS.AES.encrypt(JSON.stringify(data1), keyUtf8, {
iv: ivUtf8,
padding: CryptoJS.pad.Pkcs7,
mode: CryptoJS.mode.CBC}).toString();
console.log('encrypted===aes=='+encrypted);
return encrypted
}`
I tried finding equivalent function in python. For starters, I tried finding equivalent of CryptoJS.enc.Base64.parse() using base64 python module. But both are returning different response.