seccon_2020_|_this_is_rsa

ASIS CTF Finals 2022 | bedouin

#ASIS_CTF_Finals_2022 #!/usr/bin/env python3 from Crypto.Util.number import * from secret import nbit, l, flag def genbed(nbit, l): while True: zo = bin(getPrime(nbit))[2:] OZ = zo * l + '1' if isPrime(int(OZ)): return int(OZ) p, q = [genb…

TSGCTF 2021 | Flag is Win

#TSGCTF_2021 #hakatashi require 'openssl' require 'digest' STDOUT.sync = true class OpenSSL::PKey::EC::Point def xy n = to_bn(:uncompressed).to_i mask = (1 << group.degree) - 1 return (n >> group.degree) & mask, n & mask end alias_method :…

HITCON CTF 2022 | superprime

#HITCON_CTF_2022 from Crypto.Util.number import getPrime, isPrime, bytes_to_long def getSuperPrime(nbits): while True: p = getPrime(nbits) pp = bytes_to_long(str(p).encode()) if isPrime(pp): return p, pp p1, q1 = getSuperPrime(512) p2, q2 …