YCB2021-WP

签到

简单猜谜,根据图片信息猜数字,然后把数字转为md5
28-08-30-07-04-20-02-17-23-01-12-19

BigRSA

N1,N2 取出q,p1,p2
然后求出n1,n2
给出exp

import gmpy2
from Crypto.Util.number import *
def gcd(a, b):
   if a < b:
     a, b = b, a
   while b != 0:
     temp = a % b
     a = b
     b = temp
   return a
n1=103835296409081751860770535514746586815395898427260334325680313648369132661057840680823295512236948953370895568419721331170834557812541468309298819497267746892814583806423027167382825479157951365823085639078738847647634406841331307035593810712914545347201619004253602692127370265833092082543067153606828049061
n2=115383198584677147487556014336448310721853841168758012445634182814180314480501828927160071015197089456042472185850893847370481817325868824076245290735749717384769661698895000176441497242371873981353689607711146852891551491168528799814311992471449640014501858763495472267168224015665906627382490565507927272073
c = 60406168302768860804211220055708551816238816061772464557956985699400782163597251861675967909246187833328847989530950308053492202064477410641014045601986036822451416365957817685047102703301347664879870026582087365822433436251615243854347490600004857861059245403674349457345319269266645006969222744554974358264



print "p: "+str(gcd(n1,n2))
print "q1: "+str(n1/gcd(n1,n2))
print "q2: "+str(n2/gcd(n1,n2))

p = gcd(n1,n2)
q1 = n1/gcd(n1,n2)
q2 = n2/gcd(n1,n2)
e = 65537
d1 = gmpy2.invert(e, (p-1)*(q1-1))
d2 = gmpy2.invert(e, (p-1)*(q2-1))

print(d1)
print(d2)

c_d2 = pow(c,d2,n2)
c_d1 = pow(c_d2,d1,n1)
print(long_to_bytes(c_d1))

本文链接:

https://yuno0n.top/index.php/archives/26/
1 + 9 =
快来做第一个评论的人吧~