prng

redpwn CTf 2021 | yahtzee

#redpwnctf2021 #!/usr/local/bin/python from Crypto.Cipher import AES from Crypto.Util.number import long_to_bytes from random import randint from binascii import hexlify with open('flag.txt','r') as f: flag = f.read().strip() with open('ke…

foobarCTF 2022 | new intern

#foobarCTF_2022 #!/usr/bin/env python3 from Crypto.Util.number import * from random import getrandbits flag = b'***********************REDACTED***********************' FLAG = bytes_to_long(flag) p = getStrongPrime(512) q = getStrongPrime(5…

HSCTF 8 | agelaius-phoeniceus

#hsctf8 from sage.all import * import random flag = open('flag.txt','rb').read() class prng: co = [random_prime(2**64-1,False,2**63) for i in range(100)] n = int(next_prime(2**64)) def __init__(self): self.s = [random.randint(1,self.n) for…

DiceCTF 2022 | rejected

#diceCTF2022 #!/usr/local/bin/python import secrets class LFSR: def __init__(self, key, taps): self._s = key self._t = taps def _sum(self, L): s = 0 for x in L: s ^= x return s def _clock(self): b = self._s[0] self._s = self._s[1:] + [self…

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…