【Python】AES暗号化

from Crypto.Cipher import AES
import binascii

#print(binascii.hexlify(uuid.uuid4().bytes))

secret_key = ‘abcdefghijklmnop’
message = ‘1234567890abcdef’

crypto = AES.new(secret_key)

cipher_data = crypto.encrypt(message)

print(binascii.hexlify(bytearray(cipher_data)))

original_message = crypto.decrypt(cipher_data)
print(original_message)

Leave a Reply