Hex Encode and Decode using Python

binascii library

import binascii

text = 'Hello'
hexStr = binascii.hexlify(text.encode('utf-8')).decode('utf-8')
print(hexStr)

text = binascii.unhexlify(hexStr).decode('utf-8')
print(text)

Leave a Comment

Cancel reply

Your email address will not be published.