RSA: Is it possible to recover the plaintext given that we have the ciphertext and the public key?
$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
rsa
New contributor
$endgroup$
add a comment |
$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
rsa
New contributor
$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
add a comment |
$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
rsa
New contributor
$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
rsa
New contributor
New contributor
edited 2 hours ago
AleksanderRas
2,0391630
2,0391630
New contributor
asked 2 hours ago
Maqruis1Maqruis1
61
61
New contributor
New contributor
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
$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$).
$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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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$).
$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
add a comment |
$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$).
$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
add a comment |
$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$).
$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$).
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
add a comment |
$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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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