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,20 @@
from Cryptodome.Util.number import bytes_to_long, getPrime, isPrime
from secret import flag
def next_prime(p):
while True:
p = p+1
if isPrime(p):
return p
#Close numbers so n = pq = (a^2 - b^2)
p = getPrime(512)
q = next_prime(p)
n = p*q
e = 65537
print(n)
m = bytes_to_long(flag.encode())
print(pow(m, e, n))
# Output: 6050935527551872879286435303438132320371235206522153386309454075563003574208085513601683088712047065839545575185838018328585278680722907743516581002251926515439942431107279175579058554492169947477999619861085376667708820915645785930175531324659803557729379985325606597907434337006411126369816412558000016523744695558076372490838321125335259117268430036823123326565653896322404966549742986308988778274388721345811255801305658387179978736924822440382730114598169989281210266972874387657989210875921956705640740514819089546339431934001119998309992280196600672180116219966257003764871670107271245284636072817194316693323
#