Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Jun 4 '13 at 19:08

This question came from our site for professional and enthusiast programmers. 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 – 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
up vote 7 down vote accepted

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.

share|improve this answer
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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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