Crypto
300 points
AlphaComplex1
Mission: Decrypt ac1.pwn.seccon.jp:31337
AlphaComplex1.zip
???
tkmru
mzyy94
idzuna
とりあえず計算を持ってくるコード
#!/usr/bin/env python
import socket
import hashlib
HOST = 'ac1.pwn.seccon.jp' # 'localhost'
PORT = 31337
s = socket.create_connection((HOST, PORT))
def getdata():
skip = 77 # skip until prefix
s.recv(skip)
prefix = s.recv(128).rstrip()
i = 0
while hashlib.sha1(prefix + str(i)).hexdigest()[:5] != "00000":
i += 1
s.send(str(i) + "\n") # request data set
dataline = s.recv(1024).splitlines()
print(dataline[0])
print(dataline[1])
s.send(str(0) + "\n")
print("C(m, y)**e = " + s.recv(1024))
if __name__=='__main__':
getdata()
こんなの書いたけど法の世界には無力
def __div__(self, other):
if isinstance(other, CZimpl):
X = other.x
Y = other.y # should be Zero
a = self.x
b = self.y
return self.C(a / X, b / X)
else:
return self.C(self.x / other, self.y / other)