Can not use big prime number for pair of key of RSA Algorithm [on hold] The 2019 Stack Overflow Developer Survey Results Are InPrime 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?

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Shouldn't "much" here be used instead of "more"?

Is an up-to-date browser secure on an out-of-date OS?

Falsification in Math vs Science

Origin of "cooter" meaning "vagina"

Is flight data recorder erased after every flight?

Button changing it's text & action. Good or terrible?

What do hard-Brexiteers want with respect to the Irish border?

What is the meaning of Triage in Cybersec world?

One word riddle: Vowel in the middle

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?

What do the Banks children have against barley water?

Why can Shazam fly?

Does the shape of a die affect the probability of a number being rolled?

How come people say “Would of”?

"as much details as you can remember"

Worn-tile Scrabble

Is there a symbol for a right arrow with a square in the middle?

Have you ever entered Singapore using a different passport or name?

What is the closest word meaning "respect for time / mindful"

Lightning Grid - Columns and Rows?

Is a "Democratic" Oligarchy-Style System Possible?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?



Can not use big prime number for pair of key of RSA Algorithm [on hold]



The 2019 Stack Overflow Developer Survey Results Are InPrime 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?










0












$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.










share|improve this question









New contributor




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







$endgroup$



put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose 2 days ago


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
    2 days ago










  • $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
    2 days ago











  • $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
    2 days ago















0












$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.










share|improve this question









New contributor




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







$endgroup$



put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose 2 days ago


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
    2 days ago










  • $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
    2 days ago











  • $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
    2 days ago













0












0








0





$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.










share|improve this question









New contributor




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







$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






share|improve this question









New contributor




user67286 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




user67286 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 days ago









AleksanderRas

2,9821935




2,9821935






New contributor




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









asked 2 days ago









user67286user67286

41




41




New contributor




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





New contributor





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






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




put on hold as unclear what you're asking by forest, Squeamish Ossifrage, Ilmari Karonen, Ella Rose 2 days ago


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 2 days ago


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
    2 days ago










  • $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
    2 days ago











  • $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
    2 days ago












  • 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
    2 days ago










  • $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
    2 days ago











  • $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
    2 days ago







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
2 days ago




$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
2 days ago












$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
2 days ago





$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
2 days ago













$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
2 days ago




$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
2 days ago










1 Answer
1






active

oldest

votes


















5












$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.






share|improve this answer











$endgroup$



















    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5












    $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.






    share|improve this answer











    $endgroup$

















      5












      $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.






      share|improve this answer











      $endgroup$















        5












        5








        5





        $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.






        share|improve this answer











        $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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered 2 days ago









        Maarten BodewesMaarten Bodewes

        55.8k679196




        55.8k679196













            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?