Your problem is that you need to encode / decode encrypted text (just text in your code) if you want to wrap it using a text representation ( String in your case).
Try to find base 64 encoding on this site, there should be a lot of information about it. Encode after encryption and decoding before decryption. You must also specify a specific character encoding for your plaintext.
Finally, you probably should encrypt with a symmetric cipher and encrypt a symmetric key with RSA. Otherwise, there may be no space in the RSA calculation, because the public key cannot encrypt data that exceeds its module (key size).
source share