Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ashutosh1206
GitHub Repository: ashutosh1206/crypton
Path: blob/master/Message-Authentication-Code/CBC-MAC-Forgery/Challenges/He-Moron/source.py
1402 views
1
def sign(k, m):
2
ECB = AES.new(k, AES.MODE_ECB)
3
mb = [m[i:i + 16] for i in range(0, len(m), 16)]
4
t = ECB.encrypt(mb[0])
5
for i in range(1,len(mb)):
6
t = ECB.encrypt(strxor(mb[i], t))
7
return hexlify(t)
8
9