题目描述
The flag.zip contains the flag I am looking for but it is password protected. The password is the encrypted message which has to be correctly decrypted so I can useit to open the zip file. I tried using RSA but the zip doesn't open by it. Can you help me get the flag please?
flag.zip包含我要查找的标志,但它受密码保护。密码是加密的消息,必须正确解密,这样我才能使用它打开zip文件。我试过使用RSA,但它无法打开拉链。你能帮我取下标志吗?
Files:
题目考点
- RSA n分解
解题思路
文件a.txt的值n非常小。可以直接对该值的因子进行暴力强制,然后获得一个整数。flag.zip中唯一的文件是受密码保护的flag.txt。此文件的密码是所获得的整数。
import mod c=32949 n=64741 e=42667 p = None for i in range(2,n): if n % i == 0: p = i break q = n // p em = mod.Mod(e, (p-1) * (q-1)) d = int(1//em) cm = mod.Mod(c,n) ans = int(cm ** d) print(ans)
Flag
csictf{gr34t_m1nds_th1nk_4l1ke}