python
import hashlib
if __name__ == "__main__":
data = ["3295c76acbf4caaed33c36b1b5fc2cb1", "26657d5ff9020d2abefe558796b99584", "73278a4a86960eeb576a8fd4c9ec6997", "ec8956637a99787bd197eacd77acce5e", "e2c420d928d4bf8ce0ff2ec19b371514", "43ec517d68b6edd3015b3edc9a11367b", "ea5d2f1c4608232e07d3aa3d998e5135", "c8ffe9a587b126f152ed3d89a146b445", "f457c545a9ded88f18ecee47145a72c0", "072b030ba126b2f4b2374f342be9ed44", "c9e1074f5b3f9fc8ea15d152add07294", "c9e1074f5b3f9fc8ea15d152add07294", "03afdbd66e7929b125f8597834fa83a4", "03afdbd66e7929b125f8597834fa83a4", "c9e1074f5b3f9fc8ea15d152add07294", "a97da629b098b75c294dffdc3e463904", "7f39f8317fbdb1988ef4c628eba02591", "7f6ffaa6bb0b408017b62254211691b5", "7f6ffaa6bb0b408017b62254211691b5", "5ef059938ba799aaa845e1c2e8a762bd", "f7177163c833dff4b38fc8d2872f1ec6", "9f61408e3afb633e50cdf1b20de6f466",
"e369853df766fa44e1ed0ff613f563bd", "182be0c5cdcd5072bb1864cdee4d3d6e", "069059b7ef840f0c74a814ec9237b6ec", "c8ffe9a587b126f152ed3d89a146b445", "b53b3a3d6ab90ce0268229151c9bde11", "4c56ff4ce4aaf9573aa5dff913df997a", "f7177163c833dff4b38fc8d2872f1ec6", "19ca14e7ea6328a42e0eb13d585e4c22", "ec5decca5ed3d6b8079e2e7e7bacc9f2", "c0c7c76d30bd3dcaefc96f40275bdc0a", "3295c76acbf4caaed33c36b1b5fc2cb1", "a3f390d88e4c41f2747bfa2f1b5f87db", "98f13708210194c475687be6106a3b84", "4e732ced3463d06de0ca9a15b6153677", "ea5d2f1c4608232e07d3aa3d998e5135", "6f4922f45568161a8cdf4ad2299f6d23", "98f13708210194c475687be6106a3b84", "c16a5320fa475530d9583c34fd356ef5", "6ea9ab1baa0efb9e19094440c317e21b", "6ea9ab1baa0efb9e19094440c317e21b", "6f4922f45568161a8cdf4ad2299f6d23", "d1fe173d08e959397adf34b1d77e88d7", "43ec517d68b6edd3015b3edc9a11367b"]
flag=[i for i in range(45)]
for i in range(45):
for j in range(0, 256):
a_md5 = hashlib.md5()
a = str(j ^ i)
a_md5.update(a.encode('utf-8'))
xor_result = a_md5.hexdigest()
# print(xor_result)
if data[i] == xor_result:
flag[i] = chr(j)
break
for element in flag:
print(element, end='')
模块:hashlib
先将md5的text转换成字符串:a = str(j ^ i)
生成md5对象a_md5:a_md5 = hashlib.md5()
更新字符串,编码成utf-8(字节形式表示):a_md5.update(a.encode('utf-8'))
md5对象生成16进制的md5值:xor_result = a_md5.hexdigest()