Skip to content

Instantly share code, notes, and snippets.

@kira924age
Last active December 31, 2017 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kira924age/d324cc66b6a92e00404656d314a4c207 to your computer and use it in GitHub Desktop.
Save kira924age/d324cc66b6a92e00404656d314a4c207 to your computer and use it in GitHub Desktop.
34C3 Junior CTF: dotr
#!/usr/bin/env python2
# coding: utf-8
import itertools
def decrypt(msg, k):
m = "*" * len(msg)
c = 0
for i in k:
for j in range(i, len(msg), 8):
m = m[:j] + msg[c] + m[j+1:]
c += 1
return m
encrypt_txt = "03_duCbr5e_i_rY_or cou14:L4G f313_Th_etrph00 Wh03UBl_oo?n07!_e"
for k in itertools.permutations(range(8)):
s = decrypt(decrypt(encrypt_txt, k), k)
if "34C3" in s:
print s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment