Feb-21-2020, 12:07 PM
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
This is a 32 byte plaintext from a file where each byte are encoded and represents 2 hexadecimals and i want to convert it to hexadecimal integers like this: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
i have been struggling for a while with this and given hits about using functions: hex(), open(), file.read(), string.decode(), map(), ord()
This is how for i gotten and would appreciate any help
This is a 32 byte plaintext from a file where each byte are encoded and represents 2 hexadecimals and i want to convert it to hexadecimal integers like this: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
i have been struggling for a while with this and given hits about using functions: hex(), open(), file.read(), string.decode(), map(), ord()
This is how for i gotten and would appreciate any help
key = open('testKey') getKey = key.read() print(getKey) integerKey = int(getKey,16) hexKey = hex(integerKey) for i in hexKey: print(ord(i), end=" , ") # test = map(integerKey, hexKey) print(getKey) print(integerKey) # print(list(test))