angstromctf2021

angstrom CTF 2021 | substitution

#angstromctf2021 #!/usr/bin/python from functools import reduce with open("flag", "r") as f: key = [ord(x) for x in f.read().strip()] def substitute(value): return (reduce(lambda x, y: x * value + y, key)) % 691 print("Enter a number and i…

angstrom CTF 2021 | Home Rolled Crypto

#angstromctf2021 #!/usr/bin/python import binascii from random import choice class Cipher: BLOCK_SIZE = 16 ROUNDS = 3 def __init__(self, key): assert(len(key) == self.BLOCK_SIZE * self.ROUNDS) self.key = key def __block_encrypt(self, block…

angstrom CTF 2021 | Circle of Trust

#angstromctf2021 import random import secrets from decimal import Decimal, getcontext from Crypto.Cipher import AES BOUND = 2 ** 128 MULT = 10 ** 10 getcontext().prec = 50 def nums(a): b = Decimal(random.randint(-a * MULT, a * MULT)) / MUL…