BUUCTF RSA4&

BUUCTF RSA4

下载题目,可见文件给出了3组n和c

N = 331310324212000030020214312244232222400142410423413104441140203003243002104333214202031202212403400220031202142322434104143104244241214204444443323000244130122022422310201104411044030113302323014101331214303223312402430402404413033243132101010422240133122211400434023222214231402403403200012221023341333340042343122302113410210110221233241303024431330001303404020104442443120130000334110042432010203401440404010003442001223042211442001413004

c = 310020004234033304244200421414413320341301002123030311202340222410301423440312412440240244110200112141140201224032402232131204213012303204422003300004011434102141321223311243242010014140422411342304322201241112402132203101131221223004022003120002110230023341143201404311340311134230140231412201333333142402423134333211302102413111111424430032440123340034044314223400401224111323000242234420441240411021023100222003123214343030122032301042243

N = 302240000040421410144422133334143140011011044322223144412002220243001141141114123223331331304421113021231204322233120121444434210041232214144413244434424302311222143224402302432102242132244032010020113224011121043232143221203424243134044314022212024343100042342002432331144300214212414033414120004344211330224020301223033334324244031204240122301242232011303211220044222411134403012132420311110302442344021122101224411230002203344140143044114

c = 112200203404013430330214124004404423210041321043000303233141423344144222343401042200334033203124030011440014210112103234440312134032123400444344144233020130110134042102220302002413321102022414130443041144240310121020100310104334204234412411424420321211112232031121330310333414423433343322024400121200333330432223421433344122023012440013041401423202210124024431040013414313121123433424113113414422043330422002314144111134142044333404112240344

N = 332200324410041111434222123043121331442103233332422341041340412034230003314420311333101344231212130200312041044324431141033004333110021013020140020011222012300020041342040004002220210223122111314112124333211132230332124022423141214031303144444134403024420111423244424030030003340213032121303213343020401304243330001314023030121034113334404440421242240113103203013341231330004332040302440011324004130324034323430143102401440130242321424020323

c = 10013444120141130322433204124002242224332334011124210012440241402342100410331131441303242011002101323040403311120421304422222200324402244243322422444414043342130111111330022213203030324422101133032212042042243101434342203204121042113212104212423330331134311311114143200011240002111312122234340003403312040401043021433112031334324322123304112340014030132021432101130211241134422413442312013042141212003102211300321404043012124332013240431242

根据加密公式,可以构造出同余方程组

me = c1 (mod n1)

me = c2 (mod n2)

me = c3 (mod n3)

解这样的方程组要用到【中国剩余定理】(详细信息观看《应用密码学》书籍)

具体解题思路:

代码如下:

相关推荐
十七算法实验室1 分钟前
Matlab实现麻雀优化算法优化随机森林算法模型 (SSA-RF)(附源码)
算法·决策树·随机森林·机器学习·支持向量机·matlab·启发式算法
黑不拉几的小白兔12 分钟前
PTA部分题目C++重练
开发语言·c++·算法
迷迭所归处14 分钟前
动态规划 —— dp 问题-买卖股票的最佳时机IV
算法·动态规划
chordful35 分钟前
Leetcode热题100-32 最长有效括号
c++·算法·leetcode·动态规划
_OLi_43 分钟前
力扣 LeetCode 459. 重复的子字符串(Day4:字符串)
算法·leetcode·职场和发展·kmp
Romanticroom1 小时前
计算机23级数据结构上机实验(第3-4周)
数据结构·算法
白藏y1 小时前
数据结构——归并排序
数据结构·算法·排序算法
ahadee1 小时前
蓝桥杯每日真题 - 第12天
c++·vscode·算法·蓝桥杯
zhentiya1 小时前
微积分第五版课后习题答案详解PDF电子版 赵树嫄
算法·pdf
luky!2 小时前
算法--解决熄灯问题
python·算法