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












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 yesterday


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
    yesterday










  • $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
    yesterday












  • $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
    yesterday
















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 yesterday


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
    yesterday










  • $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
    yesterday












  • $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
    yesterday














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 yesterday









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 yesterday









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 yesterday


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 yesterday


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
    yesterday










  • $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
    yesterday












  • $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
    yesterday














  • 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
    yesterday










  • $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
    yesterday












  • $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
    yesterday








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
yesterday




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












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






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














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




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










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 yesterday

























        answered yesterday









        Maarten BodewesMaarten Bodewes

        55.8k679196




        55.8k679196















            Popular posts from this blog

            He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

            Bunad

            Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum