Skip to content

Instantly share code, notes, and snippets.

@Mcilie
Created April 8, 2019 13:21
Show Gist options
  • Save Mcilie/91da13120296fda805a869adff5cbb29 to your computer and use it in GitHub Desktop.
Save Mcilie/91da13120296fda805a869adff5cbb29 to your computer and use it in GitHub Desktop.
areeb comprehend pls
m = 'tjctf{?????????????????}'.lower()
k = 'm???????'.lower()
f = [[ord(k[a]) ^ ord(m[a+b]) for a in range(8)] for b in range(0, len(m), len(k))]
print("F",f)
g = [a for b in f for a in b]
print("G",g)
h = [[g[a] for a in range(b, 24, 8)] for b in range(8)]
print("h",h)
i = [[h[b][a] ^ ord(k[a]) for a in range(3)] for b in range(8)]
print("i",i)
print(str([a + 109 for b in i for a in b])[1:-1] + ',', sum([ord(a) for a in m])) #figured output
# 225, 228, 219, 223, 220, 231, 205, 217, 224, 231, 228, 210, 208, 227, 220, 234, 236, 222, 232, 235, 227, 217, 223, 234, 2613
#m was originally 24 english characters
# k was originall 8 characters
#reverse this algorithm to find K, then Find M (which is the flag you need to get for points) by looking at the original output above
l = "225, 228, 219, 223, 220, 231, 205, 217, 224, 231, 228, 210, 208, 227, 220, 234, 236, 222, 232, 235, 227, 217, 223, 234".split(", ")
l = [int(op)-109 for op in l]
lista = []
for op in range(0,len(l), 3):
lista.append(l[op:op+3])
l = list(lista)
lo = list(l)
print(l)
for op in range(len(l)):
for op2 in range(3):
if op2==0:
lo[op][op2] = l[op][0]^109
print(l, lo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment