import gmpy2
from Crypto.PublicKey import RSA
from Crypto.Util.number import long_to_bytes
f = open(r"public.pem", 'r').read()
pub = RSA.importKey(f)
n, e = pub.n, pub.e
print(n)
p = 296173636181072725338746212384476813557
q = n // p
phi = (p-1) * (q-1)
c = open(r"flag.enc", 'rb').read()
d = gmpy2.invert(e, phi)
m = pow(int.from_bytes(c), int(d), n)
print(long_to_bytes(m))
easy rsa
whole 2024-08-17 00:02:34 343 0
作者:whole
3
提交0
收入相关WriteUP
-
SusCTF2017-Caesar cipher
***收费WriteUP请购买后查看,VIP用户可免费查看***
- Crypto
- 3年前
-
easy_crypto
***收费WriteUP请购买后查看,VIP用户可免费查看***
- Crypto
- 3年前
-
简单加密
***收费WriteUP请购买后查看,VIP用户可免费查看***
- Crypto
- 3年前
-
2018-鼎网杯-3-track_hacker
***收费WriteUP请购买后查看,VIP用户可免费查看***
- Crypto
- 1年前
-
强网杯-强网先锋辅助
***收费WriteUP请购买后查看,VIP用户可免费查看***
- Crypto
- 1年前
评论
yaozhiwang 9小时前
代码能执行?是不是少了点东西