题目+翻译:
Math is cool! Use the RSA algorithm to decode the secret message, c, p, q, and e are parameters for the RSA algorithm.
数学很酷!使用RSA算法解码秘密消息,其中c、p、q和e是RSA算法的参数。
p = 9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483
q = 11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407
e = 65537
c = 83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034
Use RSA to find the secret message
使用RSA算法找出秘密消息。
读题:(N,d)是私钥,(N,e)是公钥,公钥加密,私钥解密,c是密文,求明文
————————————————基础知识回顾—————————————————————
p , q 是任选大素数
n=p*q φ(n) =(p-1)*(q-1)
e*d=1modφ(n) (e*d)modφ(n)=1
加密:Sig(x)=x^e mod n
解密:x=Sig(x)^d mod n
———————————————————————————————————————————
本题答案为:flag{5577446633554466577768879988}
第一步:求n,n=p*q
N=114573516752272714750064227635008832737477859608443481000717283425702025029279291376859256856603741797722497252841363753834114679306784379319341824813349417007577541466886971550474580368413974382926969910999462429631003527365143148445405716553105750338796691010126879918594076915709977585368841428779903869581
第二步:求φ(n):φ(n) = (p - 1) * (q - 1)
φ=114573516752272714750064227635008832737477859608443481000717283425702025029279291376859256856603741797722497252841363753834114679306784379319341824813349395484310674476074262867516991704330586676279176131878754135601460783229276940745427904455048854467754090254652258775177617277116136508905378817444751921692
第三步:求私钥指数(d):(e*d)modφ(n)=1
d=56632047571190660567520341028861194862411428416862507034762587229995138605649836960220619903456392752115943299335385163216233744624623848874235303309636393446736347238627793022725260986466957974753004129210680401432377444984195145009801967391196615524488853620232925992387563270746297909112117451398527453977
这个d超难算,一般电脑带不动,如果非要自己算的话,可以使用python去算,建议先安装一个gmpy2的库,具体安装详情请见:(173条消息) gmpy2的安装(python)_gmpy2安装_oooooooohhhhh的博客-优快云博客
第四步:解密消息(M):M = c^d mod n
m=5577446633554466577768879988
So,答案为:flag{5577446633554466577768879988}