I have a hex value that I'm grabbing from a text file, then I'm passing it to a2b_hex to convert it to the proper binary representation. Here is what I have:
k = open('./' + basefile + '.key', 'r')
k1 = k.read()
k.close()
my_key = binascii.a2b_hex(k1)
When I print k1, it is as expected: 81e3d6df
Here is the error message:
Traceback (most recent call last):
File "xor.py", line 26, in <module>
my_key = binascii.a2b_hex(k1)
TypeError: Odd-length string
Any suggestions? Thanks!