# RSA : if my key and message are too large , how to do?

I want to send a message consisting of a string of number (e.g: 124124134235235)

Then, p:125243 q:56454547

e: 2659043

d: 5261378624675

However, it will be too large...so, is there any solution to easily encrypt the message?

Or, I can divide "124124134235235" as 1 2 4 1 2 .... encrypting each number before sending the message?

It is so hard to be decrypted as well. Thank you

• Use hybrid encryption or split the message. – SEJPM Oct 15 '17 at 11:48
• Also, don't use Textbook RSA for anything practical. – yyyyyyy Oct 15 '17 at 12:56
• Looking for dupes, I found this old related question – Maarten Bodewes Oct 15 '17 at 14:01
• Unless a two key solution (asymmetric encryption) is required consider using symmetric encryption such as AES. AES keys are 128, 192 or 256 bits in size and allow essentially unlimited data length to be encrypted. If you require asymmetric encryption you can use hybrid encryption. – zaph Oct 15 '17 at 14:30

You can first decide on a value for the security parameter $\lambda$ and based on that, select randomly the primes $p$ and $q$. Now, since you are bound to have your message $< n(=p.q)$, you can now split your message into chunks of bitsize $< \lfloor log_2(n)\rfloor+1$. This way you will get an optimal splitting.