I am trying to run the following code:
from Cryptodome.Cipher import AES
key = '0123456789abcdef'
IV='0123456789abcdef'
mode = AES.MODE_CBC
encryptor = AES.new(key, mode,IV=IV)
text = 'hello'
ciphertext = encryptor.encrypt(text)
But I am getting the following error:
Traceback (most recent call last):
File "F:/Python Scripts/sample.py", line 8, in <module>
ciphertext = encryptor.encrypt(text)
File "F:\Python Scripts\Crosspost\venv\lib\site-packages\Cryptodome\Cipher\_mode_cbc.py", line 178, in encrypt
c_uint8_ptr(plaintext),
File "F:\Python Scripts\Crosspost\venv\lib\site-packages\Cryptodome\Util\_raw_api.py", line 145, in c_uint8_ptr
raise TypeError("Object type %s cannot be passed to C code" % type(data))
TypeError: Object type <class 'str'> cannot be passed to C code