【问题标题】:CTF RSA decrypt using N, c, e使用 N、c、e 进行 CTF RSA 解密
【发布时间】:2020-07-08 20:10:26
【问题描述】:

如下给出N、e、c:

n = 35390004486354300347521848565413257959442624589297688131017877221807025004928966206454752329594506530598099849274956709610488234955109039874355077958460196991750855650029096905451

e = 65537

c = 34976328528100445602888072790831380493399287679380757676967266152942525578548886648293955777757882335796410272725253490310142371251759362170135820927390507970457244397459500624458

我已经尝试了几种方法来解密它,比如factordb,yafu,甚至发现了一个类似的question,它被RsaCtfTool解决了。也许我的电脑性能很差......有人可以帮忙吗?非常感谢!

【问题讨论】:

  • 我个人喜欢这些问题,它们通常对我来说很有趣。不幸的是,它们是题外话。请参阅此note 了解原因。

标签: encryption cryptography rsa ctf


【解决方案1】:

PC 的性能在这里并不是真正的问题。您的模数 n 有 179 位(594 位),这将需要  e x t r e m e l y  长时间才能在单个台式 PC 上计算。 2005 年,15.2 CPU years 分解了 176 位数字。相比之下,the question you linked to只有256位模数,用msieve之类的软件几分钟就可以破解。

你有机会解决这个问题的唯一方法是找到一条捷径。也许问题包含您忽略的其他线索。或者它可能使用了有缺陷的 RSA 实现。有关 RSA 漏洞的一般概述,我建议阅读 Dan Boneh 的 Twenty Years of Attacks on the RSA Cryptosystem。

【讨论】:

  • 感谢您的帮助!我知道分解一个大整数的难度,但是这个大数出现在一个CTF问题中。所以我认为必须有一些方法在有限的时间内破解它。最后我找到了方法。上面提到的N c e 只是一半信息,另外一半是我通过sql-injection 得到的信息,它们是N c1 e1。所以最终破解它的方法是 Common Modulus Attack....谢谢你们!
【解决方案2】:

我尝试了最新的RsaCtfTool 版本,它可以工作:

python3 ./RsaCtfTool.py -n 3539000448635430034752184856541325795944262458929768813101787722180702500492896620645475232959450653059809984927495670961048
8234955109039874355077958460196991750855650029096905451 -e 65537 --uncipher 3497632852810044560288807279083138049339928767938075767696726615294252557854888664829395577775788
2335796410272725253490310142371251759362170135820927390507970457244397459500624458

[*] Testing key /tmp/tmpimxbt566.
[*] Performing londahl attack on /tmp/tmpimxbt566.
[*] Performing mersenne_primes attack on /tmp/tmpimxbt566.
[*] Performing cube_root attack on /tmp/tmpimxbt566.
[*] Performing pollard_p_1 attack on /tmp/tmpimxbt566.
[*] Performing smallfraction attack on /tmp/tmpimxbt566.

Results for /tmp/tmpimxbt566:

Unciphered data :
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00CISCN{XXXX_XX_X_XXXXX_XXXX}\n'

(剧透:我是 RsaCtfTool 的开发者)

【讨论】:

  • 工具在成功时停止,所以它是小部分。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-04-25
  • 1970-01-01
  • 2010-11-17
  • 1970-01-01
  • 2013-11-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多