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

  • 5
    $\begingroup$ Use hybrid encryption or split the message. $\endgroup$
    – SEJPM
    Commented Oct 15, 2017 at 11:48
  • 2
    $\begingroup$ Also, don't use Textbook RSA for anything practical. $\endgroup$
    – yyyyyyy
    Commented Oct 15, 2017 at 12:56
  • $\begingroup$ Looking for dupes, I found this old related question $\endgroup$
    – Maarten Bodewes
    Commented Oct 15, 2017 at 14:01
  • $\begingroup$ 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. $\endgroup$
    – zaph
    Commented Oct 15, 2017 at 14:30

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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