I am new in this field, Would you help me ? Each byte in my cipher text (encrypt3) is interpret as an integer between 0 to 255.For each byte Plaintext=Ciphertext -100 (mod 256). In the following code I have error: newbyte=c.to_bytes(1,byteorder=sys.byteorder,signed=False) OverflowError: can't convert negative int to unsigned Any help would be appreciated.
import sys
f=open("encrypt3.dat","rb")
s=f.read(100)
d=bytearray(s)
print (len(d))
strnew=''
newbyte=b''
for c in d :
c=c-100 % 256
newbyte=c.to_bytes(1,byteorder=sys.byteorder,signed=True)
strnew=strnew + newbyte.decode('latin1')
print(strnew)