Last active
December 31, 2017 12:17
-
-
Save kira924age/d324cc66b6a92e00404656d314a4c207 to your computer and use it in GitHub Desktop.
34C3 Junior CTF: dotr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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