# If RSA is limited to 117-200 bytes or so, is that a very limited use case?

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?

-

## migrated from stackoverflow.comJun 4 '13 at 19:08

This question came from our site for professional and enthusiast programmers.

en.wikipedia.org/wiki/RSA_(algorithm) doesn't say anything about a limit. – Robert Harvey Jun 4 '13 at 19:06
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 – Gal Jun 4 '13 at 19:07
@RobertHarvey I seem to read about the limit in forums everywhere, isn't the limit 117-200 bytes? – user1361315 Jun 4 '13 at 19:10
@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. – CodesInChaos Jun 4 '13 at 19:15
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. – CodesInChaos Jun 4 '13 at 19:27

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.

-
I see, so its often used to encrypt say a AES key, but the message is encrypted using AES. – user1361315 Jun 4 '13 at 19:18
@user1361315 Exactly. – erickson Jun 4 '13 at 19:20

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.

-

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.

-