#!/usr/bin/env python3 """ We seeded Python's random module with a number we picked. We then asked it for a few things we didn't really need. And then, finally, we asked it for the primes. What could go wrong. """ import random from Crypto.Util.number import bytes_to_long, isPrime def next_prime(x): while not isPrime(x): x += 1 return x random.seed(2024) junk = [] junk.append(random.randint(0, 1000)) # 1 junk.append(random.random()) # 2 junk.append(random.choice([1, 2, 3, 4, 5])) # 3 junk.append(random.randint(10**6, 10**7)) # 4 junk.append(random.random()) # 5 junk.append(random.randint(0, 999)) # 6 junk.append(random.choice("abcdef")) # 7 junk.append(random.random()) # 8 junk.append(random.randint(0, 100)) # 9 cand_p = random.getrandbits(512) # 10 p = next_prime(cand_p | 1) cand_q = random.getrandbits(512) # 11 q = next_prime(cand_q | 1) n = p * q e = 65537 flag = b"CrypteraCTF{REDACTED_REDACTED_REDACTED}" m = bytes_to_long(flag) if __name__ == "__main__": print("n =", 81291432647064137396378019368382999331999771937496195144098292201952226622349781782859444740527650754933554354523894188748625020469970215490496116681655418012717245427188430369982204703950758974421139126275789381717936597499956660035555189428346709927126076236988082073685060427106146307873372333123130926409) print("e =", 65537) print("c =", 75718852112944964578275013623210607460732865035668524533801215012926682205648687437523472705814355128085063994630168739598046797215607660142788880064051733937554502088134634984801686487253031164647641459555839397349501204359746412022334766171296363217755607426460235861848528549934729471344947361036013643533)