half-gcd

BSides Ahmedabad CTF 2021 | ECC-RSA2

#bsidesahmedabadctf_2021 from Crypto.Util.number import getPrime from hashlib import sha256 import random def gen_parameters(): p = getPrime(512) q = getPrime(512) N = p * q a = -3 while True: b = random.randint(0, N) if (4*a**3 + 27*b**2)…

Ricerca CTF 2023 | RSALCG

#ricerca_ctf_2023 #RSA #Franklin-Reiter_Related_Message_Attack #half-GCD https://furutsuki.hatenablog.com/entry/2023/04/23/143704#Rotated-Secret-Analysis

diceCTF 2021 | plagiarism

#diceCTF_2021 #good_challenges_2021 Two agents, Blex and Kane, have simultaneously known very secret message and transmitted it to Center. You know following: 1) They used RSA with this public key 2) They sent exactly the same messages exc…

一変数多項式のgcd

polynomialgcd 普通にユークリッドの互除法をすれば良い def gcd(a, b): while b != 0: a, b = b, a % b return a.monic() 高次数の多項式でも早い half-GCDもあるのでそちらもつかおう