Skip to content

Instantly share code, notes, and snippets.

# Pure python AES128 implementation
# SciresM, 2017
from struct import unpack as up, pack as pk
def sxor(s1, s2):
'''Xors two strings.'''
assert(len(s1) == len(s2))
return ''.join([chr(ord(x) ^ ord(y)) for x,y in zip(s1, s2)])
class AESCBC: