3
$\begingroup$

Am I missing something, or is RSA very very limiting when it comes to ecrypting data when it comes to the actual message size?

I have read that you can only encrypt a message of around 117 to 200 bytes in size (depending on your key size: 1024 or 2048 bits). Is this correct?

If so, I think I have read people suggesting on using it for larger files. I guess they are just repeating the process many times over and over in blocks of 117 bytes?

$\endgroup$
  • $\begingroup$ en.wikipedia.org/wiki/RSA_(algorithm) doesn't say anything about a limit. $\endgroup$ – Robert Harvey Jun 4 '13 at 19:06
  • $\begingroup$ You are correct in that RSA can be used to encrypt larger blocks by repeatedly encrypting each block. As to how this can be done, see en.wikipedia.org/wiki/Block_cipher_mode_of_operation $\endgroup$ – Gal Jun 4 '13 at 19:07
  • $\begingroup$ @RobertHarvey I seem to read about the limit in forums everywhere, isn't the limit 117-200 bytes? $\endgroup$ – user1361315 Jun 4 '13 at 19:10
  • 1
    $\begingroup$ @RobertHarvey An RSA modulus is typically between 1024 and 4096 bits, minus padding this allows you to put a few hundred bytes in it. In theory it's possible to split the message into multiple RSA blocks to overcome the limit, but there are no standard ways of doing this because it's a really dumb idea. $\endgroup$ – CodesInChaos Jun 4 '13 at 19:15
  • $\begingroup$ Some people call RSA a block cipher, but that is not a useful way of viewing it. RSA certainly doesn't fulfill the security requirements of a block cipher, and it can't be used in typical modes of operation. $\endgroup$ – CodesInChaos Jun 4 '13 at 19:27
7
$\begingroup$

In practice, asymmetric algorithms like RSA are usually used for key transport. In other words, instead of a true message, they are used to encrypt a secret key for a symmetric cipher.

That symmetric cipher key is used to encrypt the actual message, and that could be gigabytes, depending on the algorithm.

Standards like TLS, PGP, and S/MIME use RSA in this way.

By the way, a limit of 117 bytes is for a 1024-bit RSA key. Keys that small are no longer recommended.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I see, so its often used to encrypt say a AES key, but the message is encrypted using AES. $\endgroup$ – user1361315 Jun 4 '13 at 19:18
  • $\begingroup$ @user1361315 Exactly. $\endgroup$ – erickson Jun 4 '13 at 19:20
0
$\begingroup$

RSA is typcially used for a Symmetric Key Exchange, so most cases dont need more bytes. You can,however repeat the encryption for each block of the message.

| improve this answer | |
$\endgroup$
0
$\begingroup$

The normal way to encrypt larger data blocks is to use a symmetric crypto algorithm to encrypt the actual data, and then encrypt the symmetric key using RSA.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.