Can not use big prime number for pair of key of RSA Algorithm [closed] Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?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?

How can players take actions together that are impossible otherwise?

Cauchy Sequence Characterized only By Directly Neighbouring Sequence Members

Can I add database to AWS RDS MySQL without creating new instance?

Replacing HDD with SSD; what about non-APFS/APFS?

Windows 10: How to Lock (not sleep) laptop on lid close?

Notation for two qubit composite product state

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Active filter with series inductor and resistor - do these exist?

3 doors, three guards, one stone

Stars Make Stars

Using "nakedly" instead of "with nothing on"

What LEGO pieces have "real-world" functionality?

Direct Experience of Meditation

What do you call the holes in a flute?

Do working physicists consider Newtonian mechanics to be "falsified"?

Estimate capacitor parameters

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

If A makes B more likely then B makes A more likely"

Can I throw a longsword at someone?

When communicating altitude with a '9' in it, should it be pronounced "nine hundred" or "niner hundred"?

Is it possible to ask for a hotel room without minibar/extra services?

Autumning in love

Did the new image of black hole confirm the general theory of relativity?

Stopping real property loss from eroding embankment



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



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?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?










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$



closed 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















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$



closed 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













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 Apr 8 at 7:10









AleksanderRas

3,0021937




3,0021937






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 Apr 8 at 6:05









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.




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









closed 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












  • 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










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 Apr 8 at 9:11

























        answered Apr 8 at 8:40









        Maarten BodewesMaarten Bodewes

        55.8k679196




        55.8k679196













            Popular posts from this blog

            រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

            Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

            QGIS export composer to PDF scale the map [closed] Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Print Composer QGIS 2.6, how to export image?QGIS 2.8.1 print composer won't export all OpenCycleMap base layer tilesSave Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?Export QGIS Print Composer PDF with searchable text labelsQGIS Print Composer does not change from landscape to portrait orientation?How can I avoid map size and scale changes in print composer?Fuzzy PDF export in QGIS running on macSierra OSExport the legend into its 100% size using Print ComposerScale-dependent rendering in QGIS PDF output