ALL the CTFS of Crypto2025 finally
This commit is contained in:
16
crypto-asimmetric/inferious_prime/attack.py
Normal file
16
crypto-asimmetric/inferious_prime/attack.py
Normal 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())
|
||||
Reference in New Issue
Block a user