n=p*q*r

##ctf.show

#funnyrsa2

题目:

from secret import flag

e = 0x10001
p = getPrime(80)
q = getPrime(80)
r = getPrime(80)
n = p * q * r
m = libnum.s2n(flag)#字符串转数字字符串
c = pow(m,e,n) 
print("n =", n)
print("c =", c)
# n = 897607935780955837078784515115186203180822213482989041398073067996023639
#
c = 490571531583321382715358426750276448536961994273309958885670149895389968

1、分解n   http://factordb.com

p = 876391552113414716726089
q = 932470255754103340237147
r = 1098382268985762240184333

2、上脚本

from Crypto.Util.number import *
import gmpy2
n = 897607935780955837078784515115186203180822213482989041398073067996023639
c = 490571531583321382715358426750276448536961994273309958885670149895389968
e = 0x10001
p = 876391552113414716726089
q = 932470255754103340237147
r = 1098382268985762240184333
phi = (p - 1) * (q - 1) * (r - 1)
d = gmpy2.invert(e, phi)
m = pow(c, d, n)
print(long_to_bytes(m))#正整数转化为byte类型

3、解得:

flag{what_that_fvck_r}

 

posted @ 2022-05-09 20:12  Jjyyyyy  阅读(211)  评论(0编辑  收藏  举报