seccon_ctf_2022_quals

SECCON CTF 2022 Quals | janken vs kurenaif

#SECCON_CTF_2022_Quals import os import signal import random import secrets FLAG = os.getenv("FLAG", "fake{cast a special spell}") def janken(a, b): return (a - b + 3) % 3 signal.alarm(1000) print("kurenaif: Hi, I'm a crypto witch. Let's a…

SECCON CTF 2022 Quals | this is not lsb

#SECCON_CTF_2022_Quals #kurenaif from Crypto.Util.number import * from flag import flag p = getStrongPrime(512) q = getStrongPrime(512) e = 65537 n = p * q phi = (p - 1) * (q - 1) d = pow(e, -1, phi) print(f"n = {n}") print(f"e = {e}") pri…

SECCON CTF 2022 Quals | Witche's symmetric exam

#SECCON_CTF_2022_Quals #kurenaif from Crypto.Cipher import AES from Crypto.Random import get_random_bytes from Crypto.Util.Padding import pad, unpad from flag import flag, secret_spell key = get_random_bytes(16) nonce = get_random_bytes(16…

SECCON CTF 2022 Quals | BBB

#SECCON_CTF_2022_Quals #xornet from Crypto.Util.number import bytes_to_long, getPrime from random import randint from math import gcd from secret import FLAG from os import urandom assert len(FLAG) < 100 def generate_key(rng, seed): e = rn…

SECCON CTF 2022 Quals | insufficient

#SECCON_CTF_2022_Quals #xornet from random import randint from Crypto.Util.number import getPrime, bytes_to_long from secret import FLAG # f(x,y,z) = a1*x + a2*x^2 + a3*x^3 # + b1*y + b2*y^2 + b3*y^3 # + c*z + s mod p def calc_f(coeffs, x,…

SECCON CTF 2022 Quals | pqpq

#SECCON_CTF_2022_Quals #kurenaif from Crypto.Util.number import * from Crypto.Random import * from flag import flag p = getPrime(512) q = getPrime(512) r = getPrime(512) n = p * q * r e = 2 * 65537 assert n.bit_length() // 8 - len(flag) > …