fix: update aes

This commit is contained in:
2023-10-16 19:32:37 +08:00
parent 597a62998b
commit 0225398727
4 changed files with 22 additions and 13 deletions

View File

@@ -38,12 +38,11 @@ class Task(socketserver.BaseRequestHandler):
data = self.recv(prompt=b'')
data = b'cqupt'+ data + flag
# len(flag) == 21
# wordlist = b'123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM{}_'
# wordlist = b'0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM{}_'
if len(data)%16 != 0:
pad = b'0' * (16 - len(data)%16)
data = data + pad
cipher = aes.encrypt(data)
print(aes.decrypt(cipher))
cipher = base64.b64encode(cipher)
self.send(cipher)