Skip to content

Instantly share code, notes, and snippets.

@Nicholaz99
Created August 23, 2019 14:18
Show Gist options
  • Save Nicholaz99/afad3ddbc978c4263aefad714063519f to your computer and use it in GitHub Desktop.
Save Nicholaz99/afad3ddbc978c4263aefad714063519f to your computer and use it in GitHub Desktop.
from string import ascii_lowercase as l
class CypherTable:
def __init__(self):
self.final_table = [l[i:]+l[:i] for i in range(len(l))]
ciphertext = "g4iu{ocs_oaeiiamqqi_qk_moam!}e0gi"
flag = ""
flag2 = ""
table = CypherTable().final_table
map_table = {}
map_table2 = {}
for i in range(26):
if (table[i][i] not in map_table):
map_table[table[i][i]] = table[0][i]
map_table2[table[i][i]] = table[0][i]
# print map_table
for ch in ciphertext:
if (ch in map_table):
flag += map_table[ch]
flag2 += map_table2[ch]
else:
flag += ch
flag2 += ch
print "Flag:", flag
print "Flag:", flag2
# Flag: d4rk{how_uncreative_is_that!}c0de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment