1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
19
20 | jpg1short = 'FF D8 FF DB'.split(' ') # ÿØÿÛ - jpg (jpeg) (raw or in the JFIF or Exif file)
jpg1long = 'FF D8 FF E0 00 10 4A 46 49 46 00 01'.split(' ') # ÿØÿà..JFIF.. - jpg (jpeg) (raw or in the JFIF or Exif file)
jpg2short = 'FF D8 FF EE'.split(' ') # ÿØÿî - jpg (jpeg) (raw or in the JFIF or Exif file)
jpg2long = 'FF D8 FF E1'.split(' ') # ?? ?? 45 78 69 66 00 00 # ÿØÿá..Exif.. - jpg (jpeg) (raw or in the JFIF or Exif file) here we have 2 unknown bytes, so we leave it short: only the first 4bytes
encrypted = 'B9 14 06 45 71 E0 B5 F7 37 07 CB 85'.split(' ') # first 12 bytes of encrypted file
j1s_xored = [ int(j1s, 16) ^ int(enc, 16) for j1s, enc in zip(jpg1short, encrypted) ]
j1l_xored = [ int(j1l, 16) ^ int(enc, 16) for j1l, enc in zip(jpg1long, encrypted) ]
j2s_xored = [ int(j2s, 16) ^ int(enc, 16) for j2s, enc in zip(jpg2short, encrypted) ]
j2l_xored = [ int(j2l, 16) ^ int(enc, 16) for j2l, enc in zip(jpg2long, encrypted) ]
print(jpg1short) # ['FF', 'D8', 'FF', 'DB']
print(jpg1long) # ['FF', 'D8', 'FF', 'E0', '00', '10', '4A', '46', '49', '46', '00', '01']
print(jpg2short) # ['FF', 'D8', 'FF', 'EE']
print(jpg2long) # ['FF', 'D8', 'FF', 'E1']print(encrypted) # ['B9', '14', '06', '45', '71', 'E0', 'B5', 'F7', '37', '07', 'CB', '85']
print(j1s_xored, ''.join( [ chr(i) for i in j1s_xored] ) ) # [70, 204, 249, 158] >as ascii> FÌù
print(j1l_xored, ''.join( [ chr(i) for i in j1l_xored] ) ) # [70, 204, 249, 165, 113, 240, 255, 177, 126, 65, 203, 132] >as ascii> FÌù¥qðÿ±~AË
print(j2s_xored, ''.join( [ chr(i) for i in j2s_xored] ) ) # [70, 204, 249, 171] >as ascii> FÌù«
print(j2l_xored, ''.join( [ chr(i) for i in j2l_xored] ) ) # [70, 204, 249, 164] >as ascii> FÌù¤ |