I am trying to encrypt my data using pycrypto. I have written below code for that.
from Crypto.Cipher import AES
obj = AES.new('1234567891011123', AES.MODE_CBC, 'This is an IV456')
message = "Jeannine"
ciphertext1 = obj.encrypt(message)
print(ciphertext1)
message1 = "Jeannine"
ciphertext2 = obj.encrypt(message1)
print(ciphertext2)
obj2 = AES.new('1234567891011123', AES.MODE_CBC, 'This is an IV456')
dciphertext1 = obj2.decrypt(ciphertext1)
print(dciphertext1)
dciphertext2=obj2.decrypt(ciphertext2)
print(dciphertext2)
but i am getting below error
Traceback (most recent call last):
File "cipher.py", line 4, in <module>
ciphertext1 = obj.encrypt(message)
ValueError: Input strings must be a multiple of 16 in length
How can i keep control in my input string ? Input string can be of any length.