[b01lers2020]safety_in_numbers

Posted p201721410013

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[b01lers2020]safety_in_numbers相关的知识,希望对你有一定的参考价值。

查看给的附件,就明白,这对公钥中,n过大,所以我们直接对c开e此方即可

aaa.py中是之前利用python写入的c

from aaa import *
import gmpy2
e = 65537
def dec(ctxt):
   c = ctxt
   eth_root = gmpy2.iroot(c, e)
   if eth_root[1] != True:
      print("not trivial RSA")
   m = int(eth_root[0])
   print(m)
   msg = (m).to_bytes(m.bit_length() // 8 + 1, byteorder = ‘little‘)
   return msg

with open("flag.enc", "rb") as f:
   ctxt = f.read()
   cc = int.from_bytes(ctxt, byteorder = ‘little‘)
print(dec(cc))

 

以上是关于[b01lers2020]safety_in_numbers的主要内容,如果未能解决你的问题,请参考以下文章

BUUCTF-[b01lers2020]Life on Mars

BUUCTF-[b01lers2020]Life on Mars

BUUCTF-[b01lers2020]Life on Mars

BUUCTF-[b01lers2020]Life on Mars

[b01lers2020]Welcome to Earth

[b01lers2020]safety_in_numbers