def encryption(pathname,filename):
with open(pathname+filename,"rb") as file:
    jpgdata=file.read()
print(jpgdata)

output: b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00H\x00H\x00\x00\xff\xdb\x00C\x00\x03\x02\x02\x02\x02\x02\x03\x02\x02\x02\x03\x03\x03\x03\x04\x06\x04\x04\x04\x04\x04\x08\x06\x06\x05\x06\t\x08\n\n\t\x08\t\t\n\x0c\x0f\x0c\n\x0b\x0e\x0b\t\t\r\x11\r\x0e\x0f\x10\x10\x11\x10\n\x0c\x12\x13\x12\x10\x13\x0f\x10\x10\x10\xff\xc0\x00\x0b\x08\x02\x00\x02\x00\x01\x01\x11\x00\xff\xc4\x00\x1d\x00\x00\x01\x05\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x03\x04\x06\x07\x08\x02\x01\x00\t\xff\xc4\x00M\x10\x00\x01\x03\x02\x04\x03\x05\x06\x04\x05\x02\x06\x01\x01\x04\x0b\x01\x02\x03\x11\x00\x04\x05\x12!1\x06AQ\x07\x13"aq\x142\x81\x91\xa1\xf0\x08\xb1\xc1\xd1\x15#B\xe1\xf13R\x16$Cbr\x82\xa2\x92\x17%&D\xb2\t4STcds\x83\xc2\xd2\xff\xda\x00\x08\x01\x01\x00\x00?.....

is it possible to get this in hex format, can you explain why there are special character present?

0

There are 0 best solutions below