def calc(): with open("Flag.txt", 'rb') as f: data = f.readlines() res = [] for line in data[:4785]: cnt = 0 for item in line: if item == 0: cnt += 1 res.append(cnt) for item in res: # print(dict[str(item)], end="") print(item, end=' ') # print(len(res)) # print(res)
def solve(): with open("Flag.txt", 'rb') as f: data = f.read().replace(b'\x00', b' ') with open("hex.txt", "wb") as f: f.write(data)
defaes_CBC_Decrypt(data, key, iv): # CBC模式的解密函数,data为密文,key为16字 节密钥 aes = AES.new(key=key, mode=AES.MODE_CBC, iv=iv) # 创建解密对象 # decrypt AES解密 B64decode为base64 转码 result = aes.decrypt(data) result = unpad(result) # 除去补16字节的多余字符 return result # 以字符串的形式返回
defforce(data, key): f = base64.b64decode(data) keys = open("shiro_keys.txt", "r").read().split("\n") keyb = base64.b64decode(key) iv = f[:16] enc = f[16:] de = aes_CBC_Decrypt(enc, keyb, iv) return de
data = "PGBTg3fqmEIidH1E+Fz7zVBJC4KTR5RmTmyZCUX1g8gK13Bt7GQaFr7Wh1kL+hCDTq9Vff4kcaITiLxPYsj8dCtR2SzEdQeP4jIY2Z3siUdZk2FMeSxEbt/4hzY5bmLUVKQh97Gu948+CKE9RsV+Gf7BltkNXOaim8OCv409wil2Ck4zXO7tnbWOiD6p4ZsQ2hzG8iFl/UlmaqpdUuS49kZ6BDbqp3dYqZ16+u2TNIb/jEkMMVX9X0bn4a9adFzeyCJQAFu0VrgDB/cpyvvwPAmDkKwvBdj8wWSB0ztuo6x+vrOKDNrxLITG0sxKrKlKIsZAt83lCbhiSYd8mgUtPiNkznWYxO07mRaNFWBNiNyGeg0vPNyh/NDF6e0JMkQQ6a77Otq0+Gnx7H/zYTBlxF+Id8b1T2XCQHSfkivOpERR53d23HSTsWeuFZB0Yqq8mgLdfIk7hOYTuTFqwkh0wfguA0gW63ixU8cno/3tP1JJqkcpo81eWhY2O/FPQw3jKyk5MfRE77i4NVtSTzMZ9ebKlYw/2fjPIydKI2nS/vsNGM1ebkKFbmwrdXYaIJIXMXRNEUYRfHOXgY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