RSA encryption output size

hyda picture hyda · Sep 6, 2014 · Viewed 31.1k times · Source

What is RSA encryption output size when using 2048 bit key and pkcs1padding.

Is it always 256 bytes independent of input size?

How can i calculate it for other key sizes?

Answer

i_turo picture i_turo · Sep 6, 2014

Yes, it is.

The output-size should always equals the size of the Modulus (part of the key), so:

2048 bit Modulus -> 2048 bit output
1024 bit Modulus -> 1024 bit output
...

If it is not, there exist numerous attacks on RSA, see here for basic information about that.

So to guarantee that the output is 2048 bit even when the input to encrypt is, let's say 7,
a padding must always be applied!