I am modifying a python script. There is a function that decode a string, but it gives me the error that the data passed to decrypt isn't a multiple of 8. I tried to add it the bytes it needs, but after i don't know how to remove them before return the object.
This is the function:
def plain(value, key):
length = 8 - (len(value) % 8)
value += chr(length)*length
obj= Crypto.Cipher.Blowfish.new(
key, Crypto.Cipher.Blowfish.MODE_ECB).decrypt(
value.decode('string_escape'))
return obj
I can't change the mode of decrypt because the date it's cripted by another script of which I haven't the sources.
How can I return the correct obj without the extra bytes that I added before the decript?
Thanks a lot :)