RSA: Is it possible to recover the plaintext given that we have the ciphertext and the public key?












1












$begingroup$


The $N$ and ciphertext are huge number that is more than 600 digits long.



I'm trying to find the prime factors of $N$ in order to get $p$ and $q$. Using $p$ and $q$ I can get $phi(n)$. And using $phi(n)$ and the public key I would be able to calculate the private key.



So, my question is if it is possible to recover the plaintext given that we have ciphertext and the public key?



If so, is it computationally feasible?

Thank you










share|improve this question









New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
    $endgroup$
    – Daniel
    2 hours ago








  • 3




    $begingroup$
    What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
    $endgroup$
    – Maarten Bodewes
    1 hour ago


















1












$begingroup$


The $N$ and ciphertext are huge number that is more than 600 digits long.



I'm trying to find the prime factors of $N$ in order to get $p$ and $q$. Using $p$ and $q$ I can get $phi(n)$. And using $phi(n)$ and the public key I would be able to calculate the private key.



So, my question is if it is possible to recover the plaintext given that we have ciphertext and the public key?



If so, is it computationally feasible?

Thank you










share|improve this question









New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 2




    $begingroup$
    Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
    $endgroup$
    – Daniel
    2 hours ago








  • 3




    $begingroup$
    What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
    $endgroup$
    – Maarten Bodewes
    1 hour ago
















1












1








1





$begingroup$


The $N$ and ciphertext are huge number that is more than 600 digits long.



I'm trying to find the prime factors of $N$ in order to get $p$ and $q$. Using $p$ and $q$ I can get $phi(n)$. And using $phi(n)$ and the public key I would be able to calculate the private key.



So, my question is if it is possible to recover the plaintext given that we have ciphertext and the public key?



If so, is it computationally feasible?

Thank you










share|improve this question









New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




The $N$ and ciphertext are huge number that is more than 600 digits long.



I'm trying to find the prime factors of $N$ in order to get $p$ and $q$. Using $p$ and $q$ I can get $phi(n)$. And using $phi(n)$ and the public key I would be able to calculate the private key.



So, my question is if it is possible to recover the plaintext given that we have ciphertext and the public key?



If so, is it computationally feasible?

Thank you







rsa






share|improve this question









New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 hours ago









AleksanderRas

2,0391630




2,0391630






New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









Maqruis1Maqruis1

61




61




New contributor




Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Maqruis1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2




    $begingroup$
    Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
    $endgroup$
    – Daniel
    2 hours ago








  • 3




    $begingroup$
    What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
    $endgroup$
    – Maarten Bodewes
    1 hour ago
















  • 2




    $begingroup$
    Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
    $endgroup$
    – Daniel
    2 hours ago








  • 3




    $begingroup$
    What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
    $endgroup$
    – Maarten Bodewes
    1 hour ago










2




2




$begingroup$
Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
$endgroup$
– Daniel
2 hours ago






$begingroup$
Doing so means essentially breaking the scheme, right? The public key is known (hence the term public), and the modulus $N$ is part of the public key. Thus, what you're asking is whether or not we can find the underlying plaintext corresponding to some given ciphertext, which should not be possible according to our belief on the security of RSA.
$endgroup$
– Daniel
2 hours ago






3




3




$begingroup$
What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
$endgroup$
– Maarten Bodewes
1 hour ago






$begingroup$
What kind of digits are that? Bits? Decimals? If they are decimals - which for us humans is kind of the default - then we're probably talking about a 2048 bit key, and RSA 2048 is certainly unbreakable if the key pair generation and decryption procedures are implemented correctly.... Please clarify the type of digits.
$endgroup$
– Maarten Bodewes
1 hour ago












1 Answer
1






active

oldest

votes


















3












$begingroup$

It might be feasible, or not.



If "digits" had been binary digits or bits, the answer would have been yes. Anything about 600-bit can be factored by GNFS. The public record is for a 768-bit RSA modulus, factored in 2009. 600-bit is within reach of CADO-NFS and Msieve. That's even packaged into factoring as a service for semi-deep-pocketed script kiddies.



It could be that $N$ was poorly chosen and can be factored much more easily than by GNFS. Since the generation algorithm is unspecified, we can't tell. Poor RSA key generators have happened (see e.g. SmartFacts, ROCA, and predictable SSH hosts keys on way too many platforms).



It could also be that the encryption system used is plaintext RSA, where the ciphertext is $C=M^ebmod N$ with $M$ the plaintext. This contrasts secure RSA, where $M$ is obtained from plaintext and randomness using a padding scheme such as OAEP. If $M$ is the plaintext (or a known deterministic function of the plaintext), some attacks much easier than factoring the modulus might be possible:




  • if $M$ is in a known small set (names on the class roll, 16-digit credit-card number), it is possible to enumerate possible $M$, perform encryption, and check against the ciphertext.

  • if $M=Ucdot V$ with $U<2^u$, $V<2^v$ (which is likely when $Mll2^{u,v}$ ) then there's a Meet-in-the-Midle attack with cost $O(2^{max(u,v)})$ time and $O(2^{min(u,v)})$ memory.

  • if $M<sqrt[e]N$ we have the $e^text{th}$ root attack (which can be extended to slightly larger $M$).






share|improve this answer











$endgroup$













  • $begingroup$
    Could you post a link for the Meet-in -the-Middle attack?
    $endgroup$
    – kelalaka
    26 mins ago






  • 1




    $begingroup$
    @kelalaka: see this, item 3
    $endgroup$
    – fgrieu
    21 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',
autoActivateHeartbeat: false,
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
});


}
});






Maqruis1 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f66582%2frsa-is-it-possible-to-recover-the-plaintext-given-that-we-have-the-ciphertext-a%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3












$begingroup$

It might be feasible, or not.



If "digits" had been binary digits or bits, the answer would have been yes. Anything about 600-bit can be factored by GNFS. The public record is for a 768-bit RSA modulus, factored in 2009. 600-bit is within reach of CADO-NFS and Msieve. That's even packaged into factoring as a service for semi-deep-pocketed script kiddies.



It could be that $N$ was poorly chosen and can be factored much more easily than by GNFS. Since the generation algorithm is unspecified, we can't tell. Poor RSA key generators have happened (see e.g. SmartFacts, ROCA, and predictable SSH hosts keys on way too many platforms).



It could also be that the encryption system used is plaintext RSA, where the ciphertext is $C=M^ebmod N$ with $M$ the plaintext. This contrasts secure RSA, where $M$ is obtained from plaintext and randomness using a padding scheme such as OAEP. If $M$ is the plaintext (or a known deterministic function of the plaintext), some attacks much easier than factoring the modulus might be possible:




  • if $M$ is in a known small set (names on the class roll, 16-digit credit-card number), it is possible to enumerate possible $M$, perform encryption, and check against the ciphertext.

  • if $M=Ucdot V$ with $U<2^u$, $V<2^v$ (which is likely when $Mll2^{u,v}$ ) then there's a Meet-in-the-Midle attack with cost $O(2^{max(u,v)})$ time and $O(2^{min(u,v)})$ memory.

  • if $M<sqrt[e]N$ we have the $e^text{th}$ root attack (which can be extended to slightly larger $M$).






share|improve this answer











$endgroup$













  • $begingroup$
    Could you post a link for the Meet-in -the-Middle attack?
    $endgroup$
    – kelalaka
    26 mins ago






  • 1




    $begingroup$
    @kelalaka: see this, item 3
    $endgroup$
    – fgrieu
    21 mins ago
















3












$begingroup$

It might be feasible, or not.



If "digits" had been binary digits or bits, the answer would have been yes. Anything about 600-bit can be factored by GNFS. The public record is for a 768-bit RSA modulus, factored in 2009. 600-bit is within reach of CADO-NFS and Msieve. That's even packaged into factoring as a service for semi-deep-pocketed script kiddies.



It could be that $N$ was poorly chosen and can be factored much more easily than by GNFS. Since the generation algorithm is unspecified, we can't tell. Poor RSA key generators have happened (see e.g. SmartFacts, ROCA, and predictable SSH hosts keys on way too many platforms).



It could also be that the encryption system used is plaintext RSA, where the ciphertext is $C=M^ebmod N$ with $M$ the plaintext. This contrasts secure RSA, where $M$ is obtained from plaintext and randomness using a padding scheme such as OAEP. If $M$ is the plaintext (or a known deterministic function of the plaintext), some attacks much easier than factoring the modulus might be possible:




  • if $M$ is in a known small set (names on the class roll, 16-digit credit-card number), it is possible to enumerate possible $M$, perform encryption, and check against the ciphertext.

  • if $M=Ucdot V$ with $U<2^u$, $V<2^v$ (which is likely when $Mll2^{u,v}$ ) then there's a Meet-in-the-Midle attack with cost $O(2^{max(u,v)})$ time and $O(2^{min(u,v)})$ memory.

  • if $M<sqrt[e]N$ we have the $e^text{th}$ root attack (which can be extended to slightly larger $M$).






share|improve this answer











$endgroup$













  • $begingroup$
    Could you post a link for the Meet-in -the-Middle attack?
    $endgroup$
    – kelalaka
    26 mins ago






  • 1




    $begingroup$
    @kelalaka: see this, item 3
    $endgroup$
    – fgrieu
    21 mins ago














3












3








3





$begingroup$

It might be feasible, or not.



If "digits" had been binary digits or bits, the answer would have been yes. Anything about 600-bit can be factored by GNFS. The public record is for a 768-bit RSA modulus, factored in 2009. 600-bit is within reach of CADO-NFS and Msieve. That's even packaged into factoring as a service for semi-deep-pocketed script kiddies.



It could be that $N$ was poorly chosen and can be factored much more easily than by GNFS. Since the generation algorithm is unspecified, we can't tell. Poor RSA key generators have happened (see e.g. SmartFacts, ROCA, and predictable SSH hosts keys on way too many platforms).



It could also be that the encryption system used is plaintext RSA, where the ciphertext is $C=M^ebmod N$ with $M$ the plaintext. This contrasts secure RSA, where $M$ is obtained from plaintext and randomness using a padding scheme such as OAEP. If $M$ is the plaintext (or a known deterministic function of the plaintext), some attacks much easier than factoring the modulus might be possible:




  • if $M$ is in a known small set (names on the class roll, 16-digit credit-card number), it is possible to enumerate possible $M$, perform encryption, and check against the ciphertext.

  • if $M=Ucdot V$ with $U<2^u$, $V<2^v$ (which is likely when $Mll2^{u,v}$ ) then there's a Meet-in-the-Midle attack with cost $O(2^{max(u,v)})$ time and $O(2^{min(u,v)})$ memory.

  • if $M<sqrt[e]N$ we have the $e^text{th}$ root attack (which can be extended to slightly larger $M$).






share|improve this answer











$endgroup$



It might be feasible, or not.



If "digits" had been binary digits or bits, the answer would have been yes. Anything about 600-bit can be factored by GNFS. The public record is for a 768-bit RSA modulus, factored in 2009. 600-bit is within reach of CADO-NFS and Msieve. That's even packaged into factoring as a service for semi-deep-pocketed script kiddies.



It could be that $N$ was poorly chosen and can be factored much more easily than by GNFS. Since the generation algorithm is unspecified, we can't tell. Poor RSA key generators have happened (see e.g. SmartFacts, ROCA, and predictable SSH hosts keys on way too many platforms).



It could also be that the encryption system used is plaintext RSA, where the ciphertext is $C=M^ebmod N$ with $M$ the plaintext. This contrasts secure RSA, where $M$ is obtained from plaintext and randomness using a padding scheme such as OAEP. If $M$ is the plaintext (or a known deterministic function of the plaintext), some attacks much easier than factoring the modulus might be possible:




  • if $M$ is in a known small set (names on the class roll, 16-digit credit-card number), it is possible to enumerate possible $M$, perform encryption, and check against the ciphertext.

  • if $M=Ucdot V$ with $U<2^u$, $V<2^v$ (which is likely when $Mll2^{u,v}$ ) then there's a Meet-in-the-Midle attack with cost $O(2^{max(u,v)})$ time and $O(2^{min(u,v)})$ memory.

  • if $M<sqrt[e]N$ we have the $e^text{th}$ root attack (which can be extended to slightly larger $M$).







share|improve this answer














share|improve this answer



share|improve this answer








edited 55 mins ago

























answered 1 hour ago









fgrieufgrieu

78.2k7166331




78.2k7166331












  • $begingroup$
    Could you post a link for the Meet-in -the-Middle attack?
    $endgroup$
    – kelalaka
    26 mins ago






  • 1




    $begingroup$
    @kelalaka: see this, item 3
    $endgroup$
    – fgrieu
    21 mins ago


















  • $begingroup$
    Could you post a link for the Meet-in -the-Middle attack?
    $endgroup$
    – kelalaka
    26 mins ago






  • 1




    $begingroup$
    @kelalaka: see this, item 3
    $endgroup$
    – fgrieu
    21 mins ago
















$begingroup$
Could you post a link for the Meet-in -the-Middle attack?
$endgroup$
– kelalaka
26 mins ago




$begingroup$
Could you post a link for the Meet-in -the-Middle attack?
$endgroup$
– kelalaka
26 mins ago




1




1




$begingroup$
@kelalaka: see this, item 3
$endgroup$
– fgrieu
21 mins ago




$begingroup$
@kelalaka: see this, item 3
$endgroup$
– fgrieu
21 mins ago










Maqruis1 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Maqruis1 is a new contributor. Be nice, and check out our Code of Conduct.













Maqruis1 is a new contributor. Be nice, and check out our Code of Conduct.












Maqruis1 is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Cryptography Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f66582%2frsa-is-it-possible-to-recover-the-plaintext-given-that-we-have-the-ciphertext-a%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Magento 2 controller redirect on button click in phtml file

Polycentropodidae