leak_d的题目与预期解

This commit is contained in:
2023-08-31 13:39:08 +08:00
parent 79965ab472
commit 149f1f51c2
2 changed files with 86 additions and 0 deletions

18
crypto/leak_d/crack.py Normal file
View File

@@ -0,0 +1,18 @@
from Crypto.Util.number import * # type: ignore
from pwn import * # type: ignore
r = remote("localhost",10001)
r.recvline()
n = r.recvline()
n = int(n.decode())
r.recvline()
c = r.recvline()
c = int(c.decode())
r.recvline()
d = r.recvline()
d = int(d.decode())
m = pow(c, d, n)
print(long_to_bytes(m))