Upper bounds on difference of RSA primes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I was wondering whether given a concrete $N = p cdot q$ whether we can find a upper bound on $Delta = | p - q|$ as function of $N$ e.g, $N^delta$, and thus test whether a given $N$ is vulnerable to Fermat-Factoring?










share|improve this question























  • Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
    – kelalaka
    4 hours ago










  • @kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
    – Marc Ilunga
    3 hours ago














up vote
3
down vote

favorite












I was wondering whether given a concrete $N = p cdot q$ whether we can find a upper bound on $Delta = | p - q|$ as function of $N$ e.g, $N^delta$, and thus test whether a given $N$ is vulnerable to Fermat-Factoring?










share|improve this question























  • Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
    – kelalaka
    4 hours ago










  • @kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
    – Marc Ilunga
    3 hours ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I was wondering whether given a concrete $N = p cdot q$ whether we can find a upper bound on $Delta = | p - q|$ as function of $N$ e.g, $N^delta$, and thus test whether a given $N$ is vulnerable to Fermat-Factoring?










share|improve this question















I was wondering whether given a concrete $N = p cdot q$ whether we can find a upper bound on $Delta = | p - q|$ as function of $N$ e.g, $N^delta$, and thus test whether a given $N$ is vulnerable to Fermat-Factoring?







rsa factoring number-theory






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago









SEJPM♦

27.6k451130




27.6k451130










asked 4 hours ago









Marc Ilunga

262




262











  • Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
    – kelalaka
    4 hours ago










  • @kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
    – Marc Ilunga
    3 hours ago
















  • Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
    – kelalaka
    4 hours ago










  • @kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
    – Marc Ilunga
    3 hours ago















Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
– kelalaka
4 hours ago




Marc, are trying to say; in case of security, what are the bound of the difference $ a < |p-q| < b$
– kelalaka
4 hours ago












@kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
– Marc Ilunga
3 hours ago




@kelalaka, Yes I am wondering if it is possible to detect unsafe primes for RSA. "IF" it ever happens and in a way that It can be factored using Fermat's method.
– Marc Ilunga
3 hours ago










1 Answer
1






active

oldest

votes

















up vote
4
down vote













Given that $p$ and $q$ are prime, they must be at least $2$, so $|p-q| le frac 12N - 2$. I'm pretty sure that's the only hard upper bound one can give.



Of course, typically $p$ and $q$ are chosen at random from among primes having the same bitlength in binary, meaning that the expected value of $|p-q|$ is roughly proportional to $N^frac12$.






share|improve this answer




















  • Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
    – Marc Ilunga
    3 hours ago






  • 1




    With $N$ at hand, trial division allows a small improvement :-)
    – fgrieu
    2 hours ago






  • 1




    Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
    – fgrieu
    2 hours ago











  • Illmari, could you write the reason for the bound into the question?
    – kelalaka
    25 mins ago










Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "281"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f63789%2fupper-bounds-on-difference-of-rsa-primes%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote













Given that $p$ and $q$ are prime, they must be at least $2$, so $|p-q| le frac 12N - 2$. I'm pretty sure that's the only hard upper bound one can give.



Of course, typically $p$ and $q$ are chosen at random from among primes having the same bitlength in binary, meaning that the expected value of $|p-q|$ is roughly proportional to $N^frac12$.






share|improve this answer




















  • Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
    – Marc Ilunga
    3 hours ago






  • 1




    With $N$ at hand, trial division allows a small improvement :-)
    – fgrieu
    2 hours ago






  • 1




    Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
    – fgrieu
    2 hours ago











  • Illmari, could you write the reason for the bound into the question?
    – kelalaka
    25 mins ago














up vote
4
down vote













Given that $p$ and $q$ are prime, they must be at least $2$, so $|p-q| le frac 12N - 2$. I'm pretty sure that's the only hard upper bound one can give.



Of course, typically $p$ and $q$ are chosen at random from among primes having the same bitlength in binary, meaning that the expected value of $|p-q|$ is roughly proportional to $N^frac12$.






share|improve this answer




















  • Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
    – Marc Ilunga
    3 hours ago






  • 1




    With $N$ at hand, trial division allows a small improvement :-)
    – fgrieu
    2 hours ago






  • 1




    Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
    – fgrieu
    2 hours ago











  • Illmari, could you write the reason for the bound into the question?
    – kelalaka
    25 mins ago












up vote
4
down vote










up vote
4
down vote









Given that $p$ and $q$ are prime, they must be at least $2$, so $|p-q| le frac 12N - 2$. I'm pretty sure that's the only hard upper bound one can give.



Of course, typically $p$ and $q$ are chosen at random from among primes having the same bitlength in binary, meaning that the expected value of $|p-q|$ is roughly proportional to $N^frac12$.






share|improve this answer












Given that $p$ and $q$ are prime, they must be at least $2$, so $|p-q| le frac 12N - 2$. I'm pretty sure that's the only hard upper bound one can give.



Of course, typically $p$ and $q$ are chosen at random from among primes having the same bitlength in binary, meaning that the expected value of $|p-q|$ is roughly proportional to $N^frac12$.







share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









Ilmari Karonen

33k264131




33k264131











  • Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
    – Marc Ilunga
    3 hours ago






  • 1




    With $N$ at hand, trial division allows a small improvement :-)
    – fgrieu
    2 hours ago






  • 1




    Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
    – fgrieu
    2 hours ago











  • Illmari, could you write the reason for the bound into the question?
    – kelalaka
    25 mins ago
















  • Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
    – Marc Ilunga
    3 hours ago






  • 1




    With $N$ at hand, trial division allows a small improvement :-)
    – fgrieu
    2 hours ago






  • 1




    Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
    – fgrieu
    2 hours ago











  • Illmari, could you write the reason for the bound into the question?
    – kelalaka
    25 mins ago















Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
– Marc Ilunga
3 hours ago




Thanks for your answer, the hidden intent behind the question was also with regard to Fermat factoring methods and variants. Although It seems the way we generate primes for RSA is safe, I was wondering if there is a way to detect if a number is "Fermat"-factorable. In which case $|p - q| < N^1/4$ should be enough. P.S: This has probably low probability of happening but I am curious. ;)
– Marc Ilunga
3 hours ago




1




1




With $N$ at hand, trial division allows a small improvement :-)
– fgrieu
2 hours ago




With $N$ at hand, trial division allows a small improvement :-)
– fgrieu
2 hours ago




1




1




Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
– fgrieu
2 hours ago





Even if we could find "a way to detect if a number is Fermat-factorable", we'd need to insure that $6,N$ can't be factored into $(2,p)(3,q)$ by Fermat's method. And same for $a,b,N$ with a wide choice of $a$ and $b$ coprime...
– fgrieu
2 hours ago













Illmari, could you write the reason for the bound into the question?
– kelalaka
25 mins ago




Illmari, could you write the reason for the bound into the question?
– kelalaka
25 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f63789%2fupper-bounds-on-difference-of-rsa-primes%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke