Can not use big prime number for pair of key of RSA Algorithm [on hold] The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Prime number theorem - RSACompare two approaches for cracking RSA keyWhy isn't a table used to solve the large number factoring problem?Are the prime numbers used for RSA encryption known?How can I edit or build an app to encrypt data, and build a decryption key?Why we need pixel data encryption (perceptual encryption), not the complete file encryption (conventional encryption)?Why use RSA-2048 for plaintext when AES-256 is much more secure?Why does this RSA example break when: 1) setting p or q as non-prime, or 2) setting p and q as the same number?Why is a Diffie-Hellman key exchange required when RSA is already being used for key exchange in TLS?Two working decipher keys giving various, valid results for one ciphered message - is it possible?
Is every episode of "Where are my Pants?" identical?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Why did Peik Lin say, "I'm not an animal"?
What was the last x86 CPU that did not have the x87 floating-point unit built in?
What's the point in a preamp?
Loose spokes after only a few rides
Did the new image of black hole confirm the general theory of relativity?
Using dividends to reduce short term capital gains?
Working through the single responsibility principle (SRP) in Python when calls are expensive
Do I have Disadvantage attacking with an off-hand weapon?
Does Parliament hold absolute power in the UK?
How to handle characters who are more educated than the author?
Variable with quotation marks "$()"
What information about me do stores get via my credit card?
Python - Fishing Simulator
Word to describe a time interval
How to determine omitted units in a publication
How to type a long/em dash `—`
Huge performance difference of the command find with and without using %M option to show permissions
Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?
How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time
"is" operation returns false with ndarray.data attribute, even though two array objects have same id
What do I do when my TA workload is more than expected?
Do warforged have souls?
Can not use big prime number for pair of key of RSA Algorithm [on hold]
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Prime number theorem - RSACompare two approaches for cracking RSA keyWhy isn't a table used to solve the large number factoring problem?Are the prime numbers used for RSA encryption known?How can I edit or build an app to encrypt data, and build a decryption key?Why we need pixel data encryption (perceptual encryption), not the complete file encryption (conventional encryption)?Why use RSA-2048 for plaintext when AES-256 is much more secure?Why does this RSA example break when: 1) setting p or q as non-prime, or 2) setting p and q as the same number?Why is a Diffie-Hellman key exchange required when RSA is already being used for key exchange in TLS?Two working decipher keys giving various, valid results for one ciphered message - is it possible?
$begingroup$
I'm new to cryptography. I have a binary image with 64x64 pixel in size. I perform an encryption to the image using RSA Algorithm. I wanna ask something bothering me, why can I not use big prime numbers as a pair of key for the RSA algorithm? Thank you in advance.
encryption rsa keys
New contributor
$endgroup$
put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose♦ Apr 8 at 17:48
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
$begingroup$
I'm new to cryptography. I have a binary image with 64x64 pixel in size. I perform an encryption to the image using RSA Algorithm. I wanna ask something bothering me, why can I not use big prime numbers as a pair of key for the RSA algorithm? Thank you in advance.
encryption rsa keys
New contributor
$endgroup$
put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose♦ Apr 8 at 17:48
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
4
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05
add a comment |
$begingroup$
I'm new to cryptography. I have a binary image with 64x64 pixel in size. I perform an encryption to the image using RSA Algorithm. I wanna ask something bothering me, why can I not use big prime numbers as a pair of key for the RSA algorithm? Thank you in advance.
encryption rsa keys
New contributor
$endgroup$
I'm new to cryptography. I have a binary image with 64x64 pixel in size. I perform an encryption to the image using RSA Algorithm. I wanna ask something bothering me, why can I not use big prime numbers as a pair of key for the RSA algorithm? Thank you in advance.
encryption rsa keys
encryption rsa keys
New contributor
New contributor
edited Apr 8 at 7:10
AleksanderRas
3,0021937
3,0021937
New contributor
asked Apr 8 at 6:05
user67286user67286
41
41
New contributor
New contributor
put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose♦ Apr 8 at 17:48
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose♦ Apr 8 at 17:48
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
4
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05
add a comment |
4
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05
4
4
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Although it is theoretical possible to create two large primes and use that to establish the private and public key, there are real issues doing so. First of all, let's check how big a modulus you need, as that defines the size of the two primes.
Let's assume color, and use the RGB color space without gamma, each color having 8 bits of color depth. That means each pixel uses 3 bytes. So your bitmap takes $64 cdot 64 cdot 3 cdot 8 = 98304$ bits. That's excluding overhead of both the image as well as the overhead required for the padding required for secure RSA encryption (both of which may be insignificant with these kind of values).
This requires you to find two primes of half the number of bits to create secure RSA, assuming that you use the regular RSA and not multi-prime RSA. Unfortunately, even a modern CPU can take time to calculate an 8K-bit modulus. The problem is that each prime number is now close to 49152 bits. The density of primes is much smaller for such large spaces. Furthermore, doing primality testing on that kind of values will take a lot of time. So the time to find the primes $p$ and $q$ grows very rapidly (a factor of 12 to 16 for each additional bit). So the time to generate a key pair that size is prohibitively large (and depends on chance as well).
Just type in openssl genrsa 98304
on your computer to use it as a heater.
So key pair generation is a huge issue at these key sizes. Performing any modular exponentiation with these kind of exponents and modulus sizes will be a lesser-but-still-significant issue as well. Many cryptographic libraries will have maximum key sizes for these reasons (and others, such as limiting testing, memory usage etc.).
So what can you do? Well: you can simply split up your plaintext into blocks and encrypt each with RSA. This will still be slow and will expand your ciphertext significantly compared to the plaintext image size, as padding the blocks is required.
What most cryptographers do is to pair the RSA algorithm with a symmetric cipher such as AES. In that case you can generate a random AES key and use that to encrypt the image (using a secure mode of operation). Then the AES key itself can be encrypted using the RSA public key. This kind of scheme is called a hybrid cryptosystem.
$endgroup$
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Although it is theoretical possible to create two large primes and use that to establish the private and public key, there are real issues doing so. First of all, let's check how big a modulus you need, as that defines the size of the two primes.
Let's assume color, and use the RGB color space without gamma, each color having 8 bits of color depth. That means each pixel uses 3 bytes. So your bitmap takes $64 cdot 64 cdot 3 cdot 8 = 98304$ bits. That's excluding overhead of both the image as well as the overhead required for the padding required for secure RSA encryption (both of which may be insignificant with these kind of values).
This requires you to find two primes of half the number of bits to create secure RSA, assuming that you use the regular RSA and not multi-prime RSA. Unfortunately, even a modern CPU can take time to calculate an 8K-bit modulus. The problem is that each prime number is now close to 49152 bits. The density of primes is much smaller for such large spaces. Furthermore, doing primality testing on that kind of values will take a lot of time. So the time to find the primes $p$ and $q$ grows very rapidly (a factor of 12 to 16 for each additional bit). So the time to generate a key pair that size is prohibitively large (and depends on chance as well).
Just type in openssl genrsa 98304
on your computer to use it as a heater.
So key pair generation is a huge issue at these key sizes. Performing any modular exponentiation with these kind of exponents and modulus sizes will be a lesser-but-still-significant issue as well. Many cryptographic libraries will have maximum key sizes for these reasons (and others, such as limiting testing, memory usage etc.).
So what can you do? Well: you can simply split up your plaintext into blocks and encrypt each with RSA. This will still be slow and will expand your ciphertext significantly compared to the plaintext image size, as padding the blocks is required.
What most cryptographers do is to pair the RSA algorithm with a symmetric cipher such as AES. In that case you can generate a random AES key and use that to encrypt the image (using a secure mode of operation). Then the AES key itself can be encrypted using the RSA public key. This kind of scheme is called a hybrid cryptosystem.
$endgroup$
add a comment |
$begingroup$
Although it is theoretical possible to create two large primes and use that to establish the private and public key, there are real issues doing so. First of all, let's check how big a modulus you need, as that defines the size of the two primes.
Let's assume color, and use the RGB color space without gamma, each color having 8 bits of color depth. That means each pixel uses 3 bytes. So your bitmap takes $64 cdot 64 cdot 3 cdot 8 = 98304$ bits. That's excluding overhead of both the image as well as the overhead required for the padding required for secure RSA encryption (both of which may be insignificant with these kind of values).
This requires you to find two primes of half the number of bits to create secure RSA, assuming that you use the regular RSA and not multi-prime RSA. Unfortunately, even a modern CPU can take time to calculate an 8K-bit modulus. The problem is that each prime number is now close to 49152 bits. The density of primes is much smaller for such large spaces. Furthermore, doing primality testing on that kind of values will take a lot of time. So the time to find the primes $p$ and $q$ grows very rapidly (a factor of 12 to 16 for each additional bit). So the time to generate a key pair that size is prohibitively large (and depends on chance as well).
Just type in openssl genrsa 98304
on your computer to use it as a heater.
So key pair generation is a huge issue at these key sizes. Performing any modular exponentiation with these kind of exponents and modulus sizes will be a lesser-but-still-significant issue as well. Many cryptographic libraries will have maximum key sizes for these reasons (and others, such as limiting testing, memory usage etc.).
So what can you do? Well: you can simply split up your plaintext into blocks and encrypt each with RSA. This will still be slow and will expand your ciphertext significantly compared to the plaintext image size, as padding the blocks is required.
What most cryptographers do is to pair the RSA algorithm with a symmetric cipher such as AES. In that case you can generate a random AES key and use that to encrypt the image (using a secure mode of operation). Then the AES key itself can be encrypted using the RSA public key. This kind of scheme is called a hybrid cryptosystem.
$endgroup$
add a comment |
$begingroup$
Although it is theoretical possible to create two large primes and use that to establish the private and public key, there are real issues doing so. First of all, let's check how big a modulus you need, as that defines the size of the two primes.
Let's assume color, and use the RGB color space without gamma, each color having 8 bits of color depth. That means each pixel uses 3 bytes. So your bitmap takes $64 cdot 64 cdot 3 cdot 8 = 98304$ bits. That's excluding overhead of both the image as well as the overhead required for the padding required for secure RSA encryption (both of which may be insignificant with these kind of values).
This requires you to find two primes of half the number of bits to create secure RSA, assuming that you use the regular RSA and not multi-prime RSA. Unfortunately, even a modern CPU can take time to calculate an 8K-bit modulus. The problem is that each prime number is now close to 49152 bits. The density of primes is much smaller for such large spaces. Furthermore, doing primality testing on that kind of values will take a lot of time. So the time to find the primes $p$ and $q$ grows very rapidly (a factor of 12 to 16 for each additional bit). So the time to generate a key pair that size is prohibitively large (and depends on chance as well).
Just type in openssl genrsa 98304
on your computer to use it as a heater.
So key pair generation is a huge issue at these key sizes. Performing any modular exponentiation with these kind of exponents and modulus sizes will be a lesser-but-still-significant issue as well. Many cryptographic libraries will have maximum key sizes for these reasons (and others, such as limiting testing, memory usage etc.).
So what can you do? Well: you can simply split up your plaintext into blocks and encrypt each with RSA. This will still be slow and will expand your ciphertext significantly compared to the plaintext image size, as padding the blocks is required.
What most cryptographers do is to pair the RSA algorithm with a symmetric cipher such as AES. In that case you can generate a random AES key and use that to encrypt the image (using a secure mode of operation). Then the AES key itself can be encrypted using the RSA public key. This kind of scheme is called a hybrid cryptosystem.
$endgroup$
Although it is theoretical possible to create two large primes and use that to establish the private and public key, there are real issues doing so. First of all, let's check how big a modulus you need, as that defines the size of the two primes.
Let's assume color, and use the RGB color space without gamma, each color having 8 bits of color depth. That means each pixel uses 3 bytes. So your bitmap takes $64 cdot 64 cdot 3 cdot 8 = 98304$ bits. That's excluding overhead of both the image as well as the overhead required for the padding required for secure RSA encryption (both of which may be insignificant with these kind of values).
This requires you to find two primes of half the number of bits to create secure RSA, assuming that you use the regular RSA and not multi-prime RSA. Unfortunately, even a modern CPU can take time to calculate an 8K-bit modulus. The problem is that each prime number is now close to 49152 bits. The density of primes is much smaller for such large spaces. Furthermore, doing primality testing on that kind of values will take a lot of time. So the time to find the primes $p$ and $q$ grows very rapidly (a factor of 12 to 16 for each additional bit). So the time to generate a key pair that size is prohibitively large (and depends on chance as well).
Just type in openssl genrsa 98304
on your computer to use it as a heater.
So key pair generation is a huge issue at these key sizes. Performing any modular exponentiation with these kind of exponents and modulus sizes will be a lesser-but-still-significant issue as well. Many cryptographic libraries will have maximum key sizes for these reasons (and others, such as limiting testing, memory usage etc.).
So what can you do? Well: you can simply split up your plaintext into blocks and encrypt each with RSA. This will still be slow and will expand your ciphertext significantly compared to the plaintext image size, as padding the blocks is required.
What most cryptographers do is to pair the RSA algorithm with a symmetric cipher such as AES. In that case you can generate a random AES key and use that to encrypt the image (using a secure mode of operation). Then the AES key itself can be encrypted using the RSA public key. This kind of scheme is called a hybrid cryptosystem.
edited Apr 8 at 9:11
answered Apr 8 at 8:40
Maarten Bodewes♦Maarten Bodewes
55.8k679196
55.8k679196
add a comment |
add a comment |
4
$begingroup$
You can, nobody is preventing you! There is, however, a problem with performance. The larger modulus the slower the encryption. Keep in mind that the general practice is using Hybrid Encryption.
$endgroup$
– kelalaka
Apr 8 at 7:51
$begingroup$
Big prime numbers for what part of the key pair? An RSA key pair typically consists of $e, N$ for the public key, and depending on implementation $d, N$, or $d, p, q$ (or some other variation of that information). Right now it's not clear what you're asking, and it is possible the question may end up closed until it can be clarified. Please use the "edit" link beneath the question to include what part of the key pair you want to be large primes, and please why you want this as well.
$endgroup$
– Ella Rose♦
Apr 8 at 14:21
$begingroup$
If you manage to generate the keypair, you won't have to upgrade for quantum attacks for a longer time than anybody else. Big keypairs suck for quantum computers.
$endgroup$
– Joshua
Apr 8 at 15:05