from os import urandom as ua from Crypto.Util.number import *
magic=32805
defcalc(m,p): res=0 lens=hlen(p) for i in bin(m)[2:]: res*=2 res^=m if i=='1'else0 res^=p if hlen(res) == lens else0 return res
defcheck(s): for i in s: if i notin"flag{0123456789bcde-_}\x00": returnFalse returnTrue
flags=[3723147309,8016759097521062564,267529443716352603115102819467183104162,110068498753042154535753131190467876514149603112955078214309283006458454378660] FLAG="" r = 2 for flag in flags: r*=2 whileTrue: flag=calc(flag,magic + (1<<r*8)) if check(long_to_bytes(flag)[:10]): FLAG+=(long_to_bytes(flag)) print FLAG break