Google-table at https://docs.google.com/spreadsheets/d/1UAxqf6Ml1AHfOvpvPVEakpZeaonOdM0SP4NJjOPPfkw/edit?usp=drive_open&ouid=107698653281780380405 stores a sequence of bytes in the form is divided into cells of encrypted hexadecimal string of two digits in a string of bytes. The cipher is based on a shift, such that the numbers 0..F correspond to the characters 'a' .. 'p' (the first sixteen letters of the Latin alphabet). This hexadecimal string is a binary file, inside which the image is stored in some known format. How to get this file?

I glued all the table cells into one line and translated it into a normal hexadecimal format (maybe I’m wrong somewhere):

t='pndhhkfifkaaaaaeog.. и тд' d={ 'a':'0', 'b':'1', 'c':'2', 'd':'3', 'e':'4', 'f':'5', 'g':'6', 'h':'7', 'i':'8', 'j':'9', 'k':'a', 'l':'b', 'm':'c', 'n':'d', 'o':'e', 'p':'f', } s='' for i in tmp: s+=d[i] 

Tell me how to proceed, and in general, in that direction I'm going?

    1 answer 1

    Somehow there is not enough information about the final result, but in principle the scheme should be some such (the names of the variables left yours):

     s = ''.join([d[x] for x in t]) # получаем расшифрованную строку в соотв. со словарем s = bytes.fromhex(s) # переводим ее в шестнадцатиричный формат with open('image.ext', 'wb') as f: # и бинарно записываем это все в файл. f.write(s) 

    Your file, by the way, has a 7z archive signature at the beginning.