Score:2

Factoring a RSA modulus given parts of a Factor

vn flag

e,N,c and around 2/3 of p are given and I need to get the whole p to decrypt c.

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

"?" are the missing digits. I have already tried using this website: https://latticehacks.cr.yp.to/rsa.html but I only get errors (used SageMath for that) with those numbers but the example works.

What am I doing wrong and can anyone help me find the whole factor to get the key?

et flag
Does this answer your question? [Factoring an RSA modulus given high bits of a factor](https://crypto.stackexchange.com/questions/35829/factoring-an-rsa-modulus-given-high-bits-of-a-factor)
xXLeoXxOne avatar
vn flag
That doesnt solve it as that method/algorithm only works if you have more than the half of the factor I think (the first half). In my case, I am missing the middle of the factor so I have a third of the beginning digits and a third of the end digits.
Myria avatar
in flag
What is the number $c$?
xXLeoXxOne avatar
vn flag
c is the encrypted message
cn flag
You could take a look at the very nice tutorial [Recovering cryptographic keys from partial information, by example](https://ia.cr/2020/1506) by Gabrielle De Micheli and Nadia Heninger.
xXLeoXxOne avatar
vn flag
Thanks! It helps a little but is still pretty hard to read... My case should be for the Multivariate Coppersmith Method, right?
cn flag
I'd expect that you can use Coppersmith's method directly as there is only one chunk of bits unknown. Multivariate you need only for several chunks. I didn't work out the details, but I'd be surprised if an adaption of the ideas in sections 4.2.2 and 4.2.3 to your case wouldn't be possible.
Score:6
pe flag

The problem here is that you have a divisor $p$ of $n$ of the form $$ p_h \cdot 10^{208} + p_m\cdot 10^{108} + p_l\,, $$ where you know $p_h$ and $p_l$, but not $p_m < 10^{100} \lessapprox n^{0.16}$.

Clearly, the polynomial $f(x) = x\cdot 10^{108} + p_h \cdot 10^{208} + p_l$ will be $0$ modulo $p$ for the right $x = p_m$, which is known to be small. So we can apply here the GCD generalization of the Coppersmith theorem with $\beta \approx 0.5$:

sage: p_h = 4657466126792836973364876345509106305470210556754730583762574018947035473615496183374863999868029162
sage: p_l = 509718954507298459183080086410468930318128642354235212531127396991917151481316220676314043160415859389810007
sage: n = 8319209622572147564013826542514259498682642243858419574823720424163091461701501360015982209990033336520746744572035014978885083880306655150878826112698449183627604378591045476163815683140601440141181336500755042065319357073688047689369842069576880590382907166998622533395350509313527264108988375924505750514907811200521771091619671861896277515872762861803861776874814818759550176763409337645914659855794895018341028254707583446748584671147839997360735893784761893682319714306096295255392779139228496862261602629668021770766403895493829479280751919607803462139336221636202936115853250410851992088076115853781819064537
sage: P.<x> = 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]
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.