print('For there are three that bear record in heaven, the Father, the Word, and the Holy Ghost') print('But here we have four cases bearing witness')
defi_pow(n): if n % 4 == 0: # as the 40 days of flood return'1' elif n % 4 == 1: # as the 1 true God return'i' elif n % 4 == 2: # as the 2 tablets of stone return'-1' elif n % 4 == 3: # as the 3 days in the tomb return'-i'
inp = input("wash away your sins: ") assertall(i in"i0123456789+-*%/^=<>~&|:()[]'"for i in inp), "invalid char" assertlen(inp) < 16, "too long" R = eval(f"lambda i: {inp}", {}, {}) assertall(R(i) == i_pow(i) for i inrange(int.from_bytes(b'The_adwa_shall_forgive_thee') // 2**195)) print(flag)
defcomplex_pow(c, exp, n): result = Complex(1, 0) while exp > 0: if exp & 1: result = result * c result.re = result.re % n result.im = result.im % n c = c * c c.re = c.re % n c.im = c.im % n exp >>= 1 return result
bits = 128 p = getPrime(1024) q = getPrime(1024) n = p * q m = Complex(getRandomRange(1, n), getRandomRange(1, n)) e = 3 c = complex_pow(m, e, n) print(f"n = {n}") print(f"mh = {(m >> bits << bits).tolist()}") print(f"C = {c.tolist()}") print(f"enc = {ChaCha20.new(key=hashlib.sha256(str(m.re + m.im).encode()).digest(), nonce=b'Pr3d1ctmyxjj').encrypt(flag)}")
''' n = 24240993137357567658677097076762157882987659874601064738608971893024559525024581362454897599976003248892339463673241756118600994494150721789525924054960470762499808771760690211841936903839232109208099640507210141111314563007924046946402216384360405445595854947145800754365717704762310092558089455516189533635318084532202438477871458797287721022389909953190113597425964395222426700352859740293834121123138183367554858896124509695602915312917886769066254219381427385100688110915129283949340133524365403188753735534290512113201932620106585043122707355381551006014647469884010069878477179147719913280272028376706421104753 mh = [3960604425233637243960750976884707892473356737965752732899783806146911898367312949419828751012380013933993271701949681295313483782313836179989146607655230162315784541236731368582965456428944524621026385297377746108440938677401125816586119588080150103855075450874206012903009942468340296995700270449643148025957527925452034647677446705198250167222150181312718642480834399766134519333316989347221448685711220842032010517045985044813674426104295710015607450682205211098779229647334749706043180512861889295899050427257721209370423421046811102682648967375219936664246584194224745761842962418864084904820764122207293014016, 15053801146135239412812153100772352976861411085516247673065559201085791622602365389885455357620354025972053252939439247746724492130435830816513505615952791448705492885525709421224584364037704802923497222819113629874137050874966691886390837364018702981146413066712287361010611405028353728676772998972695270707666289161746024725705731676511793934556785324668045957177856807914741189938780850108643929261692799397326838812262009873072175627051209104209229233754715491428364039564130435227582042666464866336424773552304555244949976525797616679252470574006820212465924134763386213550360175810288209936288398862565142167552] C = [5300743174999795329371527870190100703154639960450575575101738225528814331152637733729613419201898994386548816504858409726318742419169717222702404409496156167283354163362729304279553214510160589336672463972767842604886866159600567533436626931810981418193227593758688610512556391129176234307448758534506432755113432411099690991453452199653214054901093242337700880661006486138424743085527911347931571730473582051987520447237586885119205422668971876488684708196255266536680083835972668749902212285032756286424244284136941767752754078598830317271949981378674176685159516777247305970365843616105513456452993199192823148760, 21112179095014976702043514329117175747825140730885731533311755299178008997398851800028751416090265195760178867626233456642594578588007570838933135396672730765007160135908314028300141127837769297682479678972455077606519053977383739500664851033908924293990399261838079993207621314584108891814038236135637105408310569002463379136544773406496600396931819980400197333039720344346032547489037834427091233045574086625061748398991041014394602237400713218611015436866842699640680804906008370869021545517947588322083793581852529192500912579560094015867120212711242523672548392160514345774299568940390940653232489808850407256752] enc = b'\x9c\xc4n\x8dF\xd9\x9e\xf4\x05\x82!\xde\xfe\x012$\xd0\x8c\xaf\xfb\rEb(\x04)\xa1\xa6\xbaI2J\xd2\xb2\x898\x11\xe6x\xa9\x19\x00pn\xf6rs- \xd2\xd1\xbe\xc7\xf51.\xd4\xd2 \xe7\xc6\xca\xe5\x19\xbe' '''
defnext(self): x = random.randint(self.a, self.b) random.seed(x ** 2 + 1) return x defround(self, k): for _ inrange(k): x = self.next() return x
defencrypt(msg, a, b): c = [(a * table.index(m) + b) % 19198111for m in msg] return c
seed = int(input('give me seed: ')) prng = PRNG(seed) a = prng.round(r.randrange(2**16)) b = prng.round(r.randrange(2**16)) enc = encrypt(flag, a, b) print(enc)