Reputation: 11
Traceback (most recent call last): File "xopa.py", line 413, in Main() File "xopa.py", line 410, in Main XOR(args[0], args[1], options) File "xopa.py", line 364, in XOPA print('Key (hex): 0x%s' % binascii.b2a_hex(result.key)) TypeError: a bytes-like object is required, not 'str'
ord()
function because I thought its deprecatedThe line which error shows is below
print('Key (hex): 0x%s' % binascii.b2a_hex(result.key))
Upvotes: 0
Views: 366
Reputation: 604
According to the official documentation the input for binascii.b2a_hex(result.key)
is a byte object, not a string.
You can try this instead :
print('Key (hex): 0x%s' % binascii.b2a_hex(b(result.key)))
or
print('Key (hex): 0x%s' % binascii.b2a_hex((result.key).encode()))
Upvotes: 0