CTF-little RSA

题目描述

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}
  • 8
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值