単一換字暗号

DownUnderCTF 2021 | Subsutitution Cipher 2

#joseph #downunderctf2021 from string import ascii_lowercase, digits CHARSET = "DUCTF{}_!?'" + ascii_lowercase + digits n = len(CHARSET) def encrypt(msg, f): ct = '' for c in msg: ct += CHARSET[f.substitute(CHARSET.index(c))] return ct P.<x> </x>…

DownUnderCTF 2021 | Substitution Cipher 1

#joseph #downunderctf2021 def encrypt(msg, f): return ''.join(chr(f.substitute(c)) for c in msg) P.<x> = PolynomialRing(ZZ) f = 13*x^2 + 3*x + 7 FLAG = open('./flag.txt', 'rb').read().strip() enc = encrypt(FLAG, f) print(enc) 単一換字暗号 P.<x> </x></x>…

Cyber Apocalypse 2021 | Tetris

#cyber_apocalypse_ctf_2021 # The flag consists of only uppercase ascii letters # You do have to fix up the flag format yourself import string, hashlib, itertools def clean(x): return ''.join(c for c in x.upper() if c in string.ascii_letter…