I have Encrypted a string in python using pycryptodome lib and I want to decrypt the string in react using cryptoJs, but I could not find any proper way to do that.
this is my code in python:
def encrypt_string(string):
aes = AES.new(secret_key, AES.MODE_CFB, secret_iv)
encrypted = aes.encrypt(string.encode('utf-8'))
return b64encode(encrypted).decode('utf-8')
js:
let decrypted = crypto.AES.decrypt(crypto.enc.Base64.parse(encrypted_string), key, { mode: crypto.mode.CFB, iv })
console.log(decrypted.toString(crypto.enc.Utf8)) //returns empty string
this implementation returns an empty string.