RSA加解密过程:
1)密钥的生成
首先,选择两个互异的大素数 p 和 q (保密),计算 n = p . q (公开), ( n )=( p -1)·( q -1)(保密),选择一个随机整数 e ( 0< e < F ( n ))(公开),满足 gcd ( e ,
( n ))=1。计算 d =
mod
(n)(保密)。确定:公钥 KU ={ e , n },私钥 KR ={ d , p , q },或 KR ={ d , n }。
2)加密
已知:明文 M < n 和公钥KU ={ e , n }
计算密文:C=mod n
3)解密
已知:密文 C 和私钥 KR ={ d , p , q }。
计算明文: M = mod n
1.rsarsa
题目描述:Math is cool! Use the RSA algorithm to decode the secret message, c, p, q, and e are parameters for the RSA algorithm.
p = 9648423029010515676590551740010426534945737639235739800643989352039852507298491399561035009163427050370107570733633350911691280297777160200625281665378483
q = 11874843837980297032092405848653656852760910154543380907650040190704283358909208578251063047732443992230647903887510065547947313543299303261986053486569407
e = 65537
c = 83208298995174604174773590298203639360540024871256126892889661345742403314929861939100492666605647316646576486526217457006376842280869728581726746401583705899941768214138742259689334840735633553053887641847651173776251820293087212885670180367406807406765923638973161375817392737747832762751690104423869019034
Use RSA to find the secret message
解题过程:
根据题目可知,该题应用了RSA加密方法。
e在RSATool中需要为十六进制,所以e=10001
将RSATool中进制变为十进制,p,q,e分别填入生成n,d,如图:
可知,d的值,M = mod n ,可以通过计算得出:
5577446633554466577768879988(可以用Python中pow函数,pow(c,d,n))
所以可以得到这个题的答案为:flag{5577446633554466577768879988}