diophantus_equation

Pell's Equation

という形のDiophantus Equation ディオファントス方程式なのでsolve_diophantine 関数を使って一般的に解ける x,y = var("x,y") solutions = solve_diophantine(x**2 - 61*y**2 == 1) xsol, ysol = solutions[0] xval, yval = xsol.subs(t=0).simplify_full(…

redpwn CTF 2021 | retrosign

#redpwnctf2021 TokyoWesterns CTF 6th 2020 | circularと全くおなじ問題設定。つまりOng-Schnorr-Shamir Digital Signature Schemeで、おなじsolverが使える #!/usr/local/bin/python from Crypto.Util.number import getPrime, bytes_to_long from Crypto.…