0


基于Python 的AES CMAC

from itertools import product

from Crypto.Hash import CMAC
from Crypto.Cipher import AES

from binascii import hexlify, unhexlify

secret = b'55555555555555555555555555555555'

print(secret)

cobj = CMAC.new(secret, ciphermod=AES)

result=cobj.update(b'037278FF0280020EBE')

print(result)

print (cobj.hexdigest())

#secret= unhexlify('2b7e151628aed2a6abf7158809cf4f3c')
secret= unhexlify('31313232333334343535363637373838')

message = unhexlify('31323334353637383132333435363738')

c = CMAC.new(secret,message,ciphermod=AES)
print( c.hexdigest())


本文转载自: https://blog.csdn.net/Jinglebin/article/details/121608568
版权归原作者 Jinglebin 所有, 如有侵权,请联系我们删除。

“基于Python 的AES CMAC”的评论:

还没有评论