ALL the CTFS of Crypto2025 finally

This commit is contained in:
emln
2025-06-02 19:35:30 +02:00
parent aa0fe54b3b
commit 50c18f35b9
442 changed files with 1743 additions and 8 deletions

View File

@ -0,0 +1,16 @@
import ContinuedFractions, Arithmetic
from Cryptodome.Util.number import getPrime, inverse, bytes_to_long, long_to_bytes, GCD
#flag len == 23
n = 770071954467068028952709005868206184906970777429465364126693
e = 3
# ct = pow(pt, e, n)
ct = 388435672474892257936058543724812684332943095105091384265939
p = 888242373638787482012535770369
q = 866961515596671343895614356197
phi = (p - 1)*(q - 1)
d = inverse(e, phi)
#res = egcd(e, phi)
pt = pow(ct,d,n)
decrypted = long_to_bytes(pt)
print(decrypted.decode())