I'm using AES 256 to encrypt the integers in my application. When I convert encrypted text to integer it gives me too long integer like:
127510614367469717778923839884853125321
Even if the input plain text is a single digit Integer.
I'm using following code:
from Crypto.Cipher import AES
import binascii
obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
message = "0000000000000001"
ct = obj.encrypt(message)
hexa = binascii.hexlify(ct)
i = int(hexa,16)
print(i)
The output cipher text is too long. I want output cipher text as 3 or 4 digit number rather than this long numbers.
Is there any alternatives for this? Can I encrypt using AES 8 or AES 16? So that out cipher text contains less number of digits?