RSA decrypt long messages (javascript)
I don't know much about the library you're using but it looks like you're trying to encrypt/decrypt the cipher-text using RSA directly.

Using RSA in this way isn't secure unless extreme care is taken.

This isn't the correct way to use RSA. Typically, what you do is use RSA to encrypt a secret key. This secret key is then used with a conventional symmetric cipher, such as AES, to encrypt your payload. Then your payload can be any length you like.

There are standards such as PCKS#1 v2.0 that deal with how to do this securely.