Convert or

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#!

/usr/bin/python
def ath(msg):
s = ord(msg[0])
for i in range(1,len(msg)):
s=s*256+ord(msg[i])
return hex(s)
def hta(n):
n = n[2:]
if 'L'==n[len(n)-1]:
n = n[:len(n)-1]
l = len(n)
s = ""
if 0!=l%2:
n = "0"+n
for i in range(len(n)/2):
t = n[i*2:i*2+2]
num = int(t[0],16)*16+int(t[1],16)
s=s+chr(num)
return s
m1 = "attack at dawn"
c1 = "0x09e1c5f70a65ac519458e7e53f36L"
k = long(ath(m1),16)^long(c1,16)
m2 = "attack at dusk"
c2 = long(ath(m2),16)^k
print hex(c2)

You might also like