Tags: crypto python
Rating:
(full writeup at the link)
write a script to bruteforce:
li = dict(zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",range(26))) # letter -> integer
il = dict(zip(range(26),"ABCDEFGHIJKLMNOPQRSTUVWXYZ")) # integer -> letter
cipher = "CGULKVIPFRGDOOCSJTRRVMORCQDZG"
for i in range(1, 26):
sub = 0 # counter for what to subtract by
m = "" # message
for l in cipher:
nc = (li[l] + (i - sub)) % 26 # get integer representation of new letter
m += il[nc] # add letter to message
sub -= 1 # reduce the subtraction counter by 1
print(m)
Only reasonable answer in response is "GLASSESAREUSEFULDONOTLOSETHEM" flag is: hsctf{GLASSESAREUSEFULDONOTLOSETHEM}