Encryption

給定因子的一部分,對 RSA 模數進行因子分解

  • October 11, 2021

給出了 e,N,c 和大約 2/3 的 p,我需要得到整個 p 來解密 c。

N: 8319209622572147564013826542514259498682642243858419574823720424163091461701501360015982209990033336520746744572035014978885083880306655150878826112698449183627604378591045476163815683140601440141181336500755042065319357073688047689369842069576880590382907166998622533395350509313527264108988375924505750514907811200521771091619671861896277515872762861803861776874814818759550176763409337645914659855794895018341028254707583446748584671147839997360735893784761893682319714306096295255392779139228496862261602629668021770766403895493829479280751919607803462139336221636202936115853250410851992088076115853781819064537
e: 65537
c: 4953284236047971172578832583499377493178200304479143209550787249372461101728658773670930238470955483017914105971816965742510454042292225833646213980243990906909055183035487729211063154361995845063984656265718117973811054592839102686638618059351593068564821438986641302188691512194069434490636627580791763494578169497869477621620646090488263145323524094255076603309311346040499379850098705597815946140397825326676093352260642665202907180660054018022276329942694463490417145273018047785653000749283804947161814490990395826461165462311565059508939959327500584807568342952319675042226613334756078721555811790191840438113
p: 4657466126792836973364876345509106305470210556754730583762574018947035473615496183374863999868029162????????????????????????????????????????????????????????????????????????????????????????????????????509718954507298459183080086410468930318128642354235212531127396991917151481316220676314043160415859389810007

“?” 是缺失的數字。我已經嘗試過使用這個網站:https : //latticehacks.cr.yp.to/rsa.html 但我只收到這些數字的錯誤(為此使用了 SageMath),但該範例有效。

我做錯了什麼,誰能幫我找到獲得鑰匙的全部因素?

這裡的問題是你有一個除數 $ p $ 的 $ n $ 形式的 $$ p_h \cdot 10^{208} + p_m\cdot 10^{108} + p_l,, $$ 你知道的地方 $ p_h $ 和 $ p_l $ , 但不是 $ p_m < 10^{100} \lessapprox n^{0.16} $ .

顯然,多項式 $ f(x) = x\cdot 10^{108} + p_h \cdot 10^{208} + p_l $ 將會 $ 0 $ 模組 $ p $ 為權利 $ x = p_m $ , 已知很小。所以我們可以在這裡應用Coppersmith 定理的GCD 推廣 $ \beta \approx 0.5 $ :

sage: p_h = 4657466126792836973364876345509106305470210556754730583762574018947035473615496183374863999868029162
sage: p_l = 509718954507298459183080086410468930318128642354235212531127396991917151481316220676314043160415859389810007
sage: n = 8319209622572147564013826542514259498682642243858419574823720424163091461701501360015982209990033336520746744572035014978885083880306655150878826112698449183627604378591045476163815683140601440141181336500755042065319357073688047689369842069576880590382907166998622533395350509313527264108988375924505750514907811200521771091619671861896277515872762861803861776874814818759550176763409337645914659855794895018341028254707583446748584671147839997360735893784761893682319714306096295255392779139228496862261602629668021770766403895493829479280751919607803462139336221636202936115853250410851992088076115853781819064537
sage: P.&lt;x&gt; = Zmod(n)[]
sage: f = x*10^108 + p_h*10^208 + p_l
sage: f = (x*10^108 + p_h*10^208 + p_l)/10^108 # Make the polynomial monic
sage: f.small_roots(beta=0.49)
[4555790634870609108348440239954454001363406634260834115187291781797769149826662476501530037286859856]

引用自:https://crypto.stackexchange.com/questions/95467